Build C firmware that runs directly on a RISC-V microcontroller with no operating system underneath.
Compile Linux applications in C or C++ that run on a RISC-V single-board computer or development board.
Set up a cross-compilation environment on a laptop to produce RISC-V binaries for custom hardware.
Build a multilib toolchain that supports both 32-bit and 64-bit RISC-V targets in one installation.
Requires 8 GB disk, 6.65 GB download, and platform-specific build dependencies, the build can take 30 or more minutes.
This repository contains the GNU compiler toolchain for RISC-V, a type of processor architecture used in everything from microcontrollers to server chips. A compiler toolchain is the collection of programs that translate code you write in C or C++ into machine instructions that a specific processor can actually run. Since RISC-V processors typically run on a different machine than the one you use to write code, this is called a cross-compiler: you build it on your laptop or desktop and use it to produce programs that run on a RISC-V chip elsewhere. The toolchain comes in two main flavors. The first is a bare-metal version built around a small standard library called Newlib, intended for programs that run directly on hardware with no operating system underneath, such as firmware or embedded microcontroller code. The second is a Linux version built around the glibc or musl standard libraries, intended for programs that run on a Linux-based operating system on a RISC-V device. You choose which one to build by running a configure step and then either make or make linux. Building from source takes significant resources: cloning the repository requires about 6.65 GB of network download, the build process downloads an additional 200 MB of upstream sources, and the whole process needs around 8 GB of disk space. The README provides installation commands for Ubuntu, Fedora, Arch Linux, and macOS to install the required build dependencies before starting. The toolchain supports both 32-bit and 64-bit RISC-V targets, and you can build a combined multilib version that handles both in one installation. Configuration options let you choose the target architecture extensions (integer, multiply, float, atomic, and others), the ABI (how function arguments are passed), big-endian targets, and additional languages like Fortran. The README includes troubleshooting notes covering common problems on macOS (which requires a case-sensitive filesystem for the Linux glibc build), on older CentOS systems that ship outdated build tools, and on mixing soft-float and hard-float toolchain builds in the same install directory.
← riscv-collab on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.