Merge pull request #2899 from gilles-peskine-arm/asan-test-fail-2.16

Backport 2.16: Make sure Asan failures are detected in 'make test'
This commit is contained in:
Jaeden Amero 2019-10-22 16:30:45 +01:00 committed by GitHub
commit ec904e4b57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View File

@ -137,6 +137,9 @@ pre_initialize_variables () {
export MAKEFLAGS="-j" export MAKEFLAGS="-j"
fi fi
# CFLAGS and LDFLAGS for Asan builds that don't use CMake
ASAN_CFLAGS='-Werror -Wall -Wextra -fsanitize=address,undefined -fno-sanitize-recover=all'
# Gather the list of available components. These are the functions # Gather the list of available components. These are the functions
# defined in this script whose name starts with "component_". # defined in this script whose name starts with "component_".
# Parse the script with sed, because in sh there is no way to list # Parse the script with sed, because in sh there is no way to list
@ -1064,7 +1067,7 @@ component_test_m32_o0 () {
# Build once with -O0, to compile out the i386 specific inline assembly # Build once with -O0, to compile out 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.pl full scripts/config.pl full
make CC=gcc CFLAGS='-O0 -Werror -Wall -Wextra -m32 -fsanitize=address' LDFLAGS='-m32 -fsanitize=address' make CC=gcc CFLAGS="$ASAN_CFLAGS -m32 -O0" LDFLAGS="-m32 $ASAN_CFLAGS"
msg "test: i386, make, gcc -O0 (ASan build)" msg "test: i386, make, gcc -O0 (ASan build)"
make test make test
@ -1080,7 +1083,7 @@ component_test_m32_o1 () {
# Build again with -O1, to compile in the i386 specific inline assembly # Build again with -O1, to compile in the i386 specific inline assembly
msg "build: i386, make, gcc -O1 (ASan build)" # ~ 30s msg "build: i386, make, gcc -O1 (ASan build)" # ~ 30s
scripts/config.pl full scripts/config.pl full
make CC=gcc CFLAGS='-O1 -Werror -Wall -Wextra -m32 -fsanitize=address' LDFLAGS='-m32 -fsanitize=address' make CC=gcc CFLAGS="$ASAN_CFLAGS -m32 -O1" LDFLAGS="-m32 $ASAN_CFLAGS"
msg "test: i386, make, gcc -O1 (ASan build)" msg "test: i386, make, gcc -O1 (ASan build)"
make test make test

View File

@ -93,7 +93,7 @@ for my $suite (@suites)
$suite_cases_failed = () = $result =~ /.. FAILED/g; $suite_cases_failed = () = $result =~ /.. FAILED/g;
$suite_cases_skipped = () = $result =~ /.. ----/g; $suite_cases_skipped = () = $result =~ /.. ----/g;
if( $result =~ /PASSED/ ) { if( $? == 0 ) {
print "PASS\n"; print "PASS\n";
if( $verbose > 2 ) { if( $verbose > 2 ) {
pad_print_center( 72, '-', "Begin $suite" ); pad_print_center( 72, '-', "Begin $suite" );