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

Build failure with gcc-15 #623

Closed
heitbaum opened this issue Dec 8, 2024 · 2 comments
Closed

Build failure with gcc-15 #623

heitbaum opened this issue Dec 8, 2024 · 2 comments

Comments

@heitbaum
Copy link

heitbaum commented Dec 8, 2024

Problem:

A short description of the problem you are facing. Please include any build output, reproduction steps and environment(e.g. Docker image).

build error of error: initializer-string for array of 'unsigned char' is too long [-Werror=unterminated-string-initialization with gcc-15

Relevant details

AWS-LC for Rust versions or commit: (6b1bce0...) 0.22.0

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

  • CPU architecture: (x86, x86-64, ARMv7...) x86-64
  • CPU name: (Xeon Platinum 8000, AMD EPYC 7000...) 1260P
  • OS: (Ubuntu 20.04, Windows Server 2019...) Linux

Build log:

  • The log tells compiler and version.

  [ 11%] Building C object aws-lc/crypto/fipsmodule/CMakeFiles/fipsmodule.dir/bcm.c.o

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

    Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
    to tell CMake that the project requires at least <min> but has been updated
    to work with policies introduced by <max> or earlier.


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

    Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
    to tell CMake that the project requires at least <min> but has been updated
    to work with policies introduced by <max> or earlier.


  Copying platform assembly files from /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/build/rust-1.82.0/cargo_home/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.22.0/aws-lc/generated-src/linux-x86_64/crypto/ to /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/build/librespot-0.6.0/.x86_64-libreelec-linux-gnu/target/x86_64-libreelec-linux-gnu/release/build/aws-lc-sys-ff15921a63a6560c/out/build/aws-lc/crypto
  In file included from /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/build/rust-1.82.0/cargo_home/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.22.0/aws-lc/crypto/fipsmodule/bcm.c:148:
  /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/build/rust-1.82.0/cargo_home/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.22.0/aws-lc/crypto/fipsmodule/self_check/self_check.c: In function 'boringssl_self_test_fast':
  /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/build/rust-1.82.0/cargo_home/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.22.0/aws-lc/crypto/fipsmodule/self_check/self_check.c:1709:38: error: initializer-string for array of 'unsigned char' is too long [-Werror=unterminated-string-initialization]
   1709 |   static const uint8_t kAESKey[16] = "BoringCrypto Key";
        |                                      ^~~~~~~~~~~~~~~~~~
  /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/build/rust-1.82.0/cargo_home/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.22.0/aws-lc/crypto/fipsmodule/self_check/self_check.c:1859:51: error: initializer-string for array of 'unsigned char' is too long [-Werror=unterminated-string-initialization]
   1859 |   static const uint8_t kDRBGPersonalization[18] = "BCMPersonalization";
        |                                                   ^~~~~~~~~~~~~~~~~~~~
  /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/build/rust-1.82.0/cargo_home/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.22.0/aws-lc/crypto/fipsmodule/self_check/self_check.c:1860:38: error: initializer-string for array of 'unsigned char' is too long [-Werror=unterminated-string-initialization]
   1860 |   static const uint8_t kDRBGAD[16] = "BCM DRBG KAT AD ";
        |                                      ^~~~~~~~~~~~~~~~~~
  At top level:
  cc1: note: unrecognized command-line option '-Wno-c11-extensions' may have been intended to silence earlier diagnostics
  cc1: all warnings being treated as errors
  gmake[2]: *** [aws-lc/crypto/fipsmodule/CMakeFiles/fipsmodule.dir/build.make:264: aws-lc/crypto/fipsmodule/CMakeFiles/fipsmodule.dir/bcm.c.o] Error 1
  gmake[1]: *** [CMakeFiles/Makefile2:301: aws-lc/crypto/fipsmodule/CMakeFiles/fipsmodule.dir/all] Error 2
  gmake: *** [Makefile:136: all] Error 2
  thread 'main' panicked at /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/build/rust-1.82.0/cargo_home/registry/src/index.crates.io-6f17d22bba15001f/cmake-0.1.51/src/lib.rs:1100:5:

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

  build script failed, must exit now

# Sample of build log
+ cargo build
...
@justsmth justsmth added the build problem Build failure label Dec 9, 2024
justsmth added a commit to aws/aws-lc that referenced this issue Dec 9, 2024
### Issues:
Addresses aws/aws-lc-rs#623

### Description of changes: 
* The size for arrays initialized with string literals should include
the null-terminator. The arrays should instead be initialized like
arrays are chars.

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license and the ISC license.
@justsmth
Copy link
Contributor

Hello! We just released aws-lc-rs v1.12.0. 🎉 We believe our latest release resolves the issue reported here. This issue will now be closed.

If you continue to see this or other problems after upgrading, feel free to re-open this issue or open a new one. Thanks for your help in improving our library!

@heitbaum
Copy link
Author

heitbaum commented Dec 17, 2024

Tested updating aws-lc-rs to 1.12.0, and aws-lc-sys to 0.24.0 and the build is now successful.

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

No branches or pull requests

2 participants