Skip to content

Commit

Permalink
[tsan] Add Clang frontend support for TSan on OS X
Browse files Browse the repository at this point in the history
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

llvm-svn: 252310
  • Loading branch information
kubamracek committed Nov 6, 2015

Unverified

No user is associated with the committer email.
1 parent 9dcecef commit 85e01c0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions clang/lib/Driver/ToolChains.cpp
Original file line number Diff line number Diff line change
@@ -389,6 +389,8 @@ void DarwinClang::AddLinkRuntimeLibArgs(const ArgList &Args,
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::getSupportedSanitizers() const {
if (!isMacosxVersionLT(10, 9))
Res |= SanitizerKind::Vptr;
Res |= SanitizerKind::SafeStack;
Res |= SanitizerKind::Thread;
}
return Res;
}

0 comments on commit 85e01c0

Please sign in to comment.