Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH] btrfs-progs: Enable ThreadSanitizer, using D=tsan.
@ 2017-07-12 20:04 Adam Buchbinder
  2017-07-12 21:51 ` David Sterba
  2017-08-25 18:03 ` David Sterba
  0 siblings, 2 replies; 4+ messages in thread
From: Adam Buchbinder @ 2017-07-12 20:04 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Adam Buchbinder

Tested with clang-3.9.

Signed-off-by: Adam Buchbinder <abuchbinder@google.com>
---
 Makefile | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Makefile b/Makefile
index 81598df..8948301 100644
--- a/Makefile
+++ b/Makefile
@@ -17,6 +17,7 @@
 #                  abort   - call abort() on first error (dumps core)
 #                  all     - shortcut for all of the above
 #                  asan    - enable address sanitizer compiler feature
+#                  tsan    - enable thread sanitizer compiler feature
 #                  ubsan   - undefined behaviour sanitizer compiler feature
 #                  bcheck  - extended build checks
 #   W=123          build with warnings (default: off)
@@ -157,6 +158,11 @@ ifneq (,$(findstring asan,$(D)))
   DEBUG_CFLAGS_INTERNAL += -fsanitize=address
 endif
 
+ifneq (,$(findstring tsan,$(D)))
+  DEBUG_CFLAGS_INTERNAL += -fsanitize=thread -fPIE
+  LD_FLAGS += -fsanitize=thread -ltsan -pie
+endif
+
 ifneq (,$(findstring ubsan,$(D)))
   DEBUG_CFLAGS_INTERNAL += -fsanitize=undefined
 endif
-- 
2.13.2.932.g7449e964c-goog


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

end of thread, other threads:[~2017-08-25 18:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-12 20:04 [PATCH] btrfs-progs: Enable ThreadSanitizer, using D=tsan Adam Buchbinder
2017-07-12 21:51 ` David Sterba
     [not found]   ` <CALb+jKoe8U5XdnPT1KnYsJBezrk=FcsbEsu3+ibT+Xv8gOhp=g@mail.gmail.com>
2017-07-12 22:53     ` David Sterba
2017-08-25 18:03 ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox