Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Many warnings from cmake and can't build with cc1.exe: all warnings being treated as errors #425

Closed
eitsupi opened this issue May 25, 2024 · 10 comments · Fixed by aws/aws-lc#1630

Comments

@eitsupi
Copy link

eitsupi commented May 25, 2024

Problem:

I could not successfully build a package that has this crate as a dependency.
Perhaps there is something wrong with the way I have it set up?

Relevant details

aws-lc-sys@0.17.0

System information: for linux, below info can be collected by running uname -srvmp

  • CPU architecture: x86-64
  • CPU name: ?
  • OS: Windows

Build log:

https://github.com/eitsupi/r-glaredb/actions/runs/9234681710/job/25408657673?pr=18#step:11:1086

  make[1]: Leaving directory '/d/a/r-glaredb/r-glaredb/src/rust/target/x86_64-pc-windows-gnu/debug/build/aws-lc-sys-0c92a44fbc815c4b/out/build'

  --- stderr
  CMake Deprecation Warning at CMakeLists.txt:4 (cmake_minimum_required):
    Compatibility with CMake < 3.5 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.


  CMake Deprecation Warning at aws-lc/CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 3.5 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.


  Copying platform assembly files from C:/Users/runneradmin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.17.0/aws-lc/generated-src/win-x86_64/crypto/ to D:/a/r-glaredb/r-glaredb/src/rust/target/x86_64-pc-windows-gnu/debug/build/aws-lc-sys-0c92a44fbc815c4b/out/build/aws-lc/crypto
  In file included from C:/Users/runneradmin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.17.0/aws-lc/crypto/fipsmodule/bcm.c:116:
  C:/Users/runneradmin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.17.0/aws-lc/crypto/fipsmodule/hmac/hmac.c:111:50: error: ISO C does not allow extra ';' outside of a function [-Werror=pedantic]
    111 | MD_TRAMPOLINES_EXPLICIT(MD5, MD5_CTX, MD5_CBLOCK);
        |                                                  ^
  C:/Users/runneradmin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.17.0/aws-lc/crypto/fipsmodule/hmac/hmac.c:112:51: error: ISO C does not allow extra ';' outside of a function [-Werror=pedantic]
    112 | MD_TRAMPOLINES_EXPLICIT(SHA1, SHA_CTX, SHA_CBLOCK);
        |                                                   ^
  C:/Users/runneradmin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.17.0/aws-lc/crypto/fipsmodule/hmac/hmac.c:113:59: error: ISO C does not allow extra ';' outside of a function [-Werror=pedantic]
    113 | MD_TRAMPOLINES_EXPLICIT(SHA224, SHA256_CTX, SHA256_CBLOCK);
        |                                                           ^
  C:/Users/runneradmin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.17.0/aws-lc/crypto/fipsmodule/hmac/hmac.c:114:59: error: ISO C does not allow extra ';' outside of a function [-Werror=pedantic]
    114 | MD_TRAMPOLINES_EXPLICIT(SHA256, SHA256_CTX, SHA256_CBLOCK);
        |                                                           ^
  C:/Users/runneradmin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.17.0/aws-lc/crypto/fipsmodule/hmac/hmac.c:115:59: error: ISO C does not allow extra ';' outside of a function [-Werror=pedantic]
    115 | MD_TRAMPOLINES_EXPLICIT(SHA384, SHA512_CTX, SHA512_CBLOCK);
        |                                                           ^
  C:/Users/runneradmin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.17.0/aws-lc/crypto/fipsmodule/hmac/hmac.c:116:59: error: ISO C does not allow extra ';' outside of a function [-Werror=pedantic]
    116 | MD_TRAMPOLINES_EXPLICIT(SHA512, SHA512_CTX, SHA512_CBLOCK);
        |                                                           ^
  C:/Users/runneradmin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.17.0/aws-lc/crypto/fipsmodule/hmac/hmac.c:117:63: error: ISO C does not allow extra ';' outside of a function [-Werror=pedantic]
    117 | MD_TRAMPOLINES_EXPLICIT(SHA512_224, SHA512_CTX, SHA512_CBLOCK);
        |                                                               ^
  C:/Users/runneradmin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.17.0/aws-lc/crypto/fipsmodule/hmac/hmac.c:118:63: error: ISO C does not allow extra ';' outside of a function [-Werror=pedantic]
    118 | MD_TRAMPOLINES_EXPLICIT(SHA512_256, SHA512_CTX, SHA512_CBLOCK);
        |                                                               ^
  cc1.exe: all warnings being treated as errors
  make[3]: *** [aws-lc/crypto/fipsmodule/CMakeFiles/fipsmodule.dir/build.make:77: aws-lc/crypto/fipsmodule/CMakeFiles/fipsmodule.dir/bcm.c.obj] Error 1
  make[3]: *** Waiting for unfinished jobs....
  make[2]: *** [CMakeFiles/Makefile2:258: aws-lc/crypto/fipsmodule/CMakeFiles/fipsmodule.dir/all] Error 2
  make[2]: *** Waiting for unfinished jobs....
  D:/a/r-glaredb/r-glaredb/src/rust/target/x86_64-pc-windows-gnu/debug/build/aws-lc-sys-0c92a44fbc815c4b/out/build/aws-lc/crypto/err_data.c:1603:5: error: string length '16178' is greater than the length '4095' ISO C99 compilers are required to support [-Werror=overlength-strings]
   1603 |     "";
        |     ^~
  cc1.exe: all warnings being treated as errors
  make[3]: *** [aws-lc/crypto/CMakeFiles/crypto_objects.dir/build.make:1292: aws-lc/crypto/CMakeFiles/crypto_objects.dir/err_data.c.obj] Error 1
  make[3]: *** Waiting for unfinished jobs....
  make[2]: *** [CMakeFiles/Makefile2:204: aws-lc/crypto/CMakeFiles/crypto_objects.dir/all] Error 2
  make[1]: *** [Makefile:136: all] Error 2
  thread 'main' panicked at C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cmake-0.1.50\src\lib.rs:1098:5:

  command did not execute successfully, got: exit code: 2

  build script failed, must exit now
