xv6-riscv
xv6-riscv copied to clipboard
riscv64-linux-gnu-gcc: error: unrecognized command line option ‘-mno-relax’; did you mean ‘-Wno-vla’?
I can't compile on Ubuntu. My procedure was:
git clone ...
sudo apt install pkg-config-riscv64-linux-gnu libstdc++6-7-dbg-riscv64-cross gobjc-riscv64-linux-gnu libgcc-8-dev-riscv64-cross
cd xv6-riscv
make
And I get that gnarly error message.
The next question, if I build, will be how to emulate RISC-V on a lowly x86_64?
Changing the Makefile
to CFLAGS += -ffreestanding -fno-common -nostdlib -Wno-vla
worked, but I feel like a chimp with a machine gun here...
@Phlip Try use riscv64-linux-gnu-gcc with version 8. For emulate RISC-V on a lowly x86_64, you can use qemu.
For quick reference:
sudo apt install gcc-8-riscv64-linux-gnu
sudo apt remove gcc-riscv64-linux-gnu
and then replace CC = $(TOOLPREFIX)gcc
with CC = $(TOOLPREFIX)gcc-8
in the Makefile
quick reference:
sudo apt install gcc-8-riscv64-linux-gnu sudo update-alternatives --install /usr/bin/riscv64-linux-gnu-gcc riscv64-linux-gnu-gcc /usr/bin/riscv64-linux-gnu-gcc-8 8