From 51e72456f9dd7bfc3a4eee53de046f4390a3d83b Mon Sep 17 00:00:00 2001 From: Dave Rodgman Date: Wed, 29 Nov 2023 09:44:44 +0000 Subject: [PATCH] Automatically set MBEDTLS_NO_PLATFORM_ENTROPY in TF-M config Signed-off-by: Dave Rodgman --- configs/config-tfm.h | 9 +++++++++ tests/scripts/all.sh | 3 --- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/configs/config-tfm.h b/configs/config-tfm.h index 1925cdcb2..85b677b4c 100644 --- a/configs/config-tfm.h +++ b/configs/config-tfm.h @@ -45,6 +45,15 @@ #undef MBEDTLS_PLATFORM_STD_EXIT_SUCCESS #undef MBEDTLS_PLATFORM_STD_EXIT_FAILURE +/* + * In order to get an example config that works cleanly out-of-the-box + * for both baremetal and non-baremetal builds, we detect baremetal builds + * and set this variable automatically. + */ +#if defined(__IAR_SYSTEMS_ICC__) || defined(__ARM_EABI__) +#define MBEDTLS_NO_PLATFORM_ENTROPY +#endif + /*********************************************************************** * Local changes to crypto config below this delimiter **********************************************************************/ diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index 177736a51..036bdceac 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -4125,9 +4125,6 @@ component_build_tfm_armcc() { # test the TF-M configuration can build cleanly with various warning flags enabled cp configs/config-tfm.h "$CONFIG_H" - # MBEDTLS_NO_PLATFORM_ENTROPY is needed as we are building for baremetal - ./scripts/config.py --force set MBEDTLS_NO_PLATFORM_ENTROPY - msg "build: TF-M config, armclang armv7-m thumb2" armc6_build_test "--target=arm-arm-none-eabi -march=armv7-m -mthumb -Os -std=c99 -Werror -Wall -Wextra -Wwrite-strings -Wpointer-arith -Wimplicit-fallthrough -Wshadow -Wvla -Wformat=2 -Wno-format-nonliteral -Wshadow -Wasm-operand-widths -Wunused -I../tests/include/spe" }