From b33750c50c0907b02fb5a928a2baeca37880cce8 Mon Sep 17 00:00:00 2001 From: Renato Golin Date: Thu, 23 Jul 2015 17:24:41 +0000 Subject: [PATCH] [Compiler-RT] Remove dependency on libgcc_s/eh Currently, for --rtlib=compiler-rt on GNU systems, we're assuming that one has libgcc_s and libgcc_eh as low-level libraries, which when used in conjunction with -lunwind or -lc++abi, breaks that assumption. My original fix was wrong, and this patch reverts it to prepare for a new flag to choose the unwinder/C++ libraries. For the time being, people can use "-lgcc_s -lgcc_eh" or "-lunwind -lc++abi" or any combination they need explicitly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@243025 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/Tools.cpp | 7 ------- test/Driver/linux-ld.c | 8 ++++---- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 2696596f6d..6bab65a111 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -2293,13 +2293,6 @@ SmallString<128> tools::getCompilerRT(const ToolChain &TC, StringRef Component, static void addClangRT(const ToolChain &TC, const ArgList &Args, ArgStringList &CmdArgs) { CmdArgs.push_back(Args.MakeArgString(getCompilerRT(TC, "builtins"))); - - if (!TC.getTriple().isOSWindows()) { - // FIXME: why do we link against gcc when we are using compiler-rt? - CmdArgs.push_back("-lgcc_s"); - if (TC.getDriver().CCCIsCXX()) - CmdArgs.push_back("-lgcc_eh"); - } } static void addProfileRT(const ToolChain &TC, const ArgList &Args, diff --git a/test/Driver/linux-ld.c b/test/Driver/linux-ld.c index 5e865a953c..2c06fc1d77 100644 --- a/test/Driver/linux-ld.c +++ b/test/Driver/linux-ld.c @@ -66,9 +66,9 @@ // CHECK-LD-RT: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.." // CHECK-LD-RT: "-L[[SYSROOT]]/lib" // CHECK-LD-RT: "-L[[SYSROOT]]/usr/lib" -// CHECK-LD-RT: libclang_rt.builtins-x86_64.a" "-lgcc_s" +// CHECK-LD-RT: libclang_rt.builtins-x86_64.a" // CHECK-LD-RT: "-lc" -// CHECK-LD-RT: libclang_rt.builtins-x86_64.a" "-lgcc_s" +// CHECK-LD-RT: libclang_rt.builtins-x86_64.a" // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ // RUN: --target=arm-linux-androideabi \ @@ -81,9 +81,9 @@ // CHECK-LD-RT-ANDROID: "--eh-frame-hdr" // CHECK-LD-RT-ANDROID: "-m" "armelf_linux_eabi" // CHECK-LD-RT-ANDROID: "-dynamic-linker" -// CHECK-LD-RT-ANDROID: libclang_rt.builtins-arm-android.a" "-lgcc_s" +// CHECK-LD-RT-ANDROID: libclang_rt.builtins-arm-android.a" // CHECK-LD-RT-ANDROID: "-lc" -// CHECK-LD-RT-ANDROID: libclang_rt.builtins-arm-android.a" "-lgcc_s" +// CHECK-LD-RT-ANDROID: libclang_rt.builtins-arm-android.a" // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ // RUN: --target=x86_64-unknown-linux \ -- 2.40.0