From 13d2633126ca890a8711712fc4eeecb69157140b Mon Sep 17 00:00:00 2001 From: Dave Rodgman Date: Wed, 13 Dec 2023 17:23:46 +0000 Subject: [PATCH] Fix MBEDTLS_NO_PLATFORM_ENTROPY for baremetal aarch64 with armclang Signed-off-by: Dave Rodgman --- configs/config-tfm.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/configs/config-tfm.h b/configs/config-tfm.h index 197b80814..8ed0792ed 100644 --- a/configs/config-tfm.h +++ b/configs/config-tfm.h @@ -21,9 +21,6 @@ /* MBEDTLS_PSA_CRYPTO_SPM needs third-party files, so disable it. */ #undef MBEDTLS_PSA_CRYPTO_SPM -/* Use built-in platform entropy functions (TF-M provides its own). */ -#undef MBEDTLS_NO_PLATFORM_ENTROPY - /* Disable buffer-based memory allocator. This isn't strictly required, * but using the native allocator is faster and works better with * memory management analysis frameworks such as ASan. */ @@ -53,10 +50,14 @@ /* * 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. + * (either IAR, Arm compiler or __ARM_EABI__ defined), and adjust some + * variables accordingly. */ -#if defined(__IAR_SYSTEMS_ICC__) || defined(__ARM_EABI__) +#if defined(__IAR_SYSTEMS_ICC__) || defined(__ARMCC_VERSION) || defined(__ARM_EABI__) #define MBEDTLS_NO_PLATFORM_ENTROPY +#else +/* Use built-in platform entropy functions (TF-M provides its own). */ +#undef MBEDTLS_NO_PLATFORM_ENTROPY #endif /***********************************************************************