[lld] r263862 - [LTO] Ignore -plugin/-plugin-opt options.

James Molloy via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 19 12:05:03 PDT 2016


Hi Davide,

-plugin-opt is passed when the user attempts to change the LTO behaviour -
for example overriding the codegen option level, or passing a backend
option to LLVM. It being ignored silently will surely cause much head
scratching down the line.

Can we at least get a diagnostic with the intended alternative listed?

Cheers,

James

On Sat, 19 Mar 2016 at 01:45 Davide Italiano via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: davide
> Date: Fri Mar 18 19:40:09 2016
> New Revision: 263862
>
> URL: http://llvm.org/viewvc/llvm-project?rev=263862&view=rev
> Log:
> [LTO] Ignore -plugin/-plugin-opt options.
>
> This is required to get 'clang -flto' to work transparently
> with lld. Please refer to the short comment in the code
> for a more detailed explanation.
>
> 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=263862&r1=263861&r2=263862&view=diff
>
> ==============================================================================
> --- lld/trunk/ELF/Options.td (original)
> +++ lld/trunk/ELF/Options.td Fri Mar 18 19:40:09 2016
> @@ -181,6 +181,16 @@ def end_group_paren: Flag<["-"], ")">;
>  def start_group : Flag<["--"], "start-group">;
>  def start_group_paren: Flag<["-"], "(">;
>
> +// Ignore LTO plugin-related options.
> +// clang -flto passes -plugin and -plugin-opt to the linker. This is
> required
> +// for ld.gold and ld.bfd to get LTO working. But it's not for lld which
> doesn't
> +// rely on a plugin. Instead of detecting which linker is used on clang
> side we
> +// 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 : Separate<["-"], "plugin">;
> +def plugin_opt : Joined<["-"], "plugin-opt=">;
> +
>  // Options listed below are silently ignored for now for compatibility.
>  def fatal_warnings : Flag<["--"], "fatal-warnings">;
>  def no_add_needed : Flag<["--"], "no-add-needed">;
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160319/c012b9eb/attachment.html>


More information about the llvm-commits mailing list