public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1/2] configure: add support for thread sanitizer (--enable-tsan)
@ 2020-03-12 11:31 Matthias Maennich
  2020-03-12 11:31 ` [PATCH 2/2] abg-workers: guard bring_workers_down to avoid dead lock Matthias Maennich
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Matthias Maennich @ 2020-03-12 11:31 UTC (permalink / raw)
  To: libabigail; +Cc: dodji, kernel-team, maennich

Similarly to asan and ubsan, add support for tsan conditionally at
configure time. This allows us to track down race conditions etc.

	* configure.ac: Add configure options for -fsanitize=thread

Signed-off-by: Matthias Maennich <maennich@google.com>
---
 configure.ac | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/configure.ac b/configure.ac
index ba800a72ac7a..50a50c6c8932 100644
--- a/configure.ac
+++ b/configure.ac
@@ -120,6 +120,12 @@ AC_ARG_ENABLE(asan,
 	      ENABLE_ASAN=$enableval,
 	      ENABLE_ASAN=no)
 
+AC_ARG_ENABLE(tsan,
+	      AS_HELP_STRING([--enable-tsan=yes|no],
+			     [enable the support of building with -fsanitize=thread)]),
+	      ENABLE_TSAN=$enableval,
+	      ENABLE_TSAN=no)
+
 AC_ARG_ENABLE(ubsan,
 	      AS_HELP_STRING([--enable-ubsan=yes|no],
 			     [enable the support of building with -fsanitize=undefined)]),
@@ -614,6 +620,11 @@ if test x$ENABLE_ASAN = xyes; then
     CXXFLAGS="$CXXFLAGS -fsanitize=address"
 fi
 
+if test x$ENABLE_TSAN = xyes; then
+    CFLAGS="$CFLAGS -fsanitize=thread"
+    CXXFLAGS="$CXXFLAGS -fsanitize=thread"
+fi
+
 if test x$ENABLE_UBSAN = xyes; then
     CFLAGS="$CFLAGS -fsanitize=undefined"
     CXXFLAGS="$CXXFLAGS -fsanitize=undefined"
@@ -907,6 +918,7 @@ AC_MSG_NOTICE([
     Enable python 3				   : ${ENABLE_PYTHON3}
     Enable running tests under Valgrind            : ${enable_valgrind}
     Enable build with -fsanitize=address    	   : ${ENABLE_ASAN}
+    Enable build with -fsanitize=thread    	   : ${ENABLE_TSAN}
     Enable build with -fsanitize=undefined  	   : ${ENABLE_UBSAN}
     Generate html apidoc	                   : ${ENABLE_APIDOC}
     Generate html manual	                   : ${ENABLE_MANUAL}
-- 
2.25.1.481.gfbce0eb801-goog


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-03-22 22:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-12 11:31 [PATCH 1/2] configure: add support for thread sanitizer (--enable-tsan) Matthias Maennich
2020-03-12 11:31 ` [PATCH 2/2] abg-workers: guard bring_workers_down to avoid dead lock Matthias Maennich
2020-03-16 15:13   ` Giuliano Procida
2020-03-18 13:41   ` Dodji Seketeli
2020-03-16 15:00 ` [PATCH 1/2] configure: add support for thread sanitizer (--enable-tsan) Giuliano Procida
2020-03-17 23:18   ` Matthias Maennich
2020-03-22 22:45   ` Matthias Maennich
2020-03-18 12:47 ` Dodji Seketeli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).