[clang] [LinkerWrapper] Clean up options after proper forwarding (PR #126297)
Nick Sarnie via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 7 12:47:03 PST 2025
================
@@ -9220,13 +9220,24 @@ void LinkerWrapper::ConstructJob(Compilation &C, const JobAction &JA,
for (StringRef Arg : LinkerArgs)
CmdArgs.push_back(Args.MakeArgString(
"--device-linker=" + TC->getTripleString() + "=" + Arg));
+
+ // Forward the LTO mode relying on the Driver's parsing.
+ if (C.getDriver().getOffloadLTOMode() == LTOK_Full)
+ CmdArgs.push_back(Args.MakeArgString(
+ "--device-compiler=" + TC->getTripleString() + "=-flto=full"));
----------------
sarnex wrote:
this ends up getting passed to the `clang` call from `linkDevice`, where we are guaranteed we are not offloading (as in no two-phase compile) and we are compiling for the device offload triple right?
basically im confirming that we never need to pass `-foffload-lto` instead of `-flto`
https://github.com/llvm/llvm-project/pull/126297
More information about the cfe-commits
mailing list