Skip to content

Commit

Permalink
Use -Os for NO_UDBL_DIVISION and NO_64BIT_MULTIPLICATION
Browse files Browse the repository at this point in the history
Build with -Os when testing that the options MBEDTLS_NO_UDBL_DIVISION
and MBEDTLS_NO_64BIT_MULTIPLICATION cause the forbidden auxiliary
function not to be used. -Os is more likely to cause the function not
to be inlined, and it's also the option that's most likely to be used
on these targets.

In the arm build with the default configuration, keep -O0 for variety.
Pass it explicitly for clarity.
  • Loading branch information
gilles-peskine-arm committed Aug 8, 2019
1 parent e07b9ff commit 8784bc5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/scripts/all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1075,9 +1075,9 @@ component_test_no_64bit_multiplication () {
}

component_build_arm_none_eabi_gcc () {
msg "build: arm-none-eabi-gcc, make" # ~ 10s
msg "build: arm-none-eabi-gcc -O0, make" # ~ 10s
scripts/config.pl baremetal
make CC=arm-none-eabi-gcc AR=arm-none-eabi-ar LD=arm-none-eabi-ld CFLAGS='-Werror -Wall -Wextra' lib
make CC=arm-none-eabi-gcc AR=arm-none-eabi-ar LD=arm-none-eabi-ld CFLAGS='-Werror -Wall -Wextra -O0' lib
}

component_build_arm_none_eabi_gcc_armel () {
Expand All @@ -1090,7 +1090,7 @@ component_build_arm_none_eabi_gcc_no_udbl_division () {
msg "build: arm-none-eabi-gcc -DMBEDTLS_NO_UDBL_DIVISION, make" # ~ 10s
scripts/config.pl baremetal
scripts/config.pl set MBEDTLS_NO_UDBL_DIVISION
make CC=arm-none-eabi-gcc AR=arm-none-eabi-ar LD=arm-none-eabi-ld CFLAGS='-Werror -Wall -Wextra' lib
make CC=arm-none-eabi-gcc AR=arm-none-eabi-ar LD=arm-none-eabi-ld CFLAGS='-Werror -Wall -Wextra -Os' lib
echo "Checking that software 64-bit division is not required"
if_build_succeeded not grep __aeabi_uldiv library/*.o
}
Expand All @@ -1099,7 +1099,7 @@ component_build_arm_none_eabi_gcc_no_64bit_multiplication () {
msg "build: arm-none-eabi-gcc MBEDTLS_NO_64BIT_MULTIPLICATION, make" # ~ 10s
scripts/config.pl baremetal
scripts/config.pl set MBEDTLS_NO_64BIT_MULTIPLICATION
make CC=arm-none-eabi-gcc AR=arm-none-eabi-ar LD=arm-none-eabi-ld CFLAGS='-Werror -O1 -march=armv6-m -mthumb' lib
make CC=arm-none-eabi-gcc AR=arm-none-eabi-ar LD=arm-none-eabi-ld CFLAGS='-Werror -Os -march=armv6-m -mthumb' lib
echo "Checking that software 64-bit multiplication is not required"
if_build_succeeded not grep __aeabi_lmul library/*.o
}
Expand Down

0 comments on commit 8784bc5

Please sign in to comment.