================ @@ -524,12 +552,21 @@ void baremetal::Linker::ConstructJob(Compilation &C, const JobAction &JA, const llvm::Triple::ArchType Arch = TC.getArch(); const llvm::Triple &Triple = getToolChain().getEffectiveTriple(); - AddLinkerInputs(TC, Inputs, Args, CmdArgs, JA); + if (!D.SysRoot.empty()) + CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot)); CmdArgs.push_back("-Bstatic"); - if (TC.getTriple().isRISCV() && Args.hasArg(options::OPT_mno_relax)) - CmdArgs.push_back("--no-relax"); + if (Triple.isRISCV()) { + if (Args.hasArg(options::OPT_mno_relax)) + CmdArgs.push_back("--no-relax"); + if (TC.isUsingLD()) { + CmdArgs.push_back("-m"); + CmdArgs.push_back(Arch == llvm::Triple::riscv64 ? "elf64lriscv" + : "elf32lriscv"); + } + CmdArgs.push_back("-X"); + } ---------------- quic-garvgupt wrote:
Done [RISCV] Integrate RISCV target in baremetal toolchain object and deprecate RISCVToolchain object https://github.com/llvm/llvm-project/pull/121831 https://github.com/llvm/llvm-project/pull/121830 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits