[PATCH] D47657: ELF: Ignore argument after --plugin.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 1 14:43:09 PDT 2018


pcc created this revision.
pcc added a reviewer: ruiu.
Herald added subscribers: arichardson, mehdi_amini, emaste.
Herald added a reviewer: espindola.
Herald added a reviewer: espindola.

Clang passes --plugin /path/to/LLVMgold.so to the linker when -flto is
passed. After r333607 we only ignore --plugin as a joined argument,
which means that the following argument (/path/to/LLVMgold.so) is
interpreted as an input file. This means that either every LTO'd
program ends up being linked with the gold plugin or we error out
if the plugin does not exist.  The fix is to use Eq to ignore both
--plugin=foo and --plugin foo as before.


https://reviews.llvm.org/D47657

Files:
  lld/ELF/Options.td


Index: lld/ELF/Options.td
===================================================================
--- lld/ELF/Options.td
+++ lld/ELF/Options.td
@@ -443,7 +443,7 @@
 // just ignore the option on lld side as it's easier. In fact, the linker could
 // be called 'ld' and understanding which linker is used would require parsing of
 // --version output.
-def plugin: J<"plugin">;
+defm plugin: Eq<"plugin", "Ignored for compatibility with GNU linkers">;
 
 def plugin_opt_fresolution_eq: J<"plugin-opt=-fresolution=">;
 def plugin_opt_pass_through_eq: J<"plugin-opt=-pass-through=">;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47657.149557.patch
Type: text/x-patch
Size: 576 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180601/15316b28/attachment.bin>


More information about the llvm-commits mailing list