3 ms·
Are there c compilers for the smallest subsets of RISC-V (no floating point, system calls, atomics, etc).
by haberman 7y ago
Are there c compilers for the smallest subsets of RISC-V (no floating point, system calls, atomics, etc).
- fwsgonzo 7y agoYes, when you build this: https://github.com/riscv/riscv-gnu-toolchain https://github.com/riscv/riscv-gnu-toolchain You can configure it with the extensions your system will support. The minimal is RV32I and RV64I. It will be full-length instructions which are easy to parse and no extras. ./configure --prefix=$HOME/riscv --with-arch=rv32i --with-abi=ilp32 I'm sure you can build a C standard library with these options as well, so you won't be as limited as you think. System calls are done through the ECALL instruction, and while it's mandatory, you don't really have to implement it.
- krackers 7y agoThere's risc-v support in the newlib standard library, so it should not be too hard to use that as a starting point even if you need to rip out stuff.