[PATCH] D14440: [tsan] Add Clang frontend support for TSan on OS X

Kuba Brecka via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 6 07:04:19 PST 2015


kubabrecka created this revision.
kubabrecka added reviewers: dvyukov, samsonov, kcc, glider.
kubabrecka added subscribers: cfe-commits, zaks.anna, ismailp, jasonk, jevinskie.

We're currently in process of porting TSan to OS X, and quite a few of the initial support in the runtime library has already landed in trunk.  This patch actually enables "-fsanitize=thread" in the frontend.

http://reviews.llvm.org/D14440

Files:
  lib/Driver/ToolChains.cpp

Index: lib/Driver/ToolChains.cpp
===================================================================
--- lib/Driver/ToolChains.cpp
+++ lib/Driver/ToolChains.cpp
@@ -389,6 +389,8 @@
     AddLinkSanitizerLibArgs(Args, CmdArgs, "asan");
   if (Sanitize.needsUbsanRt())
     AddLinkSanitizerLibArgs(Args, CmdArgs, "ubsan");
+  if (Sanitize.needsTsanRt())
+    AddLinkSanitizerLibArgs(Args, CmdArgs, "tsan");
 
   // Otherwise link libSystem, then the dynamic runtime library, and finally any
   // target specific static runtime library.
@@ -1199,6 +1201,7 @@
     if (!isMacosxVersionLT(10, 9))
       Res |= SanitizerKind::Vptr;
     Res |= SanitizerKind::SafeStack;
+    Res |= SanitizerKind::Thread;
   }
   return Res;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14440.39524.patch
Type: text/x-patch
Size: 723 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151106/bfd650d4/attachment.bin>


More information about the cfe-commits mailing list