From 66f09834ea5ee7ec883f72a0a15d8dfbb131334e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Mon, 28 Nov 2022 13:12:10 +0100 Subject: [PATCH 1/3] Enable optimisation with Asan with make in all.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All builds using ASAN_CFLAGS were with Asan but no optimisation, making them particularly slow. Indeed, we were overwriting CFLAGS which defaults to -O2 and not using any -O in the replacement. (CMake already has optimisations on with ASan.) While at it, also remove -Wall -Wextra which are redundant as they are already part of WARNING_CFLAGS which we are not overwriting. Signed-off-by: Manuel Pégourié-Gonnard --- 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 b43f999d80..f72fe52825 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -185,7 +185,7 @@ pre_initialize_variables () { export CTEST_OUTPUT_ON_FAILURE=1 # CFLAGS and LDFLAGS for Asan builds that don't use CMake - ASAN_CFLAGS='-Werror -Wall -Wextra -fsanitize=address,undefined -fno-sanitize-recover=all' + ASAN_CFLAGS='-O2 -Werror -fsanitize=address,undefined -fno-sanitize-recover=all' # Gather the list of available components. These are the functions # defined in this script whose name starts with "component_". From 30d9466762df04b00b78cdaab96d1881b02600b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Tue, 29 Nov 2022 12:37:53 +0100 Subject: [PATCH 2/3] Only run what we need from compat.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also, comment why we run those tests. Signed-off-by: Manuel Pégourié-Gonnard --- tests/scripts/all.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index f72fe52825..978cb71e5d 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -2162,11 +2162,16 @@ component_test_psa_crypto_config_accel_hash_use_psa () { msg "test: MBEDTLS_PSA_CRYPTO_CONFIG with accelerated hash and USE_PSA" make test + # This is mostly useful so that we can later compare outcome files with + # the reference config in analyze_outcomes.py, to check that the + # dependency declarations in ssl-opt.sh and in TLS code are correct. msg "test: ssl-opt.sh, MBEDTLS_PSA_CRYPTO_CONFIG with accelerated hash and USE_PSA" tests/ssl-opt.sh - msg "test: compat.sh, MBEDTLS_PSA_CRYPTO_CONFIG without accelerated hash and USE_PSA" - tests/compat.sh + # This is to make sure all ciphersuites are exercised, but we don't need + # interop testing (besides, we already got some from ssl-opt.sh). + msg "test: compat.sh, MBEDTLS_PSA_CRYPTO_CONFIG with accelerated hash and USE_PSA" + tests/compat.sh -p mbedTLS -V YES } # This component provides reference configuration for test_psa_crypto_config_accel_hash_use_psa From fe549a76e4870866bfc0b9761d48e6ac774b41cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Wed, 30 Nov 2022 10:42:03 +0100 Subject: [PATCH 3/3] Add comment about use of ASAN_CFLAGS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Manuel Pégourié-Gonnard --- tests/scripts/all.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index 978cb71e5d..11827e99d1 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -185,6 +185,7 @@ pre_initialize_variables () { export CTEST_OUTPUT_ON_FAILURE=1 # CFLAGS and LDFLAGS for Asan builds that don't use CMake + # default to -O2, use -Ox _after_ this if you want another level ASAN_CFLAGS='-O2 -Werror -fsanitize=address,undefined -fno-sanitize-recover=all' # Gather the list of available components. These are the functions