You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
174: Pin aarch64-linux-musl-cross compiler r=jethrogb a=raoulstrackx
Compiling for aarch64-unknown-linux-musl target failed with:
```
/home/travis/build/fortanix/rust-mbedtls/mbedtls-sys/vendor/library/ssl_tls.c: In function ‘ssl_calc_finished_tls_sha384’:
/home/travis/build/fortanix/rust-mbedtls/mbedtls-sys/vendor/library/ssl_tls.c:3334:5: error: ‘mbedtls_sha512_finish_ret’ accessing 64 bytes in a region of size 48 [-Werror=stringop-overflow=]
3334 | finish( &sha512, padbuf );
| ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/travis/build/fortanix/rust-mbedtls/mbedtls-sys/vendor/library/ssl_tls.c:3334:5: note: referencing argument 2 of type ‘unsigned char *’
In file included from /home/travis/build/fortanix/rust-mbedtls/mbedtls-sys/vendor/include/mbedtls/ssl_internal.h:51,
from /home/travis/build/fortanix/rust-mbedtls/mbedtls-sys/vendor/library/ssl_tls.c:41:
/home/travis/build/fortanix/rust-mbedtls/mbedtls-sys/vendor/include/mbedtls/sha512.h:144:5: note: in a call to function ‘mbedtls_sha512_finish_ret’
144 | int mbedtls_sha512_finish_ret( mbedtls_sha512_context *ctx,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[3]: *** [library/CMakeFiles/mbedtls.dir/build.make:183: library/CMakeFiles/mbedtls.dir/ssl_tls.c.o] Error 1
make[2]: *** [CMakeFiles/Makefile2:227: library/CMakeFiles/mbedtls.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:263: library/CMakeFiles/lib.dir/rule] Error 2
make: *** [Makefile:219: lib] Error 2
```
This is caused by:
```
typedef int (*finish_sha384_t)(mbedtls_sha512_context*, unsigned char*);
...
/*
* For SHA-384, we can save 16 bytes by keeping padbuf 48 bytes long.
* However, to avoid stringop-overflow warning in gcc, we have to cast
* mbedtls_sha512_finish_ret().
*/
finish_sha384_t finish = (finish_sha384_t)mbedtls_sha512_finish_ret;
finish( &sha512, padbuf );
```
This work around no longer works for newer versions of the `aarch64-linux-musl-gcc` compiler. The compiler is pinned to an older version where this workaround still works
Co-authored-by: Raoul Strackx <[email protected]>
0 commit comments