Automatically set MBEDTLS_NO_PLATFORM_ENTROPY in TF-M config
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
diff --git a/configs/config-tfm.h b/configs/config-tfm.h
index 1925cdc..85b677b 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 177736a..036bdce 100755
--- a/tests/scripts/all.sh
+++ b/tests/scripts/all.sh
@@ -4125,9 +4125,6 @@
# 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"
}