[PATCH] D54112: [Driver] Delete redundant -Bdynamic for libc++ on Fuchsia

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 5 09:14:20 PST 2018


MaskRay created this revision.
MaskRay added reviewers: phosek, EricWF, mcgrathr.
Herald added a subscriber: cfe-commits.

The surrounding --push-state saves the "-Bdynamic" state across ld.bfd, gold and lld.
lld saves the least states, but the intersection of these linkers is --as-needed -Bdynamic --whole-archive

ld/ldlang.h: lang_input_statement_flags::dynamic
gold/options.h: Position_dependent_options::copy_from_options
lld/ELF/Driver.cpp: Stack.emplace_back(Config->AsNeeded, Config->Static, InWholeArchive);


Repository:
  rC Clang

https://reviews.llvm.org/D54112

Files:
  lib/Driver/ToolChains/Fuchsia.cpp
  test/Driver/fuchsia.cpp


Index: test/Driver/fuchsia.cpp
===================================================================
--- test/Driver/fuchsia.cpp
+++ test/Driver/fuchsia.cpp
@@ -39,7 +39,6 @@
 // CHECK-STATIC: "--as-needed"
 // CHECK-STATIC: "-Bstatic"
 // CHECK-STATIC: "-lc++"
-// CHECK-STATIC: "-Bdynamic"
 // CHECK-STATIC: "-lm"
 // CHECK-STATIC: "--pop-state"
 // CHECK-STATIC: "-lc"
Index: lib/Driver/ToolChains/Fuchsia.cpp
===================================================================
--- lib/Driver/ToolChains/Fuchsia.cpp
+++ lib/Driver/ToolChains/Fuchsia.cpp
@@ -127,8 +127,6 @@
         if (OnlyLibstdcxxStatic)
           CmdArgs.push_back("-Bstatic");
         ToolChain.AddCXXStdlibLibArgs(Args, CmdArgs);
-        if (OnlyLibstdcxxStatic)
-          CmdArgs.push_back("-Bdynamic");
         CmdArgs.push_back("-lm");
         CmdArgs.push_back("--pop-state");
       }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54112.172603.patch
Type: text/x-patch
Size: 870 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181105/293b07f7/attachment-0001.bin>


More information about the cfe-commits mailing list