@@ -137,6 +137,9 @@ pre_initialize_variables () {
137
137
export MAKEFLAGS=" -j"
138
138
fi
139
139
140
+ # CFLAGS and LDFLAGS for Asan builds that don't use CMake
141
+ ASAN_CFLAGS=' -Werror -Wall -Wextra -fsanitize=address,undefined -fno-sanitize-recover=all'
142
+
140
143
# Gather the list of available components. These are the functions
141
144
# defined in this script whose name starts with "component_".
142
145
# Parse the script with sed, because in sh there is no way to list
@@ -1064,7 +1067,7 @@ component_test_m32_o0 () {
1064
1067
# Build once with -O0, to compile out the i386 specific inline assembly
1065
1068
msg " build: i386, make, gcc -O0 (ASan build)" # ~ 30s
1066
1069
scripts/config.pl full
1067
- make CC=gcc CFLAGS=' -O0 -Werror -Wall -Wextra - m32 -fsanitize=address ' LDFLAGS=' -m32 -fsanitize=address '
1070
+ make CC=gcc CFLAGS=" $ASAN_CFLAGS - m32 -O0 " LDFLAGS=" -m32 $ASAN_CFLAGS "
1068
1071
1069
1072
msg " test: i386, make, gcc -O0 (ASan build)"
1070
1073
make test
@@ -1080,7 +1083,7 @@ component_test_m32_o1 () {
1080
1083
# Build again with -O1, to compile in the i386 specific inline assembly
1081
1084
msg " build: i386, make, gcc -O1 (ASan build)" # ~ 30s
1082
1085
scripts/config.pl full
1083
- make CC=gcc CFLAGS=' -O1 -Werror -Wall -Wextra - m32 -fsanitize=address ' LDFLAGS=' -m32 -fsanitize=address '
1086
+ make CC=gcc CFLAGS=" $ASAN_CFLAGS - m32 -O1 " LDFLAGS=" -m32 $ASAN_CFLAGS "
1084
1087
1085
1088
msg " test: i386, make, gcc -O1 (ASan build)"
1086
1089
make test
0 commit comments