From Gentoo Wiki
Jump to:navigation Jump to:search

Host dev platform

Following are collected information for setting up a typical Arch=amd64 Gentoo Linux to do RISC-V development.

Cross Toolchain

Install the crossdev utils

root #emerge --ask sys-devel/crossdev

Generate cross toolchains, including gcc, glibc, binutils, gdb

root #crossdev --target riscv64-unknown-linux-gnu

Virtual Machine


Install QEMU virtual machine, We need to enable QEMU_USER_TARGETS and QEMU_SOFTMMU_TARGETS, simply edit the variables globally in /etc/portage/make.conf, i.e.:

FILE /etc/portage/make.conf
QEMU_SOFTMMU_TARGETS="riscv32 riscv64"
QEMU_USER_TARGETS="riscv32 riscv64"
root #emerge --ask app-emulation/qemu


Install spike, please find this package in riscv overlay

root #emerge --ask app-emulation/spike

Target Device

These articles are written for describing how to running an ARCH=riscv Gentoo Linux on real RISC-V hardware or virtual machine(VM).