There’s the lowRISC project: https://github.com/lowRISC/riscv-llvm
I’d like to use LLVM RISC-V but reading the FAQ there’s this line:
How can I build upstream LLVM+Clang and use it to cross-compile for a riscv32 target?
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 riscv-gnu-toolchain repo. It is sufficient to do the following:
That’s a bit of a waste…
Why would I build the entire GNU RISC-V toolchain just to build the LLVM toolchain?
I think that LLVM should have the capabilities use it’s own linker, compiled libraries, etc…
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.
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?
I’ve tracked down the relevant starting place to lib/Driver/ToolChains/*
Where different linkers are implemented.
I did see a code review where someone from LLVM wanted to implement risc-v detection code in baremetal instead of creating something new: https://reviews.llvm.org/D42673
but looking recently there’s the RISC-V headers for Clang:
http://llvm.org/svn/llvm-project/cfe/trunk/lib/Driver/ToolChains/RISCV.h
http://llvm.org/svn/llvm-project/cfe/trunk/lib/Driver/ToolChains/RISCV.cpp
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.
Best,
Owen