[lld] r333793 - ELF: Ignore argument after --plugin.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 1 14:51:21 PDT 2018


Author: pcc
Date: Fri Jun  1 14:51:21 2018
New Revision: 333793

URL: http://llvm.org/viewvc/llvm-project?rev=333793&view=rev
Log:
ELF: Ignore argument after --plugin.

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.

Differential Revision: https://reviews.llvm.org/D47657

Added:
    lld/trunk/test/ELF/ignore-plugin.test
Modified:
    lld/trunk/ELF/Options.td

Modified: lld/trunk/ELF/Options.td
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Options.td?rev=333793&r1=333792&r2=333793&view=diff
==============================================================================
--- lld/trunk/ELF/Options.td (original)
+++ lld/trunk/ELF/Options.td Fri Jun  1 14:51:21 2018
@@ -450,7 +450,7 @@ def plugin_opt_thinlto_prefix_replace_eq
 // 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=">;

Added: lld/trunk/test/ELF/ignore-plugin.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/ignore-plugin.test?rev=333793&view=auto
==============================================================================
--- lld/trunk/test/ELF/ignore-plugin.test (added)
+++ lld/trunk/test/ELF/ignore-plugin.test Fri Jun  1 14:51:21 2018
@@ -0,0 +1,2 @@
+RUN: not ld.lld --plugin foo 2>&1 | FileCheck %s
+CHECK: no input files




More information about the llvm-commits mailing list