r332138 - [Driver] Only use -lc++ on Fuchsia

Petr Hosek via cfe-commits cfe-commits at lists.llvm.org
Fri May 11 13:42:31 PDT 2018


Author: phosek
Date: Fri May 11 13:42:31 2018
New Revision: 332138

URL: http://llvm.org/viewvc/llvm-project?rev=332138&view=rev
Log:
[Driver] Only use -lc++ on Fuchsia

The fact that libc++ depends on libc++abi and libunwind is an internal
detail that's captured by the libc++.so linker script.

Differential Revision: https://reviews.llvm.org/D46768

Modified:
    cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp
    cfe/trunk/test/Driver/fuchsia.cpp

Modified: cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp?rev=332138&r1=332137&r2=332138&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp Fri May 11 13:42:31 2018
@@ -267,8 +267,6 @@ void Fuchsia::AddCXXStdlibLibArgs(const
   switch (GetCXXStdlibType(Args)) {
   case ToolChain::CST_Libcxx:
     CmdArgs.push_back("-lc++");
-    CmdArgs.push_back("-lc++abi");
-    CmdArgs.push_back("-lunwind");
     break;
 
   case ToolChain::CST_Libstdcxx:

Modified: cfe/trunk/test/Driver/fuchsia.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/fuchsia.cpp?rev=332138&r1=332137&r2=332138&view=diff
==============================================================================
--- cfe/trunk/test/Driver/fuchsia.cpp (original)
+++ cfe/trunk/test/Driver/fuchsia.cpp Fri May 11 13:42:31 2018
@@ -15,7 +15,7 @@
 // CHECK-NOT: crti.o
 // CHECK-NOT: crtbegin.o
 // CHECK: "-L[[SYSROOT]]{{/|\\\\}}lib"
-// CHECK: "-lc++" "-lc++abi" "-lunwind" "-lm"
+// CHECK: "-lc++" "-lm"
 // CHECK: "{{.*[/\\]}}libclang_rt.builtins-x86_64.a"
 // CHECK: "-lc"
 // CHECK-NOT: crtend.o
@@ -28,7 +28,7 @@
 // RUN: %clangxx %s -### --target=x86_64-unknown-fuchsia -static-libstdc++ 2>&1 \
 // RUN:     | FileCheck %s -check-prefix=CHECK-STATIC
 // CHECK-STATIC-NOT: "-Bstatic"
-// CHECK-STATIC: "-lc++" "-lc++abi" "-lunwind"
+// CHECK-STATIC: "-lc++"
 // CHECK-STATIC-NOT: "-Bdynamic"
 // CHECK-STATIC: "-lm"
 // CHECK-STATIC: "-lc"




More information about the cfe-commits mailing list