File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -20,9 +20,14 @@ if test "$DEFAULT_PAGESIZE" != auto; then
20
20
fi
21
21
22
22
AC_ARG_WITH ( [ asan] ,
23
- AS_HELP_STRING ( [ --with-asan] , [ Link with libasan ] )
23
+ AS_HELP_STRING ( [ --with-asan] , [ Build with address sanitizer ] )
24
24
)
25
25
AM_CONDITIONAL([ WITH_ASAN] , [ test x"$with_asan" = xyes] )
26
26
27
+ AC_ARG_WITH ( [ ubsan] ,
28
+ AS_HELP_STRING ( [ --with-ubsan] , [ Build with undefined behavior sanitizer] )
29
+ )
30
+ AM_CONDITIONAL([ WITH_UBSAN] , [ test x"$with_ubsan" = xyes] )
31
+
27
32
AC_CONFIG_FILES ( [ Makefile src/Makefile tests/Makefile patchelf.spec] )
28
33
AC_OUTPUT
Original file line number Diff line number Diff line change 1
1
AM_CXXFLAGS = -Wall -std=c++11 -D_FILE_OFFSET_BITS=64
2
2
3
+ SAN_FLAGS = -fno-optimize-sibling-calls -fsanitize-address-use-after-scope -fno-omit-frame-pointer -g -O1
4
+
3
5
if WITH_ASAN
4
- AM_CXXFLAGS += -fsanitize=address -fno-optimize-sibling-calls -fsanitize-address-use-after-scope -fno-omit-frame-pointer -g -O1
6
+ AM_CXXFLAGS += -fsanitize=address $(SAN_FLAGS )
7
+ endif
8
+
9
+ if WITH_UBSAN
10
+ AM_CXXFLAGS += -fsanitize=undefined $(SAN_FLAGS )
5
11
endif
6
12
7
13
bin_PROGRAMS = patchelf
You can’t perform that action at this time.
0 commit comments