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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252310 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
kubamracek committed Nov 6, 2015
1 parent db7ff08 commit c8d32a2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/Driver/ToolChains.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -1199,6 +1201,7 @@ SanitizerMask Darwin::getSupportedSanitizers() const {
if (!isMacosxVersionLT(10, 9))
Res |= SanitizerKind::Vptr;
Res |= SanitizerKind::SafeStack;
Res |= SanitizerKind::Thread;
}
return Res;
}
Expand Down

0 comments on commit c8d32a2

Please sign in to comment.