From 66cbc838444b583d3128fdccccf4815656c8a88a Mon Sep 17 00:00:00 2001 From: Dave Rodgman Date: Mon, 18 Dec 2023 18:34:50 +0000 Subject: [PATCH 01/13] Use clang by default Signed-off-by: Dave Rodgman --- tests/scripts/all.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index 40a8fe0bf..1b9040b5f 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -189,6 +189,10 @@ pre_initialize_variables () { if [ -z "${MAKEFLAGS+set}" ]; then export MAKEFLAGS="-j$(all_sh_nproc)" fi + # if CC is not set, use clang by default to improve build times + if [ -z "${CC+set}" ]; then + export CC="clang" + fi # Include more verbose output for failing tests run by CMake or make export CTEST_OUTPUT_ON_FAILURE=1 From 0c5bfe816f807d40a1bc12cecf4befadebb2d85b Mon Sep 17 00:00:00 2001 From: Dave Rodgman Date: Mon, 18 Dec 2023 19:53:25 +0000 Subject: [PATCH 02/13] Ensure clang is present Signed-off-by: Dave Rodgman --- tests/scripts/all.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index 1b9040b5f..fe3f59466 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -189,9 +189,9 @@ pre_initialize_variables () { if [ -z "${MAKEFLAGS+set}" ]; then export MAKEFLAGS="-j$(all_sh_nproc)" fi - # if CC is not set, use clang by default to improve build times - if [ -z "${CC+set}" ]; then - export CC="clang" + # if CC is not set, use clang by default (if present) to improve build times + if [ -z "${CC+set}" ] && (type clang > /dev/null 2>&1); then + export CC=$(type -p clang) fi # Include more verbose output for failing tests run by CMake or make From 932ce859d5853c499f92487dc89ffd08708d7243 Mon Sep 17 00:00:00 2001 From: Dave Rodgman Date: Mon, 18 Dec 2023 19:55:40 +0000 Subject: [PATCH 03/13] Ensure test_psa_compliance uses gcc Signed-off-by: Dave Rodgman --- tests/scripts/all.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index fe3f59466..d0c59ffae 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -6030,8 +6030,9 @@ component_test_zeroize () { } component_test_psa_compliance () { + # The arch tests build with gcc, so require use of gcc here to link properly msg "build: make, default config (out-of-box), libmbedcrypto.a only" - make -C library libmbedcrypto.a + CC=gcc make -C library libmbedcrypto.a msg "unit test: test_psa_compliance.py" ./tests/scripts/test_psa_compliance.py From d0a594d4446ac8436249b42ebde20a2aec910b1d Mon Sep 17 00:00:00 2001 From: Dave Rodgman Date: Mon, 18 Dec 2023 22:29:56 +0000 Subject: [PATCH 04/13] Use gcc in test_psa_compliance Signed-off-by: Dave Rodgman --- tests/scripts/all.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index d0c59ffae..67b205679 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -6035,7 +6035,7 @@ component_test_psa_compliance () { CC=gcc make -C library libmbedcrypto.a msg "unit test: test_psa_compliance.py" - ./tests/scripts/test_psa_compliance.py + CC=gcc ./tests/scripts/test_psa_compliance.py } support_test_psa_compliance () { From 590519f5356d0ceaa4e4504c0c65848eb12cdbcc Mon Sep 17 00:00:00 2001 From: Dave Rodgman Date: Tue, 19 Dec 2023 11:33:55 +0000 Subject: [PATCH 05/13] Enable -O2 in depends.py Signed-off-by: Dave Rodgman --- tests/scripts/depends.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/scripts/depends.py b/tests/scripts/depends.py index 38c184a6a..1a8453103 100755 --- a/tests/scripts/depends.py +++ b/tests/scripts/depends.py @@ -381,7 +381,7 @@ class DomainData: def __init__(self, options, conf): """Gather data about the library and establish a list of domains to test.""" - build_command = [options.make_command, 'CFLAGS=-Werror'] + build_command = [options.make_command, 'CFLAGS=-Werror -O2'] build_and_test = [build_command, [options.make_command, 'test']] self.all_config_symbols = set(conf.settings.keys()) # Find hash modules by name. From dfe5ce81ee18e34e3ec5f42296305c301ebd4f14 Mon Sep 17 00:00:00 2001 From: Dave Rodgman Date: Tue, 19 Dec 2023 11:47:18 +0000 Subject: [PATCH 06/13] Use clang -O2 in common_block_cipher_no_decrypt Signed-off-by: Dave Rodgman --- tests/scripts/all.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index 67b205679..b9c45261c 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -4922,7 +4922,7 @@ helper_block_cipher_no_decrypt_build_test () { msg "build: default config + BLOCK_CIPHER_NO_DECRYPT${set_opts:+ + $set_opts}${unset_opts:+ - $unset_opts} with $cflags${ldflags:+, $ldflags}" make clean - make CC=gcc CFLAGS="$cflags" LDFLAGS="$ldflags" + make CFLAGS="-O2 $cflags" LDFLAGS="$ldflags" # Make sure we don't have mbedtls_xxx_setkey_dec in AES/ARIA/CAMELLIA not grep mbedtls_aes_setkey_dec library/aes.o From ea03ef9a77bfd645d79909f7f1c17a4d77d7dd77 Mon Sep 17 00:00:00 2001 From: Dave Rodgman Date: Tue, 19 Dec 2023 12:19:59 +0000 Subject: [PATCH 07/13] Don't specify gcc unless the test requires it Signed-off-by: Dave Rodgman --- tests/scripts/all.sh | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index b9c45261c..242df5288 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -2168,7 +2168,7 @@ component_test_default_no_deprecated () { # configuration leaves something consistent. msg "build: make, default + MBEDTLS_DEPRECATED_REMOVED" # ~ 30s scripts/config.py set MBEDTLS_DEPRECATED_REMOVED - make CC=gcc CFLAGS='-O -Werror -Wall -Wextra' + make CFLAGS='-O -Werror -Wall -Wextra' msg "test: make, default + MBEDTLS_DEPRECATED_REMOVED" # ~ 5s make test @@ -2177,7 +2177,7 @@ component_test_default_no_deprecated () { component_test_full_no_deprecated () { msg "build: make, full_no_deprecated config" # ~ 30s scripts/config.py full_no_deprecated - make CC=gcc CFLAGS='-O -Werror -Wall -Wextra' + make CFLAGS='-O -Werror -Wall -Wextra' msg "test: make, full_no_deprecated config" # ~ 5s make test @@ -2194,7 +2194,7 @@ component_test_full_no_deprecated_deprecated_warning () { scripts/config.py full_no_deprecated scripts/config.py unset MBEDTLS_DEPRECATED_REMOVED scripts/config.py set MBEDTLS_DEPRECATED_WARNING - make CC=gcc CFLAGS='-O -Werror -Wall -Wextra' + make CFLAGS='-O -Werror -Wall -Wextra' msg "test: make, full_no_deprecated config, MBEDTLS_DEPRECATED_WARNING" # ~ 5s make test @@ -2207,14 +2207,14 @@ component_test_full_deprecated_warning () { scripts/config.py full scripts/config.py set MBEDTLS_DEPRECATED_WARNING # Expect warnings from '#warning' directives in check_config.h. - make CC=gcc CFLAGS='-O -Werror -Wall -Wextra -Wno-error=cpp' lib programs + make CFLAGS='-O -Werror -Wall -Wextra -Wno-error=cpp' lib programs msg "build: make tests, full config + MBEDTLS_DEPRECATED_WARNING, expect warnings" # ~ 30s # Set MBEDTLS_TEST_DEPRECATED to enable tests for deprecated features. # By default those are disabled when MBEDTLS_DEPRECATED_WARNING is set. # Expect warnings from '#warning' directives in check_config.h and # from the use of deprecated functions in test suites. - make CC=gcc CFLAGS='-O -Werror -Wall -Wextra -Wno-error=deprecated-declarations -Wno-error=cpp -DMBEDTLS_TEST_DEPRECATED' tests + make CFLAGS='-O -Werror -Wall -Wextra -Wno-error=deprecated-declarations -Wno-error=cpp -DMBEDTLS_TEST_DEPRECATED' tests msg "test: full config + MBEDTLS_TEST_DEPRECATED" # ~ 30s make test @@ -2377,7 +2377,7 @@ component_build_no_pk_rsa_alt_support () { scripts/config.py set MBEDTLS_X509_CRT_WRITE_C # Only compile - this is primarily to test for compile issues - make CC=gcc CFLAGS='-Werror -Wall -Wextra -I../tests/include/alt-dummy' + make CFLAGS='-Werror -Wall -Wextra -I../tests/include/alt-dummy' } component_build_module_alt () { @@ -2410,7 +2410,7 @@ component_build_module_alt () { # We can only compile, not link, since we don't have any implementations # suitable for testing with the dummy alt headers. - make CC=gcc CFLAGS='-Werror -Wall -Wextra -I../tests/include/alt-dummy' lib + make CFLAGS='-Werror -Wall -Wextra -I../tests/include/alt-dummy' lib } component_build_dhm_alt () { @@ -2421,7 +2421,7 @@ component_build_dhm_alt () { scripts/config.py unset MBEDTLS_DEBUG_C # We can only compile, not link, since we don't have any implementations # suitable for testing with the dummy alt headers. - make CC=gcc CFLAGS='-Werror -Wall -Wextra -I../tests/include/alt-dummy' lib + make CFLAGS='-Werror -Wall -Wextra -I../tests/include/alt-dummy' lib } component_test_no_use_psa_crypto_full_cmake_asan() { @@ -3860,7 +3860,7 @@ component_test_ccm_aes_sha256() { cp "$CONFIG_TEST_DRIVER_H" "$CONFIG_H" cp configs/crypto-config-ccm-aes-sha256.h "$CRYPTO_CONFIG_H" - make CC=gcc + make msg "test: CCM + AES + SHA256 configuration" make test @@ -4324,7 +4324,7 @@ component_test_memory_buffer_allocator_backtrace () { scripts/config.py set MBEDTLS_PLATFORM_MEMORY scripts/config.py set MBEDTLS_MEMORY_BACKTRACE scripts/config.py set MBEDTLS_MEMORY_DEBUG - CC=gcc cmake -DCMAKE_BUILD_TYPE:String=Release . + cmake -DCMAKE_BUILD_TYPE:String=Release . make msg "test: MBEDTLS_MEMORY_BUFFER_ALLOC_C and MBEDTLS_MEMORY_BACKTRACE" @@ -4335,7 +4335,7 @@ component_test_memory_buffer_allocator () { msg "build: default config with memory buffer allocator" scripts/config.py set MBEDTLS_MEMORY_BUFFER_ALLOC_C scripts/config.py set MBEDTLS_PLATFORM_MEMORY - CC=gcc cmake -DCMAKE_BUILD_TYPE:String=Release . + cmake -DCMAKE_BUILD_TYPE:String=Release . make msg "test: MBEDTLS_MEMORY_BUFFER_ALLOC_C" @@ -4431,7 +4431,7 @@ component_test_ssl_alloc_buffer_and_mfl () { scripts/config.py set MBEDTLS_MEMORY_DEBUG scripts/config.py set MBEDTLS_SSL_MAX_FRAGMENT_LENGTH scripts/config.py set MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH - CC=gcc cmake -DCMAKE_BUILD_TYPE:String=Release . + cmake -DCMAKE_BUILD_TYPE:String=Release . make msg "test: MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH, MBEDTLS_MEMORY_BUFFER_ALLOC_C, MBEDTLS_MEMORY_DEBUG and MBEDTLS_SSL_MAX_FRAGMENT_LENGTH" @@ -4458,7 +4458,7 @@ component_test_when_no_ciphersuites_have_mac () { component_test_no_date_time () { msg "build: default config without MBEDTLS_HAVE_TIME_DATE" scripts/config.py unset MBEDTLS_HAVE_TIME_DATE - CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Check . + cmake -D CMAKE_BUILD_TYPE:String=Check . make msg "test: !MBEDTLS_HAVE_TIME_DATE - main suites" @@ -4824,7 +4824,7 @@ component_test_aes_only_128_bit_keys () { scripts/config.py set MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH scripts/config.py unset MBEDTLS_PADLOCK_C - make CC=gcc CFLAGS='-Werror -Wall -Wextra' + make CFLAGS='-Werror -Wall -Wextra' msg "test: default config + AES_ONLY_128_BIT_KEY_LENGTH" make test @@ -4849,7 +4849,7 @@ component_test_aes_only_128_bit_keys_have_builtins () { scripts/config.py unset MBEDTLS_AESNI_C scripts/config.py unset MBEDTLS_AESCE_C - make CC=gcc CFLAGS='-Werror -Wall -Wextra' + make CFLAGS='-Werror -Wall -Wextra' msg "test: default config + AES_ONLY_128_BIT_KEY_LENGTH - AESNI_C - AESCE_C" make test @@ -4861,7 +4861,7 @@ component_test_aes_only_128_bit_keys_have_builtins () { component_test_aes_fewer_tables () { msg "build: default config with AES_FEWER_TABLES enabled" scripts/config.py set MBEDTLS_AES_FEWER_TABLES - make CC=gcc CFLAGS='-Werror -Wall -Wextra' + make CFLAGS='-Werror -Wall -Wextra' msg "test: AES_FEWER_TABLES" make test @@ -4870,7 +4870,7 @@ component_test_aes_fewer_tables () { component_test_aes_rom_tables () { msg "build: default config with AES_ROM_TABLES enabled" scripts/config.py set MBEDTLS_AES_ROM_TABLES - make CC=gcc CFLAGS='-Werror -Wall -Wextra' + make CFLAGS='-Werror -Wall -Wextra' msg "test: AES_ROM_TABLES" make test @@ -4880,7 +4880,7 @@ component_test_aes_fewer_tables_and_rom_tables () { msg "build: default config with AES_ROM_TABLES and AES_FEWER_TABLES enabled" scripts/config.py set MBEDTLS_AES_FEWER_TABLES scripts/config.py set MBEDTLS_AES_ROM_TABLES - make CC=gcc CFLAGS='-Werror -Wall -Wextra' + make CFLAGS='-Werror -Wall -Wextra' msg "test: AES_FEWER_TABLES + AES_ROM_TABLES" make test @@ -5997,7 +5997,7 @@ component_build_zeroize_checks () { scripts/config.py full # Only compile - we're looking for sizeof-pointer-memaccess warnings - make CC=gcc CFLAGS="'-DMBEDTLS_USER_CONFIG_FILE=\"../tests/configs/user-config-zeroize-memset.h\"' -DMBEDTLS_TEST_DEFINES_ZEROIZE -Werror -Wsizeof-pointer-memaccess" + make CFLAGS="'-DMBEDTLS_USER_CONFIG_FILE=\"../tests/configs/user-config-zeroize-memset.h\"' -DMBEDTLS_TEST_DEFINES_ZEROIZE -Werror -Wsizeof-pointer-memaccess" } From d8d6451a6e372a29b3d7900fe5668efbe9e3c2de Mon Sep 17 00:00:00 2001 From: Dave Rodgman Date: Tue, 19 Dec 2023 12:20:21 +0000 Subject: [PATCH 08/13] Add -O2 to some CFLAGS which were not setting it Signed-off-by: Dave Rodgman --- tests/scripts/all.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index 242df5288..f6a0f1033 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -4824,7 +4824,7 @@ component_test_aes_only_128_bit_keys () { scripts/config.py set MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH scripts/config.py unset MBEDTLS_PADLOCK_C - make CFLAGS='-Werror -Wall -Wextra' + make CFLAGS='-O2 -Werror -Wall -Wextra' msg "test: default config + AES_ONLY_128_BIT_KEY_LENGTH" make test @@ -4849,7 +4849,7 @@ component_test_aes_only_128_bit_keys_have_builtins () { scripts/config.py unset MBEDTLS_AESNI_C scripts/config.py unset MBEDTLS_AESCE_C - make CFLAGS='-Werror -Wall -Wextra' + make CFLAGS='-O2 -Werror -Wall -Wextra' msg "test: default config + AES_ONLY_128_BIT_KEY_LENGTH - AESNI_C - AESCE_C" make test @@ -4861,7 +4861,7 @@ component_test_aes_only_128_bit_keys_have_builtins () { component_test_aes_fewer_tables () { msg "build: default config with AES_FEWER_TABLES enabled" scripts/config.py set MBEDTLS_AES_FEWER_TABLES - make CFLAGS='-Werror -Wall -Wextra' + make CFLAGS='-O2 -Werror -Wall -Wextra' msg "test: AES_FEWER_TABLES" make test @@ -4870,7 +4870,7 @@ component_test_aes_fewer_tables () { component_test_aes_rom_tables () { msg "build: default config with AES_ROM_TABLES enabled" scripts/config.py set MBEDTLS_AES_ROM_TABLES - make CFLAGS='-Werror -Wall -Wextra' + make CFLAGS='-O2 -Werror -Wall -Wextra' msg "test: AES_ROM_TABLES" make test @@ -4880,7 +4880,7 @@ component_test_aes_fewer_tables_and_rom_tables () { msg "build: default config with AES_ROM_TABLES and AES_FEWER_TABLES enabled" scripts/config.py set MBEDTLS_AES_FEWER_TABLES scripts/config.py set MBEDTLS_AES_ROM_TABLES - make CFLAGS='-Werror -Wall -Wextra' + make CFLAGS='-O2 -Werror -Wall -Wextra' msg "test: AES_FEWER_TABLES + AES_ROM_TABLES" make test @@ -5295,7 +5295,7 @@ support_test_m32_everest () { component_test_mx32 () { msg "build: 64-bit ILP32, make, gcc" # ~ 30s scripts/config.py full - make CC=gcc CFLAGS='-Werror -Wall -Wextra -mx32' LDFLAGS='-mx32' + make CC=gcc CFLAGS='-O2 -Werror -Wall -Wextra -mx32' LDFLAGS='-mx32' msg "test: 64-bit ILP32, make, gcc" make test @@ -5323,7 +5323,7 @@ component_test_have_int32 () { scripts/config.py unset MBEDTLS_AESNI_C scripts/config.py unset MBEDTLS_PADLOCK_C scripts/config.py unset MBEDTLS_AESCE_C - make CC=gcc CFLAGS='-Werror -Wall -Wextra -DMBEDTLS_HAVE_INT32' + make CC=gcc CFLAGS='-O2 -Werror -Wall -Wextra -DMBEDTLS_HAVE_INT32' msg "test: gcc, force 32-bit bignum limbs" make test @@ -5335,7 +5335,7 @@ component_test_have_int64 () { scripts/config.py unset MBEDTLS_AESNI_C scripts/config.py unset MBEDTLS_PADLOCK_C scripts/config.py unset MBEDTLS_AESCE_C - make CC=gcc CFLAGS='-Werror -Wall -Wextra -DMBEDTLS_HAVE_INT64' + make CC=gcc CFLAGS='-O2 -Werror -Wall -Wextra -DMBEDTLS_HAVE_INT64' msg "test: gcc, force 64-bit bignum limbs" make test From d47186d6e3b9ce9d774d032d9a2db125a335525e Mon Sep 17 00:00:00 2001 From: Dave Rodgman Date: Tue, 19 Dec 2023 13:11:08 +0000 Subject: [PATCH 09/13] Disable automatic setting of clang target flags on old clang Old versions of clang don't support this pragma, so we have to assume that the user will have set the flags. Signed-off-by: Dave Rodgman --- library/aesni.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/aesni.c b/library/aesni.c index 9da9f1b9a..8e5bd55ab 100644 --- a/library/aesni.c +++ b/library/aesni.c @@ -36,7 +36,7 @@ #pragma GCC push_options #pragma GCC target ("pclmul,sse2,aes") #define MBEDTLS_POP_TARGET_PRAGMA -#elif defined(__clang__) +#elif defined(__clang__) && (__clang_major__ >= 5) #pragma clang attribute push (__attribute__((target("pclmul,sse2,aes"))), apply_to=function) #define MBEDTLS_POP_TARGET_PRAGMA #endif From bc8e61d962b5a8cca65d6c29359ac4fadd8d07c1 Mon Sep 17 00:00:00 2001 From: Dave Rodgman Date: Tue, 19 Dec 2023 14:07:15 +0000 Subject: [PATCH 10/13] Use gcc in test_full_deprecated_warning Signed-off-by: Dave Rodgman --- tests/scripts/all.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index f6a0f1033..5fbb7a355 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -2207,14 +2207,16 @@ component_test_full_deprecated_warning () { scripts/config.py full scripts/config.py set MBEDTLS_DEPRECATED_WARNING # Expect warnings from '#warning' directives in check_config.h. - make CFLAGS='-O -Werror -Wall -Wextra -Wno-error=cpp' lib programs + # Note that gcc is required to allow the use of -Wno-error=cpp, which allows us to + # display #warning messages without them being treated as errors. + make CC=gcc CFLAGS='-O -Werror -Wall -Wextra -Wno-error=cpp' lib programs msg "build: make tests, full config + MBEDTLS_DEPRECATED_WARNING, expect warnings" # ~ 30s # Set MBEDTLS_TEST_DEPRECATED to enable tests for deprecated features. # By default those are disabled when MBEDTLS_DEPRECATED_WARNING is set. # Expect warnings from '#warning' directives in check_config.h and # from the use of deprecated functions in test suites. - make CFLAGS='-O -Werror -Wall -Wextra -Wno-error=deprecated-declarations -Wno-error=cpp -DMBEDTLS_TEST_DEPRECATED' tests + make CC=gcc CFLAGS='-O -Werror -Wall -Wextra -Wno-error=deprecated-declarations -Wno-error=cpp -DMBEDTLS_TEST_DEPRECATED' tests msg "test: full config + MBEDTLS_TEST_DEPRECATED" # ~ 30s make test From fc5b9553b2f8c7445d2467237024b4fe91ee5d1b Mon Sep 17 00:00:00 2001 From: Dave Rodgman Date: Tue, 19 Dec 2023 16:08:19 +0000 Subject: [PATCH 11/13] Don't use full path for setting CC Signed-off-by: Dave Rodgman --- tests/scripts/all.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index 5fbb7a355..6ce8e93c0 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -191,7 +191,7 @@ pre_initialize_variables () { fi # if CC is not set, use clang by default (if present) to improve build times if [ -z "${CC+set}" ] && (type clang > /dev/null 2>&1); then - export CC=$(type -p clang) + export CC="clang" fi # Include more verbose output for failing tests run by CMake or make From c393222643a7dd7b9c138a5d2e61b8a133ad6b8e Mon Sep 17 00:00:00 2001 From: Dave Rodgman Date: Tue, 19 Dec 2023 17:51:51 +0000 Subject: [PATCH 12/13] Work around clang 3.8 bug Signed-off-by: Dave Rodgman --- tests/scripts/all.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index 6ce8e93c0..06ef19cc6 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -4994,11 +4994,15 @@ config_block_cipher_no_decrypt () { } component_test_block_cipher_no_decrypt_aesni () { + # This consistently causes an llvm crash on clang 3.8, so use gcc + export CC=gcc config_block_cipher_no_decrypt 0 common_block_cipher_no_decrypt } component_test_block_cipher_no_decrypt_aesni_use_psa () { + # This consistently causes an llvm crash on clang 3.8, so use gcc + export CC=gcc config_block_cipher_no_decrypt 1 common_block_cipher_no_decrypt } From 5c7e94487eec04bb16d4ac6533d7bc5029cf2d03 Mon Sep 17 00:00:00 2001 From: Dave Rodgman Date: Thu, 21 Dec 2023 15:42:22 +0000 Subject: [PATCH 13/13] fix line length Signed-off-by: Dave Rodgman --- tests/scripts/depends.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/scripts/depends.py b/tests/scripts/depends.py index a7d5672be..25a15c475 100755 --- a/tests/scripts/depends.py +++ b/tests/scripts/depends.py @@ -381,7 +381,8 @@ class DomainData: def __init__(self, options, conf): """Gather data about the library and establish a list of domains to test.""" - build_command = [options.make_command] + options.make_vars.split(' ') + ['CFLAGS=-Werror -O2'] + build_command = [options.make_command] + options.make_vars.split(' ') + \ + ['CFLAGS=-Werror -O2'] build_and_test = [build_command, [options.make_command, 'test']] self.all_config_symbols = set(conf.settings.keys()) # Find hash modules by name.