From 2eab9fd92a2fc052bb71acf4b871d2d88646ae22 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Wed, 5 Feb 2025 20:01:52 +0100 Subject: [PATCH] Enable drivers when testing with GCC 15 The goal of testing with GCC 15 is to validate fixes for https://github.com/Mbed-TLS/mbedtls/issues/9814 . The bug is present in multiple places, and some of them affect third-party drivers but not our built-in implementation. (The bug is that driver contexts might not be zero-initialized, but some of our built-in implementations happen not to care about this.) Thus, enable the test drivers in the test component that uses GCC 15, to gain the extra checks performed in the driver wrappers. Signed-off-by: Gilles Peskine --- tests/scripts/components-compiler.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tests/scripts/components-compiler.sh b/tests/scripts/components-compiler.sh index c8b276c021..919dbce9ba 100644 --- a/tests/scripts/components-compiler.sh +++ b/tests/scripts/components-compiler.sh @@ -79,15 +79,25 @@ support_test_gcc_latest_opt () { # separate component. # For the time being, we don't make $GCC_LATEST be GCC 15 on the CI # platform, because that would break branches where #9814 isn'f fixed yet. -support_test_gcc15_opt () { +support_test_gcc15_drivers_opt () { test -x /usr/local/gcc-15/bin/gcc-15 } -component_test_gcc15_opt () { +component_test_gcc15_drivers_opt () { + msg "build: GCC 15: full + test drivers dispatching to builtins" scripts/config.py full + scripts/config.py unset MBEDTLS_PSA_CRYPTO_CONFIG + loc_cflags="$ASAN_CFLAGS -DPSA_CRYPTO_DRIVER_TEST_ALL" + loc_cflags="${loc_cflags} '-DMBEDTLS_USER_CONFIG_FILE=\"../tests/configs/user-config-for-test.h\"'" + loc_cflags="${loc_cflags} -I../framework/tests/include -O2" # Until https://github.com/Mbed-TLS/mbedtls/issues/9814 is fixed, # disable the new problematic optimization. + loc_cflags="${loc_cflags} -fzero-init-padding-bits=unions" # Also disable a warning that we don't yet comply to. - make CC="/usr/local/gcc-15/bin/gcc-15" CFLAGS="-O2 -Wall -Wextra -Werror -fzero-init-padding-bits=unions -Wno-error=unterminated-string-initialization" + loc_cflags="${loc_cflags} -Wno-error=unterminated-string-initialization" + + make CC=/usr/local/gcc-15/bin/gcc-15 CFLAGS="${loc_cflags}" LDFLAGS="$ASAN_CFLAGS" + + msg "test: GCC 15: full + test drivers dispatching to builtins" make test }