From ff0aee0e7b542f325f1d25df8df91cfae501fd7e Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Tue, 5 Oct 2021 09:36:03 +0200 Subject: [PATCH] Build with -O2 when running ssl-opt SSL testing benefits from faster executables, so use -O2 rather than -O1. Some builds use -O1, but that's intended for jobs that only run unit tests, where the build takes longer than the tests. Signed-off-by: Gilles Peskine --- tests/scripts/all.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index 812b6b1c64..567fa936c4 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -2275,7 +2275,7 @@ component_build_mbedtls_config_file () { } component_test_m32_o0 () { - # Build once with -O0, to compile out the i386 specific inline assembly + # Build without optimization, to not use the i386 specific inline assembly. msg "build: i386, make, gcc -O0 (ASan build)" # ~ 30s scripts/config.py full make CC=gcc CFLAGS="$ASAN_CFLAGS -m32 -O0" LDFLAGS="-m32 $ASAN_CFLAGS" @@ -2290,16 +2290,17 @@ support_test_m32_o0 () { esac } -component_test_m32_o1 () { - # Build again with -O1, to compile in the i386 specific inline assembly - msg "build: i386, make, gcc -O1 (ASan build)" # ~ 30s +component_test_m32_o2 () { + # Build with optimization, to use the i386 specific inline assembly + # and go faster for tests. + msg "build: i386, make, gcc -O2 (ASan build)" # ~ 30s scripts/config.py full - make CC=gcc CFLAGS="$ASAN_CFLAGS -m32 -O1" LDFLAGS="-m32 $ASAN_CFLAGS" + make CC=gcc CFLAGS="$ASAN_CFLAGS -m32 -O2" LDFLAGS="-m32 $ASAN_CFLAGS" - msg "test: i386, make, gcc -O1 (ASan build)" + msg "test: i386, make, gcc -O2 (ASan build)" make test - msg "test ssl-opt.sh, i386, make, gcc-O1" + msg "test ssl-opt.sh, i386, make, gcc-O2" tests/ssl-opt.sh } support_test_m32_o1 () { @@ -2411,7 +2412,7 @@ component_test_no_x509_info () { scripts/config.pl full scripts/config.pl unset MBEDTLS_MEMORY_BACKTRACE # too slow for tests scripts/config.pl set MBEDTLS_X509_REMOVE_INFO - make CFLAGS='-Werror -O1' + make CFLAGS='-Werror -O2' msg "test: full + MBEDTLS_X509_REMOVE_INFO" # ~ 10s make test