aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2017-11-20 12:44:17 -0800
committerGerald Combs <gerald@wireshark.org>2017-11-21 16:55:18 +0000
commit0b2ecccd863b577335c1c87a902783d3de158839 (patch)
treeaf12ca156f988ca2deff794843d8e67125116735 /configure.ac
parent8cbde93146bfd72e98b942fe81d69300f9488dac (diff)
Add ThreadSanitizer configure-time options.
Add ENABLE_TSAN and enable-tsan options to CMake and Autotools respectively which enable ThreadSanitizer, similar to AddressSanitizer and UndefinedBehaviorSanitizer. Change-Id: I79adf5c1516b0938f140bbf501c181bf14d7619b Reviewed-on: https://code.wireshark.org/review/24515 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac14
1 files changed, 14 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 8abddafe02..3fcc038f18 100644
--- a/configure.ac
+++ b/configure.ac
@@ -759,6 +759,20 @@ AC_ARG_ENABLE(asan,
AC_SUBST(NO_SANITIZE_CFLAGS)
AC_SUBST(NO_SANITIZE_LDFLAGS)
+# Try to enable ThreadSanitizer.
+#
+AC_ARG_ENABLE(tsan,
+ AC_HELP_STRING( [--enable-tsan],
+ [Enable ThreadSanitizer (TSan) for debugging@<:@default=no@:>@]),
+[
+ #
+ # Available since Clang >= 3.2 and GCC >= 4.8
+ #
+ AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fsanitize=thread)
+ AC_WIRESHARK_LDFLAGS_CHECK(-fsanitize=thread)
+
+])
+
# Try to enable UndefinedBehaviorSanitizer.
#
AC_ARG_ENABLE(ubsan,