Merge pull request #5011 from gilles-peskine-arm/test_ssl_o2-3.0

Build with -O2 when running ssl-opt
This commit is contained in:
Manuel Pégourié-Gonnard 2021-10-29 09:25:23 +02:00 committed by GitHub
commit da71054bbc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1305,7 +1305,7 @@ component_test_psa_collect_statuses () {
component_test_full_cmake_clang () { component_test_full_cmake_clang () {
msg "build: cmake, full config, clang" # ~ 50s msg "build: cmake, full config, clang" # ~ 50s
scripts/config.py full scripts/config.py full
CC=clang cmake -D CMAKE_BUILD_TYPE:String=Check -D ENABLE_TESTING=On . CC=clang cmake -D CMAKE_BUILD_TYPE:String=Release -D ENABLE_TESTING=On .
make make
msg "test: main suites (full config, clang)" # ~ 5s msg "test: main suites (full config, clang)" # ~ 5s
@ -1961,7 +1961,8 @@ component_build_no_std_function () {
scripts/config.py set MBEDTLS_PLATFORM_NO_STD_FUNCTIONS scripts/config.py set MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
scripts/config.py unset MBEDTLS_ENTROPY_NV_SEED scripts/config.py unset MBEDTLS_ENTROPY_NV_SEED
scripts/config.py unset MBEDTLS_PLATFORM_NV_SEED_ALT scripts/config.py unset MBEDTLS_PLATFORM_NV_SEED_ALT
make CC=gcc CFLAGS='-Werror -Wall -Wextra -Os' CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Check .
make
} }
component_build_no_ssl_srv () { component_build_no_ssl_srv () {
@ -1994,7 +1995,7 @@ component_test_memory_buffer_allocator_backtrace () {
scripts/config.py set MBEDTLS_PLATFORM_MEMORY scripts/config.py set MBEDTLS_PLATFORM_MEMORY
scripts/config.py set MBEDTLS_MEMORY_BACKTRACE scripts/config.py set MBEDTLS_MEMORY_BACKTRACE
scripts/config.py set MBEDTLS_MEMORY_DEBUG scripts/config.py set MBEDTLS_MEMORY_DEBUG
CC=gcc cmake . CC=gcc cmake -DCMAKE_BUILD_TYPE:String=Release .
make make
msg "test: MBEDTLS_MEMORY_BUFFER_ALLOC_C and MBEDTLS_MEMORY_BACKTRACE" msg "test: MBEDTLS_MEMORY_BUFFER_ALLOC_C and MBEDTLS_MEMORY_BACKTRACE"
@ -2005,7 +2006,7 @@ component_test_memory_buffer_allocator () {
msg "build: default config with memory buffer allocator" msg "build: default config with memory buffer allocator"
scripts/config.py set MBEDTLS_MEMORY_BUFFER_ALLOC_C scripts/config.py set MBEDTLS_MEMORY_BUFFER_ALLOC_C
scripts/config.py set MBEDTLS_PLATFORM_MEMORY scripts/config.py set MBEDTLS_PLATFORM_MEMORY
CC=gcc cmake . CC=gcc cmake -DCMAKE_BUILD_TYPE:String=Release .
make make
msg "test: MBEDTLS_MEMORY_BUFFER_ALLOC_C" msg "test: MBEDTLS_MEMORY_BUFFER_ALLOC_C"
@ -2114,7 +2115,7 @@ component_test_ssl_alloc_buffer_and_mfl () {
scripts/config.py set MBEDTLS_MEMORY_DEBUG scripts/config.py set MBEDTLS_MEMORY_DEBUG
scripts/config.py set MBEDTLS_SSL_MAX_FRAGMENT_LENGTH scripts/config.py set MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
scripts/config.py set MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH scripts/config.py set MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH
CC=gcc cmake . CC=gcc cmake -DCMAKE_BUILD_TYPE:String=Release .
make make
msg "test: MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH, MBEDTLS_MEMORY_BUFFER_ALLOC_C, MBEDTLS_MEMORY_DEBUG and MBEDTLS_SSL_MAX_FRAGMENT_LENGTH" msg "test: MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH, MBEDTLS_MEMORY_BUFFER_ALLOC_C, MBEDTLS_MEMORY_DEBUG and MBEDTLS_SSL_MAX_FRAGMENT_LENGTH"
@ -2141,7 +2142,7 @@ component_test_when_no_ciphersuites_have_mac () {
component_test_no_date_time () { component_test_no_date_time () {
msg "build: default config without MBEDTLS_HAVE_TIME_DATE" msg "build: default config without MBEDTLS_HAVE_TIME_DATE"
scripts/config.py unset MBEDTLS_HAVE_TIME_DATE scripts/config.py unset MBEDTLS_HAVE_TIME_DATE
CC=gcc cmake CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Check .
make make
msg "test: !MBEDTLS_HAVE_TIME_DATE - main suites" msg "test: !MBEDTLS_HAVE_TIME_DATE - main suites"
@ -2322,7 +2323,8 @@ 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, so as to use portable C code (in a 32-bit
# build) and not 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"
@ -2337,19 +2339,20 @@ 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_o2 () {
support_test_m32_o0 "$@" support_test_m32_o0 "$@"
} }
@ -2458,7 +2461,7 @@ component_test_no_x509_info () {
scripts/config.pl full scripts/config.pl full
scripts/config.pl unset MBEDTLS_MEMORY_BACKTRACE # too slow for tests scripts/config.pl unset MBEDTLS_MEMORY_BACKTRACE # too slow for tests
scripts/config.pl set MBEDTLS_X509_REMOVE_INFO scripts/config.pl set MBEDTLS_X509_REMOVE_INFO
make CFLAGS='-Werror -O1' make CFLAGS='-Werror -O2'
msg "test: full + MBEDTLS_X509_REMOVE_INFO" # ~ 10s msg "test: full + MBEDTLS_X509_REMOVE_INFO" # ~ 10s
make test make test
@ -2678,7 +2681,7 @@ component_test_cmake_out_of_source () {
MBEDTLS_ROOT_DIR="$PWD" MBEDTLS_ROOT_DIR="$PWD"
mkdir "$OUT_OF_SOURCE_DIR" mkdir "$OUT_OF_SOURCE_DIR"
cd "$OUT_OF_SOURCE_DIR" cd "$OUT_OF_SOURCE_DIR"
cmake "$MBEDTLS_ROOT_DIR" cmake -D CMAKE_BUILD_TYPE:String=Check "$MBEDTLS_ROOT_DIR"
make make
msg "test: cmake 'out-of-source' build" msg "test: cmake 'out-of-source' build"