Link in the ubsan runtime when building shared objects.

llvm-svn: 188325
This commit is contained in:
Nick Lewycky 2013-08-13 22:32:35 +00:00
parent 4e28b26589
commit bbd6db8032
2 changed files with 1 additions and 4 deletions

View File

@ -1734,9 +1734,6 @@ static void addLsanRTLinux(const ToolChain &TC, const ArgList &Args,
static void addUbsanRTLinux(const ToolChain &TC, const ArgList &Args, static void addUbsanRTLinux(const ToolChain &TC, const ArgList &Args,
ArgStringList &CmdArgs, bool IsCXX, ArgStringList &CmdArgs, bool IsCXX,
bool HasOtherSanitizerRt) { bool HasOtherSanitizerRt) {
if (Args.hasArg(options::OPT_shared))
return;
// Need a copy of sanitizer_common. This could come from another sanitizer // Need a copy of sanitizer_common. This could come from another sanitizer
// runtime; if we're not including one, include our own copy. // runtime; if we're not including one, include our own copy.
if (!HasOtherSanitizerRt) if (!HasOtherSanitizerRt)

View File

@ -152,7 +152,7 @@
// RUN: -shared \ // RUN: -shared \
// RUN: | FileCheck --check-prefix=CHECK-UBSAN-LINUX-SHARED %s // RUN: | FileCheck --check-prefix=CHECK-UBSAN-LINUX-SHARED %s
// CHECK-UBSAN-LINUX-SHARED: "{{.*}}ld{{(.exe)?}}" // CHECK-UBSAN-LINUX-SHARED: "{{.*}}ld{{(.exe)?}}"
// CHECK-UBSAN-LINUX-SHARED-NOT: libclang_rt.ubsan-i386.a" // CHECK-UBSAN-LINUX-SHARED: libclang_rt.ubsan-i386.a"
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: -target x86_64-unknown-linux -fsanitize=leak \ // RUN: -target x86_64-unknown-linux -fsanitize=leak \