From f6b56972d50e75ba1bcf4639f5d217aebabc694b Mon Sep 17 00:00:00 2001 From: Alexander Potapenko Date: Tue, 22 Jan 2013 09:16:03 +0000 Subject: [PATCH] [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 --- clang/lib/Driver/ToolChains.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp index 5b7a6da2771f..6f68f1c577a5 100644 --- a/clang/lib/Driver/ToolChains.cpp +++ b/clang/lib/Driver/ToolChains.cpp @@ -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"); } }