This is what the GCC driver does as well.
This way, ld.bfd can properly handle inputs from a clang LTO build,
without -flto being specified at link time explicitly.
Differential D114229
[clang][driver] Always add LTO options when using GNU toolchain tbaeder on Nov 19 2021, 2:09 AM. Authored by
Details
Diff Detail Event TimelineComment Actions The test failures are pretty obvious about when this fails. All affected builds have an implicit dependency on the LLVMgold.so like this.
This comment was removed by serge-sans-paille. Comment Actions Request changes according to the outstanding comment "But in general I'm not in favor of adding a dependence on having the LTO plugin available to all non-lld links by default." Agree with tejohnson that this looks weird. |
This will add a whole lot of options besides -plugin, which is the only thing guarded against for lld. But in general I'm not in favor of adding a dependence on having the LTO plugin available to all non-lld links by default.