@justsmth
Copy link
Contributor

The is due to the -pedantic flag being passed via CMAKE_C_FLAGS here, but I'm not sure where that's coming from.

I'll try to get these issues cleaned up upstream in AWS-LC.

@eitsupi
Copy link
Author

eitsupi commented Jun 8, 2024

The is due to the -pedantic flag being passed via CMAKE_C_FLAGS here, but I'm not sure where that's coming from.

Thanks for your reply and the fixes!

I think I have been able to suppress the error and work around it for now, but another problem caused it to fail to compile.

   Copying platform assembly files from C:/Users/runneradmin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.17.0/aws-lc/generated-src/win-x86_64/crypto/ to D:/a/r-glaredb/r-glaredb/src/rust/target/x86_64-pc-windows-gnu/debug/build/aws-lc-sys-50dad33b9ae93e0d/out/build/aws-lc/crypto
  D:/a/r-glaredb/r-glaredb/src/rust/target/x86_64-pc-windows-gnu/debug/build/aws-lc-sys-50dad33b9ae93e0d/out/build/aws-lc/crypto/fipsmodule/aesni-xts-avx512.asm:136: error: undefined symbol `zmm25' (first use)
  D:/a/r-glaredb/r-glaredb/src/rust/target/x86_64-pc-windows-gnu/debug/build/aws-lc-sys-50dad33b9ae93e0d/out/build/aws-lc/crypto/fipsmodule/aesni-xts-avx512.asm:136: error:  (Each undefined symbol is reported only once.)

I know this is off-topic, is it worth submitting a new issue?

@justsmth
Copy link
Contributor

justsmth commented Jun 8, 2024

Do you have a link to the full output? I believe "zmm25" is related to AVX-512 support, which is supported by NASM v2.11 and later: https://www.nasm.us/xdoc/2.11/html/nasmdocc.html

Is it possible that an older version of NASM is being used?

@eitsupi
Copy link
Author

eitsupi commented Jun 9, 2024

Thanks for your response!
The log is here:
https://github.com/eitsupi/r-glaredb/actions/runs/9426573806/job/25969635968?pr=34#step:11:1469

Is it possible that an older version of NASM is being used?

It seems NASM version 2.16.01 compiled on Dec 21 2022 is downloaded.
https://github.com/eitsupi/r-glaredb/actions/runs/9426573806/job/25969635968?pr=34#step:8:23

Is this a cross compile to x86_64-pc-windows-gnu so something is misconfigured?

@justinwsmith
Copy link
Contributor

The issue is that your build is using YASM instead of NASM as the assembler.

...
  -- The ASM_NASM compiler identification is YASM
  -- Found assembler: C:/rtools44/x86_64-w64-mingw32.static.posix/bin/yasm.exe
...

YASM appears to be an abandoned rewrite of NASM that's not had a release since August of 2014 -- around the time NASM 2.11 released. I'm not sure how it's being installed or why it's being found instead of NASM.

@eitsupi
Copy link
Author

eitsupi commented Jun 10, 2024

The issue is that your build is using YASM instead of NASM as the assembler.

...
  -- The ASM_NASM compiler identification is YASM
  -- Found assembler: C:/rtools44/x86_64-w64-mingw32.static.posix/bin/yasm.exe
...

YASM appears to be an abandoned rewrite of NASM that's not had a release since August of 2014 -- around the time NASM 2.11 released. I'm not sure how it's being installed or why it's being found instead of NASM.

Thanks for pointing out that!

YASM seems to have been updated even recently, and the rtools used here (based on msys2) seem to include both NASM and YASM; I don't know why YASM was preferred over NASM.
https://packages.msys2.org/package/yasm
https://svn.r-project.org/R-dev-web/trunk/WindowsBuilds/winutf8/ucrt3/toolchain_libs/mxe/src/

@justsmth
Copy link
Contributor

I posted a PR upstream to help address this issue.

@eitsupi
Copy link
Author

eitsupi commented Jun 10, 2024

Thanks for taking a look at this, I checked rtools44 and found that I was wrong and that yasm is included but nasm is not.
It appears that I probably need to install additional nasm at this point.

image

@justsmth
Copy link
Contributor

Our patches to address this issue have been released in v1.7.3. Let us know if you have any other build issues. Thanks!

@eitsupi
Copy link
Author

eitsupi commented Jun 12, 2024

Thanks for quick updates! I will try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants