forked from OSchip/llvm-project
[ASan] Don't link against libc++abi when not using libc++
This is a follow-up to r233860 which added -lc++abi when using ASan on Mac, and broke Chromium's ASan build which doesn't use libc++. llvm-svn: 234521
This commit is contained in:
parent
f8e68e230b
commit
10821e5283
|
@ -338,9 +338,12 @@ void DarwinClang::AddLinkSanitizerLibArgs(const ArgList &Args,
|
|||
OS + "_dynamic.dylib").str(),
|
||||
/*AlwaysLink*/ true, /*IsEmbedded*/ false,
|
||||
/*AddRPath*/ true);
|
||||
// Add explicit dependcy on -lc++abi, as -lc++ doesn't re-export
|
||||
// all RTTI-related symbols that UBSan uses.
|
||||
CmdArgs.push_back("-lc++abi");
|
||||
|
||||
if (GetCXXStdlibType(Args) == ToolChain::CST_Libcxx) {
|
||||
// Add explicit dependcy on -lc++abi, as -lc++ doesn't re-export
|
||||
// all RTTI-related symbols that UBSan uses.
|
||||
CmdArgs.push_back("-lc++abi");
|
||||
}
|
||||
}
|
||||
|
||||
void DarwinClang::AddLinkRuntimeLibArgs(const ArgList &Args,
|
||||
|
|
|
@ -272,3 +272,11 @@
|
|||
// CHECK-LSAN-ASAN-LINUX-NOT: libclang_rt.lsan
|
||||
// CHECK-LSAN-ASAN-LINUX: libclang_rt.asan-x86_64
|
||||
// CHECK-LSAN-ASAN-LINUX-NOT: libclang_rt.lsan
|
||||
|
||||
// RUN: %clangcxx -fsanitize=address %s -### -o %t.o 2>&1 \
|
||||
// RUN: -mmacosx-version-min=10.6 \
|
||||
// RUN: -target x86_64-apple-darwin13.4.0 \
|
||||
// RUN: | FileCheck --check-prefix=CHECK-ASAN-DARWIN106-CXX %s
|
||||
// CHECK-ASAN-DARWIN106-CXX: "{{.*}}ld{{(.exe)?}}"
|
||||
// CHECK-ASAN-DARWIN106-CXX: libclang_rt.asan_osx_dynamic.dylib
|
||||
// CHECK-ASAN-DARWIN106-CXX-NOT: -lc++abi
|
||||
|
|
Loading…
Reference in New Issue