[ASan] Link with the dynamic runtime on OS X

This patch changes the behavior of the -fsanitize=address flag, making it use the dynamic runtime library (libclang_rt.asan_osx_dynamic.dylib) instead of the static one. It also drops the CoreFoundation dependency, since the dynamic runtime doesn't need it.

llvm-svn: 173135
This commit is contained in:
Alexander Potapenko 2013-01-22 09:16:03 +00:00
parent cae42d23a6
commit f6b56972d5
1 changed files with 2 additions and 4 deletions

View File

@ -339,12 +339,10 @@ void DarwinClang::AddLinkRuntimeLibArgs(const ArgList &Args,
getDriver().Diag(diag::err_drv_clang_unsupported_per_platform)
<< "-fsanitize=address";
} else {
AddLinkRuntimeLib(Args, CmdArgs, "libclang_rt.asan_osx.a", true);
AddLinkRuntimeLib(Args, CmdArgs, "libclang_rt.asan_osx_dynamic.dylib", true);
// The ASAN runtime library requires C++ and CoreFoundation.
// The ASAN runtime library requires C++.
AddCXXStdlibLibArgs(Args, CmdArgs);
CmdArgs.push_back("-framework");
CmdArgs.push_back("CoreFoundation");
}
}