<div dir="ltr">There's the lowRISC project: <a href="https://github.com/lowRISC/riscv-llvm" target="_blank">https://github.com/lowRISC/riscv-llvm</a><div><br></div><div>I'd like to use LLVM RISC-V but reading the FAQ there's this line:</div><div><h3 style="box-sizing:border-box;margin-top:24px;margin-bottom:16px;font-size:1.25em;line-height:1.25;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"">How can I build upstream LLVM+Clang and use it to cross-compile for a riscv32 target?</h3><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:16px">First you will need a built RISC-V gcc toolchain. The linker, compiled libraries, and libc header files will be used. You can build your own by following the instructions at the <a href="https://github.com/riscv/riscv-gnu-toolchain" target="_blank" style="color:rgb(3,102,214);box-sizing:border-box;background-color:transparent;text-decoration-line:none">riscv-gnu-toolchain repo</a>. It is sufficient to do the following:</p><br class="gmail-m_-2388063180680140250gmail-Apple-interchange-newline"></div><div>That's a bit of a waste...</div><div><br></div><div>Why would I build the entire GNU RISC-V toolchain just to build the LLVM toolchain?</div><div><br></div><div>I think that LLVM should have the capabilities use it's own linker, compiled libraries, etc..</div><div><br></div><div>I'd like to find a mentor who I can occasionally ping with a question here or there about certain things while trying to get this up and running.</div><div><br></div><div>A major question that I have that I come across many times with LLVM projects are that they still require GNU headers, why is that?</div><div><br></div><div>I've tracked down the relevant starting place to lib/Driver/ToolChains/*</div><div><br></div><div>Where different linkers are implemented.</div><div><br></div><div>I did see a code review where someone from LLVM wanted to implement risc-v detection code in baremetal instead of creating something new: <a href="https://reviews.llvm.org/D42673" target="_blank">https://reviews.llvm.org/D42673</a></div><div><br></div><div>but looking recently there's the RISC-V headers for Clang:</div><div><a href="http://llvm.org/svn/llvm-project/cfe/trunk/lib/Driver/ToolChains/RISCV.h" target="_blank">http://llvm.org/svn/llvm-project/cfe/trunk/lib/Driver/ToolChains/RISCV.h</a><br></div><div><a href="http://llvm.org/svn/llvm-project/cfe/trunk/lib/Driver/ToolChains/RISCV.cpp" target="_blank">http://llvm.org/svn/llvm-project/cfe/trunk/lib/Driver/ToolChains/RISCV.cpp</a><br></div><div><br></div><div>I'd like to help to get the linker up and running so that I can avoid having to build the entire GNU toolchain to use RISC-V.</div><div><br></div><div>Best,</div><div>Owen</div></div>