r252310 - [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:09:20 PST 2015


Author: kuba.brecka
Date: Fri Nov  6 09:09:20 2015
New Revision: 252310

URL: http://llvm.org/viewvc/llvm-project?rev=252310&view=rev
Log:
[tsan] Add Clang frontend support for TSan on OS X

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.

Differential Revision: http://reviews.llvm.org/D14440


Modified:
    cfe/trunk/lib/Driver/ToolChains.cpp

Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=252310&r1=252309&r2=252310&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Fri Nov  6 09:09:20 2015
@@ -389,6 +389,8 @@ void DarwinClang::AddLinkRuntimeLibArgs(
     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 @@ SanitizerMask Darwin::getSupportedSaniti
     if (!isMacosxVersionLT(10, 9))
       Res |= SanitizerKind::Vptr;
     Res |= SanitizerKind::SafeStack;
+    Res |= SanitizerKind::Thread;
   }
   return Res;
 }




More information about the cfe-commits mailing list