[PATCH] D39963: [RISCV][RFC] Add initial RISC-V target and driver support

Mandeep Singh Grang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 13 16:29:06 PST 2017


mgrang added inline comments.


================
Comment at: lib/Driver/ToolChains/RISCV.cpp:86
+    CmdArgs.push_back("-lc");
+    CmdArgs.push_back("-lgloss");
+    CmdArgs.push_back("--end-group");
----------------
How about if our sysroot is linux (as opposed to elf)? There won't be any libgloss.a, right? Also there won't be a crt0.o (instead there will be crt1.o).


================
Comment at: lib/Driver/ToolChains/RISCV.h:42
+      : GnuTool("RISCV::Linker",
+                TC.getTriple().isArch64Bit() ? "riscv64-ld" : "riscv32-ld",
+                TC) {}
----------------
johnrusso wrote:
> I wonder if we should construct the linker name based on the default triple value?  "riscv64-unknown-elf-ld" or "riscv32-unknown-elf-ld" as this is likely what is in the user's PATH if they have installed the gnu tools.  The linker name could be modified in ConstructJob if the triple is different from the default.
I agree with @johnrusso . I always have errors: "riscv32-ld not found" and as a workaround I end up creating symlink pointing to the actual <triple>-ld.


https://reviews.llvm.org/D39963





More information about the cfe-commits mailing list