================
@@ -455,6 +455,21 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, 
const JobAction &JA,
     addLTOOptions(ToolChain, Args, CmdArgs, Output, Inputs,
                   D.getLTOMode() == LTOK_Thin);
 
+  // Forward the DTLTO options to the linker. We add these unconditionally,
+  // rather than in addLTOOptions() as it is the linker that decides whether to
----------------
bd1976bris wrote:

Apologies - we’ve recently started setting LTO options unconditionally in the 
PS5 driver, and I carried that pattern over here without fully reconsidering 
it. As you pointed out, the issue is broader than just the DTLTO options and 
deserves separate handling.

It’s also unclear whether setting options unconditionally is the right 
long-term approach. An alternative could be to pass a flag to the linker, 
allowing it to emit a warning if LTO is being performed but the Clang driver 
wasn't explicitly invoked in LTO mode.

In any case, I’ve moved the DTLTO option handling into `addLTOOptions` as you 
suggested. Thanks for the guidance.

https://github.com/llvm/llvm-project/pull/147265
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to