From: Petr Hosek Date: Fri, 11 May 2018 20:42:31 +0000 (+0000) Subject: [Driver] Only use -lc++ on Fuchsia X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=01b0b85e241d03e52ad26f2048fce3b4eca43c0f;p=clang [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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332138 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/ToolChains/Fuchsia.cpp b/lib/Driver/ToolChains/Fuchsia.cpp index 1b22309728..cfdb3d80a5 100644 --- a/lib/Driver/ToolChains/Fuchsia.cpp +++ b/lib/Driver/ToolChains/Fuchsia.cpp @@ -267,8 +267,6 @@ void Fuchsia::AddCXXStdlibLibArgs(const ArgList &Args, 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: diff --git a/test/Driver/fuchsia.cpp b/test/Driver/fuchsia.cpp index cbd08adb44..8989071cec 100644 --- a/test/Driver/fuchsia.cpp +++ b/test/Driver/fuchsia.cpp @@ -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"