Added TSAN support. (#1613)
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
This commit is contained in:
@@ -177,6 +177,13 @@ jobs:
|
|||||||
pcre: "--with-pcre"
|
pcre: "--with-pcre"
|
||||||
maxminddb: "--with-maxminddb"
|
maxminddb: "--with-maxminddb"
|
||||||
msan: "--with-sanitizer"
|
msan: "--with-sanitizer"
|
||||||
|
- compiler: "default-cc"
|
||||||
|
os: ubuntu-latest
|
||||||
|
arch: "x86_64"
|
||||||
|
gcrypt: ""
|
||||||
|
pcre: "--with-pcre"
|
||||||
|
maxminddb: "--with-maxminddb"
|
||||||
|
msan: "--with-thread-sanitizer"
|
||||||
- compiler: "default-cc"
|
- compiler: "default-cc"
|
||||||
os: ubuntu-18.04
|
os: ubuntu-18.04
|
||||||
arch: "x86_64"
|
arch: "x86_64"
|
||||||
|
|||||||
+17
-2
@@ -14,6 +14,7 @@ AS_IF([test "${with_only_libndpi+set}" = set],[
|
|||||||
])
|
])
|
||||||
|
|
||||||
AC_ARG_WITH(sanitizer, AS_HELP_STRING([--with-sanitizer], [Build with support for address, undefined and leak sanitizer]))
|
AC_ARG_WITH(sanitizer, AS_HELP_STRING([--with-sanitizer], [Build with support for address, undefined and leak sanitizer]))
|
||||||
|
AC_ARG_WITH(thread-sanitizer, AS_HELP_STRING([--with-thread-sanitizer], [Build with support for thread sanitizer]))
|
||||||
AC_ARG_ENABLE(fuzztargets, AS_HELP_STRING([--enable-fuzztargets], [Enable fuzz targets]),[enable_fuzztargets=$enableval],[enable_fuzztargets=no])
|
AC_ARG_ENABLE(fuzztargets, AS_HELP_STRING([--enable-fuzztargets], [Enable fuzz targets]),[enable_fuzztargets=$enableval],[enable_fuzztargets=no])
|
||||||
AC_ARG_ENABLE(gprof, AS_HELP_STRING([--enable-gprof], [Enable CPU/HEAP profiling with gperftools]),[enable_gprof=$enableval],[enable_gprof=no])
|
AC_ARG_ENABLE(gprof, AS_HELP_STRING([--enable-gprof], [Enable CPU/HEAP profiling with gperftools]),[enable_gprof=$enableval],[enable_gprof=no])
|
||||||
AC_ARG_ENABLE(code-coverage, AS_HELP_STRING([--enable-code-coverage], [Generate Code Coverage report]))
|
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
|
|||||||
AS_IF([test "x$enable_fuzztargets" = "xyes"], [BUILD_FUZZTARGETS=1], [BUILD_FUZZTARGETS=0])
|
AS_IF([test "x$enable_fuzztargets" = "xyes"], [BUILD_FUZZTARGETS=1], [BUILD_FUZZTARGETS=0])
|
||||||
AM_CONDITIONAL([BUILD_FUZZTARGETS], [test "x$enable_fuzztargets" = "xyes"])
|
AM_CONDITIONAL([BUILD_FUZZTARGETS], [test "x$enable_fuzztargets" = "xyes"])
|
||||||
|
|
||||||
|
AS_IF([test "${with_sanitizer+set}" = set -a "${with_thread_sanitizer+set}" = set],[
|
||||||
|
AC_MSG_ERROR([Configure options `--with-sanitizer' and `--with_thread_sanitizer' can not used at the same time.])
|
||||||
|
])
|
||||||
|
AS_IF([test "${with_sanitizer+set}" = set -o "${with_thread_sanitizer+set}" = set],[
|
||||||
|
CFLAGS="${CFLAGS} -O0 -g3"
|
||||||
|
],[
|
||||||
|
CFLAGS="${CFLAGS} -g"
|
||||||
|
])
|
||||||
|
|
||||||
AS_IF([test "${with_sanitizer+set}" = set],[
|
AS_IF([test "${with_sanitizer+set}" = set],[
|
||||||
CFLAGS="${CFLAGS} -g3 -O0 -fsanitize=address -fsanitize=undefined -fno-sanitize=alignment -fsanitize=leak -fno-omit-frame-pointer"
|
CFLAGS="${CFLAGS} -fsanitize=address -fsanitize=undefined -fno-sanitize=alignment -fsanitize=leak -fno-omit-frame-pointer"
|
||||||
LDFLAGS="${LDFLAGS} -fsanitize=address -fsanitize=undefined -fno-sanitize=alignment -fsanitize=leak"
|
LDFLAGS="${LDFLAGS} -fsanitize=address -fsanitize=undefined -fno-sanitize=alignment -fsanitize=leak"
|
||||||
],[CFLAGS="${CFLAGS} -g"])
|
])
|
||||||
|
|
||||||
|
AS_IF([test "${with_thread_sanitizer+set}" = set],[
|
||||||
|
CFLAGS="${CFLAGS} -fsanitize=thread -fno-omit-frame-pointer"
|
||||||
|
LDFLAGS="${LDFLAGS} -fsanitize=thread"
|
||||||
|
])
|
||||||
|
|
||||||
AS_IF([test "x${enable_code_coverage}" = "xyes"],[
|
AS_IF([test "x${enable_code_coverage}" = "xyes"],[
|
||||||
CFLAGS="${CFLAGS} -fprofile-arcs -ftest-coverage"
|
CFLAGS="${CFLAGS} -fprofile-arcs -ftest-coverage"
|
||||||
|
|||||||
Reference in New Issue
Block a user