[PATCH] D158412: [LLD] [MinGW] Pass LLVM specific LTO options through to lld-link

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 25 04:36:42 PDT 2023


mstorsjo added a comment.

In D158412#4615043 <https://reviews.llvm.org/D158412#4615043>, @MaskRay wrote:

> In D158412#4614970 <https://reviews.llvm.org/D158412#4614970>, @mstorsjo wrote:
>
>> @MaskRay How do you feel about backporting a change like this, and the associated one in D158411 <https://reviews.llvm.org/D158411>? It's not a regression fix or something like that, but fairly simple added value.
>
> LGTM for back porting

Actually, I think I'll hold off of backporting this one. My nightly testing uncovered some cases that broke due to this; if I call e.g. `clang -O2 main.c -o out -flto`, it passes `-plugin-opt=O2` which we don't handle yet, and likewise `-flto=thin` passes `-plugin-opt=thinlto`, which also isn't handled (while the ELF linker driver just ignores it).

I tried to look through what LTO options the lld-link interface supports and what options that Clang can end up passing automatically in `addLTOOptions`, and add at least those (the ELF driver supports lots and lots of LTO options, but I didn't try to include all of them yet). I'll send another patch with that soon.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158412/new/

https://reviews.llvm.org/D158412



More information about the llvm-commits mailing list