From e857f5af6a739fe45a25dfb495a535eba3d0fcce Mon Sep 17 00:00:00 2001 From: Petr Hosek Date: Fri, 11 May 2018 20:42:31 +0000 Subject: [PATCH] [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 llvm-svn: 332138 --- clang/lib/Driver/ToolChains/Fuchsia.cpp | 2 -- clang/test/Driver/fuchsia.cpp | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/clang/lib/Driver/ToolChains/Fuchsia.cpp b/clang/lib/Driver/ToolChains/Fuchsia.cpp index 1b22309..cfdb3d8 100644 --- a/clang/lib/Driver/ToolChains/Fuchsia.cpp +++ b/clang/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/clang/test/Driver/fuchsia.cpp b/clang/test/Driver/fuchsia.cpp index cbd08ad..8989071 100644 --- a/clang/test/Driver/fuchsia.cpp +++ b/clang/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" -- 2.7.4