From cbf530dde7549093ba90496e44fcfac52ea20d09 Mon Sep 17 00:00:00 2001 From: David Horstmann Date: Tue, 12 Nov 2024 14:18:37 +0000 Subject: [PATCH] Disable test hooks when checking missing symbols The function mbedtls_test_hook_error_add() is declared in the library but supplied by test helpers in framework/tests/src, so it is undefined in library-only builds. This messes up our checks for missing symbols, so disable MBEDTLS_TEST_HOOKS when we are building to check missing symbols. Signed-off-by: David Horstmann --- tests/scripts/components-configuration-crypto.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/scripts/components-configuration-crypto.sh b/tests/scripts/components-configuration-crypto.sh index 9143665e87..e3096f3d65 100644 --- a/tests/scripts/components-configuration-crypto.sh +++ b/tests/scripts/components-configuration-crypto.sh @@ -160,6 +160,9 @@ component_test_default_psa_crypto_client_without_crypto_provider () { scripts/config.py unset MBEDTLS_SSL_PROTO_TLS1_3 scripts/config.py set MBEDTLS_PSA_CRYPTO_CLIENT scripts/config.py unset MBEDTLS_LMS_C + # Test hooks may rely on functions defined in test helpers, which would + # not be built here, leading to a spurious undefined symbol. + scripts/config.py unset MBEDTLS_TEST_HOOKS make @@ -181,6 +184,9 @@ component_build_full_psa_crypto_client_without_crypto_provider () { # Dynamic secure element support is a deprecated feature and it is not # available when CRYPTO_C and PSA_CRYPTO_STORAGE_C are disabled. scripts/config.py unset MBEDTLS_PSA_CRYPTO_SE_C + # Test hooks may rely on functions defined in test helpers, which would + # not be built here, leading to a spurious undefined symbol. + scripts/config.py unset MBEDTLS_TEST_HOOKS # Since there is no crypto provider in this build it is not possible to # build all the test executables and progrems due to missing PSA functions