I'm using a rv32ima bare metal processor, and I need to use riscv32 for it. I've been struggling to find the right combination of packages to compile for it. The closest I've found was:
apt-get install gcc-multilib gcc-riscv64-unknown-elf
And then executing:
riscv64-unknown-elf-gcc -o test.elf test.c -O1 -march=rv32ima -mabi=ilp32 -nostdlib -T flatfile.lds
In file included from test.c:1:
/usr/lib/gcc/riscv64-unknown-elf/9.3.0/include/stdint.h:9:16: fatal error: stdint.h: No such file or directory
9 | # include_next <stdint.h>
| ^~~~~~~~~~
But, it seems to not have the appropriate headers installed.
Side-note: It also doesn't seem to contain an rv32 libc, and I don't really need it but it wouldn't hurt.
Any recommendations? I'm hoping to make this something easy for other people to build/use. Preferably in the Ubuntu/Linux Mint/Debian world.