[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

llvm-svn: 252310
This commit is contained in:
Kuba Brecka 2015-11-06 15:09:20 +00:00
parent 9dcecefe67
commit 85e01c0bdc
1 changed files with 3 additions and 0 deletions

View File

@ -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;
}