================ @@ -535,6 +535,21 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, 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 + // do LTO or not dependent upon whether there are any bitcode input files in + // the link. + if (Arg *A = Args.getLastArg(options::OPT_fthinlto_distributor_EQ)) { + CmdArgs.push_back( + Args.MakeArgString("--thinlto-distributor=" + Twine(A->getValue()))); + CmdArgs.push_back( + Args.MakeArgString("--thinlto-remote-opt-tool=" + + Twine(ToolChain.getDriver().getClangProgramPath()))); + + for (auto A : Args.getAllArgValues(options::OPT_Xthinlto_distributor_EQ)) + CmdArgs.push_back(Args.MakeArgString("-mllvm=-thinlto-distributor-arg=" + A)); ---------------- bd1976bris wrote:
As you already worked out I used `cl::opt` options to minimize the changes to LLD ports and llvm-lto. The syntax is verbose, but LLD is usually invoked via the compiler driver so the verbose syntax is not exposed. I'm happy to use a `cl::opt` for this. However, I would like to retain a retain the LLD options for the COFF port where LLD is often invoked directly. Does that sound ok? https://github.com/llvm/llvm-project/pull/126654 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits