r346107 - [Driver] Use -Bstatic/dynamic for libc++ on Fuchsia
Petr Hosek via cfe-commits
cfe-commits at lists.llvm.org
Sun Nov 4 14:38:47 PST 2018
Author: phosek
Date: Sun Nov 4 14:38:47 2018
New Revision: 346107
URL: http://llvm.org/viewvc/llvm-project?rev=346107&view=rev
Log:
[Driver] Use -Bstatic/dynamic for libc++ on Fuchsia
-static relies on lld's behavior, but -Bstatic/dynamic is supported
across all linkers.
Differential Revision: https://reviews.llvm.org/D54082
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=346107&r1=346106&r2=346107&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp Sun Nov 4 14:38:47 2018
@@ -125,8 +125,10 @@ void fuchsia::Linker::ConstructJob(Compi
CmdArgs.push_back("--push-state");
CmdArgs.push_back("--as-needed");
if (OnlyLibstdcxxStatic)
- CmdArgs.push_back("-static");
+ CmdArgs.push_back("-Bstatic");
ToolChain.AddCXXStdlibLibArgs(Args, CmdArgs);
+ if (OnlyLibstdcxxStatic)
+ CmdArgs.push_back("-Bdynamic");
CmdArgs.push_back("-lm");
CmdArgs.push_back("--pop-state");
}
Modified: cfe/trunk/test/Driver/fuchsia.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/fuchsia.cpp?rev=346107&r1=346106&r2=346107&view=diff
==============================================================================
--- cfe/trunk/test/Driver/fuchsia.cpp (original)
+++ cfe/trunk/test/Driver/fuchsia.cpp Sun Nov 4 14:38:47 2018
@@ -37,8 +37,9 @@
// RUN: | FileCheck %s -check-prefix=CHECK-STATIC
// CHECK-STATIC: "--push-state"
// CHECK-STATIC: "--as-needed"
-// CHECK-STATIC: "-static"
+// CHECK-STATIC: "-Bstatic"
// CHECK-STATIC: "-lc++"
+// CHECK-STATIC: "-Bdynamic"
// CHECK-STATIC: "-lm"
// CHECK-STATIC: "--pop-state"
// CHECK-STATIC: "-lc"
More information about the cfe-commits
mailing list