From f0762e929eccf33b01e42c04d70f3fc5842dba0b Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Fri, 15 Jul 2022 12:08:19 +0100 Subject: [PATCH] Enable inline assembly in armcc all.sh component The test script all.sh contains the component component_build_armcc testing that Mbed TLS builds using Arm Compiler 5 and 6, on a variety of platforms. However, the component does not exercise inline assembly for Arm, since - MBEDTLS_HAVE_ASM is unset, and - Some Arm inline assembly is only used if the level of optimization is not 0. This commit changes the test component to ensure that inline assembly is built by setting MBEDTLS_HAVE_ASM as well as enabling optimization level 1 (-O1). Signed-off-by: Hanno Becker --- tests/scripts/all.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index 458fe8f5b..4fa15a8c3 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -2870,6 +2870,7 @@ component_build_armcc () { scripts/config.py baremetal # armc[56] don't support SHA-512 intrinsics scripts/config.py unset MBEDTLS_SHA512_USE_A64_CRYPTO_IF_PRESENT + scripts/config.py set MBEDTLS_HAVE_ASM make CC="$ARMC5_CC" AR="$ARMC5_AR" WARNING_CFLAGS='--strict --c99' lib @@ -2878,20 +2879,22 @@ component_build_armcc () { make clean + # Compile with -O1 since some Arm inline assembly is disabled for -O0. + # ARM Compiler 6 - Target ARMv7-A - armc6_build_test "--target=arm-arm-none-eabi -march=armv7-a" + armc6_build_test "--target=arm-arm-none-eabi -O1 -march=armv7-a" # ARM Compiler 6 - Target ARMv7-M - armc6_build_test "--target=arm-arm-none-eabi -march=armv7-m" + armc6_build_test "--target=arm-arm-none-eabi -O1 -march=armv7-m+dsp" # ARM Compiler 6 - Target ARMv8-A - AArch32 - armc6_build_test "--target=arm-arm-none-eabi -march=armv8.2-a" + armc6_build_test "--target=arm-arm-none-eabi -O1 -march=armv8.2-a" # ARM Compiler 6 - Target ARMv8-M - armc6_build_test "--target=arm-arm-none-eabi -march=armv8-m.main" + armc6_build_test "--target=arm-arm-none-eabi -O1 -march=armv8-m.main" # ARM Compiler 6 - Target ARMv8.2-A - AArch64 - armc6_build_test "--target=aarch64-arm-none-eabi -march=armv8.2-a+crypto" + armc6_build_test "--target=aarch64-arm-none-eabi -O1 -march=armv8.2-a+crypto" } component_test_tls13_only () {