Add error message for old armclang
when armclang<6.10, cpu modifiers MUST be
specified on command line.
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
diff --git a/library/aesce.c b/library/aesce.c
index d939e4a..65c79f7 100644
--- a/library/aesce.c
+++ b/library/aesce.c
@@ -74,8 +74,15 @@
#if !(defined(__ARM_FEATURE_CRYPTO) || defined(__ARM_FEATURE_AES)) || \
defined(MBEDTLS_ENABLE_ARM_CRYPTO_EXTENSIONS_COMPILER_FLAG)
-# if defined(__clang__)
-# pragma clang attribute push (__attribute__((target("crypto,aes"))), apply_to=function)
+# if defined(__ARMCOMPILER_VERSION)
+# if __ARMCOMPILER_VERSION <= 6090000
+# error "Must use minimum -march=armv8-a+crypto for MBEDTLS_AESCE_C"
+# else
+# pragma clang attribute push (__attribute__((target("crypto,aes"))), apply_to=function)
+# define MBEDTLS_POP_TARGET_PRAGMA
+# endif
+# elif defined(__clang__)
+# pragma clang attribute push (__attribute__((target("crypto"))), apply_to=function)
# define MBEDTLS_POP_TARGET_PRAGMA
# elif defined(__GNUC__)
# pragma GCC push_options