@@ -14,6 +14,7 @@ AS_IF([test "${with_only_libndpi+set}" = set],[
14
14
] )
15
15
16
16
AC_ARG_WITH ( sanitizer , AS_HELP_STRING ( [ --with-sanitizer] , [ Build with support for address, undefined and leak sanitizer] ) )
17
+ AC_ARG_WITH ( thread-sanitizer , AS_HELP_STRING ( [ --with-thread-sanitizer] , [ Build with support for thread sanitizer] ) )
17
18
AC_ARG_ENABLE ( fuzztargets , AS_HELP_STRING ( [ --enable-fuzztargets] , [ Enable fuzz targets] ) ,[ enable_fuzztargets=$enableval] ,[ enable_fuzztargets=no] )
18
19
AC_ARG_ENABLE ( gprof , AS_HELP_STRING ( [ --enable-gprof] , [ Enable CPU/HEAP profiling with gperftools] ) ,[ enable_gprof=$enableval] ,[ enable_gprof=no] )
19
20
AC_ARG_ENABLE ( code-coverage , AS_HELP_STRING ( [ --enable-code-coverage] , [ Generate Code Coverage report] ) )
@@ -24,10 +25,24 @@ AC_ARG_ENABLE(npcap, AS_HELP_STRING([--disable-npcap], [msys2 only: Disable link
24
25
AS_IF ( [ test "x$enable_fuzztargets" = "xyes"] , [ BUILD_FUZZTARGETS=1] , [ BUILD_FUZZTARGETS=0] )
25
26
AM_CONDITIONAL([ BUILD_FUZZTARGETS] , [ test "x$enable_fuzztargets" = "xyes"] )
26
27
28
+ AS_IF ( [ test "${with_sanitizer+set}" = set -a "${with_thread_sanitizer+set}" = set] ,[
29
+ AC_MSG_ERROR ( [ Configure options `--with-sanitizer' and `--with_thread_sanitizer' can not used at the same time.] )
30
+ ] )
31
+ AS_IF ( [ test "${with_sanitizer+set}" = set -o "${with_thread_sanitizer+set}" = set] ,[
32
+ CFLAGS="${CFLAGS} -O0 -g3"
33
+ ] ,[
34
+ CFLAGS="${CFLAGS} -g"
35
+ ] )
36
+
27
37
AS_IF ( [ test "${with_sanitizer+set}" = set] ,[
28
- CFLAGS="${CFLAGS} -g3 -O0 - fsanitize=address -fsanitize=undefined -fno-sanitize=alignment -fsanitize=leak -fno-omit-frame-pointer"
38
+ CFLAGS="${CFLAGS} -fsanitize=address -fsanitize=undefined -fno-sanitize=alignment -fsanitize=leak -fno-omit-frame-pointer"
29
39
LDFLAGS="${LDFLAGS} -fsanitize=address -fsanitize=undefined -fno-sanitize=alignment -fsanitize=leak"
30
- ] ,[ CFLAGS="${CFLAGS} -g"] )
40
+ ] )
41
+
42
+ AS_IF ( [ test "${with_thread_sanitizer+set}" = set] ,[
43
+ CFLAGS="${CFLAGS} -fsanitize=thread -fno-omit-frame-pointer"
44
+ LDFLAGS="${LDFLAGS} -fsanitize=thread"
45
+ ] )
31
46
32
47
AS_IF ( [ test "x${enable_code_coverage}" = "xyes"] ,[
33
48
CFLAGS="${CFLAGS} -fprofile-arcs -ftest-coverage"
0 commit comments