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 <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine 2021-10-05 09:36:03 +02:00
parent d599dc7f1b
commit 6fa69864a2

View file

@ -954,7 +954,7 @@ component_test_psa_crypto_client () {
component_test_zlib_make() { component_test_zlib_make() {
msg "build: zlib enabled, make" msg "build: zlib enabled, make"
scripts/config.py set MBEDTLS_ZLIB_SUPPORT scripts/config.py set MBEDTLS_ZLIB_SUPPORT
make ZLIB=1 CFLAGS='-Werror -O1' make ZLIB=1 CFLAGS='-Werror -O2'
msg "test: main suites (zlib, make)" msg "test: main suites (zlib, make)"
make test make test
@ -2468,7 +2468,7 @@ component_build_mbedtls_config_file () {
} }
component_test_m32_o0 () { 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 msg "build: i386, make, gcc -O0 (ASan build)" # ~ 30s
scripts/config.py full scripts/config.py full
make CC=gcc CFLAGS="$ASAN_CFLAGS -m32 -O0" LDFLAGS="-m32 $ASAN_CFLAGS" make CC=gcc CFLAGS="$ASAN_CFLAGS -m32 -O0" LDFLAGS="-m32 $ASAN_CFLAGS"
@ -2483,16 +2483,17 @@ support_test_m32_o0 () {
esac esac
} }
component_test_m32_o1 () { component_test_m32_o2 () {
# Build again with -O1, to compile in the i386 specific inline assembly # Build with optimization, to use the i386 specific inline assembly
msg "build: i386, make, gcc -O1 (ASan build)" # ~ 30s # and go faster for tests.
msg "build: i386, make, gcc -O2 (ASan build)" # ~ 30s
scripts/config.py full 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 make test
msg "test ssl-opt.sh, i386, make, gcc-O1" msg "test ssl-opt.sh, i386, make, gcc-O2"
tests/ssl-opt.sh tests/ssl-opt.sh
} }
support_test_m32_o1 () { support_test_m32_o1 () {