[PATCH] D51358: [driver] Do not pass "-flavor old-gnu" option to LLD linker

Simon Atanasyan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 28 07:49:14 PDT 2018

atanasyan created this revision.
atanasyan added reviewers: echristo, ruiu.

The "-flavor old-gnu" option were introduced to enable old version of LLD ELF linker implementation. This option has been removed from the linker since LLD 3.9. I do not think that there is a real case when the latest version of Clang is used in combination with so obsoleted version of LLD linker. Now we can remove support of this option from the driver.

  rC Clang



Index: lib/Driver/ToolChains/Gnu.cpp
--- lib/Driver/ToolChains/Gnu.cpp
+++ lib/Driver/ToolChains/Gnu.cpp
@@ -323,14 +323,6 @@
   // handled somewhere else.
-  const char *Exec = Args.MakeArgString(ToolChain.GetLinkerPath());
-  if (llvm::sys::path::stem(Exec) == "lld") {
-    CmdArgs.push_back("-flavor");
-    CmdArgs.push_back("old-gnu");
-    CmdArgs.push_back("-target");
-    CmdArgs.push_back(Args.MakeArgString(getToolChain().getTripleString()));
-  }
   if (!D.SysRoot.empty())
     CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));
@@ -539,6 +531,7 @@
   AddHIPLinkerScript(getToolChain(), C, Output, Inputs, Args, CmdArgs, JA,
+  const char *Exec = Args.MakeArgString(ToolChain.GetLinkerPath());
   C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51358.162857.patch
Type: text/x-patch
Size: 950 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180828/b9652a20/attachment.bin>

More information about the cfe-commits mailing list