awslabs / aws-crt-php

Apache License 2.0
322 stars 13 forks source link

Broken build #35

Closed remicollet closed 2 years ago

remicollet commented 3 years ago

On Fedora 34, using GCC 11 and openssl 1.1.1k:

[  9%] Building C object crt/aws-lc/crypto/fipsmodule/CMakeFiles/fipsmodule.dir/bcm.c.o
In file included from /builddir/build/BUILD/php-pecl-awscrt-1.0.0/NTS/crt/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/bcm.c:104:
/builddir/build/BUILD/php-pecl-awscrt-1.0.0/NTS/crt/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/sha/sha256.c: In function 'SHA224_Final':
/builddir/build/BUILD/php-pecl-awscrt-1.0.0/NTS/crt/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/sha/sha256.c:122:10: error: 'SHA256_Final' accessing 32 bytes in a region of size 28 [-Werror=stringop-overflow=]
  122 |   return SHA256_Final(out, ctx);
      |          ^~~~~~~~~~~~~~~~~~~~~~
/builddir/build/BUILD/php-pecl-awscrt-1.0.0/NTS/crt/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/sha/sha256.c:122:10: note: referencing argument 1 of type 'uint8_t *'
/builddir/build/BUILD/php-pecl-awscrt-1.0.0/NTS/crt/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/sha/sha256.c:171:20: note: in a call to function 'SHA256_Final'
  171 | #define HASH_FINAL SHA256_Final
      |                    ^~~~~~~~~~~~
In function 'SHA224_Final',
    inlined from 'SHA224' at /builddir/build/BUILD/php-pecl-awscrt-1.0.0/NTS/crt/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/sha/sha256.c:100:3:
/builddir/build/BUILD/php-pecl-awscrt-1.0.0/NTS/crt/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/sha/sha256.c:122:10: error: 'SHA256_Final' accessing 32 bytes in a region of size 28 [-Werror=stringop-overflow=]
  122 |   return SHA256_Final(out, ctx);
      |          ^~~~~~~~~~~~~~~~~~~~~~
/builddir/build/BUILD/php-pecl-awscrt-1.0.0/NTS/crt/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/sha/sha256.c: In function 'SHA224':
/builddir/build/BUILD/php-pecl-awscrt-1.0.0/NTS/crt/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/sha/sha256.c:122:10: note: referencing argument 1 of type 'uint8_t *'
/builddir/build/BUILD/php-pecl-awscrt-1.0.0/NTS/crt/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/sha/sha256.c:171:20: note: in a call to function 'SHA256_Final'
  171 | #define HASH_FINAL SHA256_Final
      |                    ^~~~~~~~~~~~
remicollet commented 3 years ago

Trivial fix in sha256.c

# pragma GCC diagnostic ignored "-Wstringop-overflow"

remicollet commented 3 years ago

Removing -Werror from various CMakeList.txt allow to build, but with lot of warnings

See attache output from the build

build.txt

remicollet commented 2 years ago

OK with 1.0.7