6 years of Gentoo and RISC-V! An overview of current support

Published:

Introduction

As the RISC-V ecosystem continues to evolve rapidly, Linux distributions have increasingly adopted it in recent years. Today, with most of the critical software necessary for a functional Linux environment already ported to RISC-V, the architecture has matured to the point where a RISC-V desktop experience is now viable, albeit limited by the lack of more powerful hardware.

With 2025 marking six years since Gentoo Linux officially introduced support for the RISC-V architecture, this blog post will give a brief overview of its history and current state within Gentoo Linux.

Support across Linux Distributions

Below is a quick look at RISC-V support across some of the more popular distributions:

  • Debian: Introduced RISC-V in Debian unstable in 2023, upcoming release of Debian 13 aims to provide full RISC-V support
  • Fedora: Began its first RISC-V bootstrap in 2017 and now provides prebuilt images for virtualization and selected physical hardware.
  • Ubuntu: Introduced official RISC-V support in Ubuntu 23.04, with prebuilt images for several development boards.
  • FreeBSD: The first operating system to have bootable in-tree RISC-V support. It currently supports Spike and QEMU emulator platforms, as well as development boards like the HiFive Unleashed and StarFive VisionFive 2.

RISC-V Support in Gentoo Linux

The first working RISC-V profiles in Gentoo were created in 2019, laying the foundation for RISC-V support. Initially targeting RV64GC and RV64IMAC, support was later extended to RV32 as well. For RV64, both lp64 as well as lp64d ABIs are supported. Today, Gentoo has developed an extensive testing framework, ensuring that all RISC-V packages are validated on physical hardware.

Gentoo also provides ongoing support for RISC-V in crossdev, allowing quick setup of cross-compilation toolchain for various targets. This enables users to build packages for RISC-V while reducing compilation times compared to native compilation. However, some packages may require manual fixes or patches due to the relatively brittle nature of cross compilation. Developers also maintain a dedicated RISC-V overlay, offering experimental support for packages that haven’t been fully ported to RISC-V upstream, such as valgrind, qtwebengine, thunderbird, chromium and others.

Gentoo regularly updates RV64 and RV32 Stage 3 tarballs. It’s a minimal set of prebuilt Gentoo binaries designed to bootstrap a system. It is suitable for both new system installations and containerized environments. Initially only offering 64-bit stages, 32bit ones were also made available in 2024, both using hard-float and soft-float ABI. Additionally, users can choose between different init systems: OpenRC and systemd, as well as a musl-based variant for alternative lightweight libc support.

Device support

Gentoo supports a broad range of RISC-V hardware and can also run in an emulated environment via QEMU. Setting up Gentoo in QEMU is straightforward. Users can either cross-compile a basic root filesystem or simply download a prebuilt Stage 3 and run it directly. For those interested in running Gentoo RISC-V inside of QEMU, detailed setup instructions are available on the Gentoo Wiki.

Gentoo supports various devices, including SiFive’s HiFive Unmatched and Unleashed, StarFive VisionFive 2, MangoPi MQ-Pro, BananaPi BPI-F3, and Milk-V Pioneer , among others. However, prebuilt images for direct flashing and use are not yet available.

With Gentoo’s flexible build system and USE flag mechanism, installations can be customized for any specific need. However, setting up the boot process and configuring the Linux kernel still require considerable manual effort. In many cases, it’s necessary to rely on vendor-supplied kernels and drivers, as upstream support for various SoCs and boards remains a work in progress.

Currently, RISC-V is supported as a Tier-2 architecture in Gentoo, with only unstable keywords available. This means there is no continuous testing of a designated package set, primarily due to the limited availability of high-performance hardware needed for such testing. In future, Gentoo will aim to promote RISC-V to a stable architecture which will ensure a smoother experience for all users.