forked from OSchip/llvm-project
Driver: libubsan_cxx depends on libubsan. Preserve the topological ordering, some linkers depend on it.
llvm-svn: 193048
This commit is contained in:
parent
1d5d634c82
commit
80b5a9d2d0
|
@ -1779,13 +1779,14 @@ 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) {
|
||||||
addSanitizerRTLinkFlagsLinux(TC, Args, CmdArgs, "ubsan", false, false);
|
|
||||||
|
|
||||||
// Only include the bits of the runtime which need a C++ ABI library if
|
// Only include the bits of the runtime which need a C++ ABI library if
|
||||||
// we're linking in C++ mode.
|
// we're linking in C++ mode.
|
||||||
if (IsCXX)
|
if (IsCXX)
|
||||||
addSanitizerRTLinkFlagsLinux(TC, Args, CmdArgs, "ubsan_cxx", false, false);
|
addSanitizerRTLinkFlagsLinux(TC, Args, CmdArgs, "ubsan_cxx", false, false);
|
||||||
|
|
||||||
|
// Now insert the common ubsan bits. ubsan_cxx depends on them.
|
||||||
|
addSanitizerRTLinkFlagsLinux(TC, Args, CmdArgs, "ubsan", false, false);
|
||||||
|
|
||||||
// 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)
|
||||||
|
|
|
@ -113,8 +113,8 @@
|
||||||
// RUN: | FileCheck --check-prefix=CHECK-UBSAN-LINUX-CXX %s
|
// RUN: | FileCheck --check-prefix=CHECK-UBSAN-LINUX-CXX %s
|
||||||
// CHECK-UBSAN-LINUX-CXX: "{{.*}}ld{{(.exe)?}}"
|
// CHECK-UBSAN-LINUX-CXX: "{{.*}}ld{{(.exe)?}}"
|
||||||
// CHECK-UBSAN-LINUX-CXX-NOT: libclang_rt.asan
|
// CHECK-UBSAN-LINUX-CXX-NOT: libclang_rt.asan
|
||||||
// CHECK-UBSAN-LINUX-CXX: "{{.*}}libclang_rt.ubsan-i386.a"
|
|
||||||
// CHECK-UBSAN-LINUX-CXX: "{{.*}}libclang_rt.ubsan_cxx-i386.a"
|
// CHECK-UBSAN-LINUX-CXX: "{{.*}}libclang_rt.ubsan_cxx-i386.a"
|
||||||
|
// CHECK-UBSAN-LINUX-CXX: "{{.*}}libclang_rt.ubsan-i386.a"
|
||||||
// CHECK-UBSAN-LINUX-CXX-NOT: libclang_rt.asan
|
// CHECK-UBSAN-LINUX-CXX-NOT: libclang_rt.asan
|
||||||
// CHECK-UBSAN-LINUX-CXX: "{{.*}}libclang_rt.san-i386.a"
|
// CHECK-UBSAN-LINUX-CXX: "{{.*}}libclang_rt.san-i386.a"
|
||||||
// CHECK-UBSAN-LINUX-CXX-NOT: libclang_rt.asan
|
// CHECK-UBSAN-LINUX-CXX-NOT: libclang_rt.asan
|
||||||
|
@ -142,8 +142,8 @@
|
||||||
// CHECK-ASAN-UBSAN-LINUX-CXX-NOT: libclang_rt.san
|
// CHECK-ASAN-UBSAN-LINUX-CXX-NOT: libclang_rt.san
|
||||||
// CHECK-ASAN-UBSAN-LINUX-CXX: "-whole-archive" "{{.*}}libclang_rt.asan-i386.a" "-no-whole-archive"
|
// CHECK-ASAN-UBSAN-LINUX-CXX: "-whole-archive" "{{.*}}libclang_rt.asan-i386.a" "-no-whole-archive"
|
||||||
// CHECK-ASAN-UBSAN-LINUX-CXX-NOT: libclang_rt.san
|
// CHECK-ASAN-UBSAN-LINUX-CXX-NOT: libclang_rt.san
|
||||||
// CHECK-ASAN-UBSAN-LINUX-CXX: "{{.*}}libclang_rt.ubsan-i386.a"
|
|
||||||
// CHECK-ASAN-UBSAN-LINUX-CXX: "{{.*}}libclang_rt.ubsan_cxx-i386.a"
|
// CHECK-ASAN-UBSAN-LINUX-CXX: "{{.*}}libclang_rt.ubsan_cxx-i386.a"
|
||||||
|
// CHECK-ASAN-UBSAN-LINUX-CXX: "{{.*}}libclang_rt.ubsan-i386.a"
|
||||||
// CHECK-ASAN-UBSAN-LINUX-CXX: "-lpthread"
|
// CHECK-ASAN-UBSAN-LINUX-CXX: "-lpthread"
|
||||||
// CHECK-ASAN-UBSAN-LINUX-CXX: "-lstdc++"
|
// CHECK-ASAN-UBSAN-LINUX-CXX: "-lstdc++"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue