Home

Awesome

Prebuilt RISC-V GCC Toolchains for Linux

Test_Toolchains license

The toolchains were built according to the instructions of the official RISC-V GNU Compiler Toolchain repository using Ubuntu on a 64-bit x86 machine (actually on Ubuntu on Windows). The provided toolchains support all ratified and implemented ISA extensions (e.g. A and Zicsr). These prebuilt toolchains are part of the NEORV32 RISC-V Processor project.

[!NOTE] Platform-specific instructions for building the toolchain from scratch can be found in NEORV32 UG: Building The Toolchain From Scratch

Available Toolchains

Toolchain prefix: riscv32-unknown-elf or riscv64-unknown-elf (see the individual releases)

StatusRelease (tag)DownloadGCCbinutilsmarchmabic-lib
:green_circle:rv32e-231223:floppy_disk: download13.2.02.41rv32eilp32enewlib
:green_circle:rv32i-131023:floppy_disk: download13.2.02.41rv32iilp32newlib
:red_circle:rv32i-4.0.0:floppy_disk: download12.1.02.39rv32iilp32newlib

:green_circle: active / recommended, :red_circle: outdated

Download

[!WARNING] Cloning this repository (via git clone) will not include the release assets and will not include the actual toolchain archives! The compressed toolchain archives (.tar.gz) are available as releases assets only.

Via Browser

Click on the according download link in the table above to directly download the archive of choice from the according release page via the release assets.

Via Command Line

You can use wget to directly download a toolchain archive from the table above. Select the toolchain of choice, right-click on the "download" link, click "copy link address" and use that as argument for wget. Example:

wget https://github.com/stnolting/riscv-gcc-prebuilt/releases/download/rv32i-4.0.0/riscv32-unknown-elf.gcc-12.1.0.tar.gz

Installation

Create a folder where you want to install the toolchain, for example /opt/riscv (you might need sudo to create this folder and copy data to it).

$ sudo mkdir /opt/riscv

Navigate to the download folder. Decompress your toolchain (replace TOOLCHAIN with your toolchain archive of choice). Again, you might have to use sudo if your target directory is protected.

$ sudo tar -xzf TOOLCHAIN.tar.gz -C /opt/riscv/

Now add the toolchain's bin folder to your system's PATH environment variable. Your can also add this line to your .bashrc if applicable.

$ export PATH=$PATH:/opt/riscv/bin

Test the toolchain:

$ riscv32-unknown-elf-gcc -v
Using built-in specs.
COLLECT_GCC=riscv32-unknown-elf-gcc
COLLECT_LTO_WRAPPER=/opt/riscv/libexec/gcc/riscv32-unknown-elf/12.1.0/lto-wrapper
Target: riscv32-unknown-elf
Configured with: /tmp/rv_gcc/riscv-gnu-toolchain/gcc/configure --target=riscv32-unknown-elf --prefix=/opt/riscv --disable-shared --disable-threads --enable-languages=c,c++ --with-pkgversion=g1ea978e3066 --with-system-zlib --enable-tls --with-newlib --with-sysroot=/opt/riscv/riscv32-unknown-elf --with-native-system-header-dir=/include --disable-libmudflap --disable-libssp --disable-libquadmath --disable-libgomp --disable-nls --disable-tm-clone-registry --src=/tmp/rv_gcc/riscv-gnu-toolchain/gcc --disable-multilib --with-abi=ilp32 --with-arch=rv32i --with-tune=rocket --with-isa-spec=2.2 'CFLAGS_FOR_TARGET=-Os   -mcmodel=medlow' 'CXXFLAGS_FOR_TARGET=-Os   -mcmodel=medlow'
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 12.1.0 (g1ea978e3066)

License

This project is released under the GPL-2.0 license. No copyright infringement intended. Other implied or used projects might have different licensing - see their documentation to get more information.

Limitation of Liability for External Links

Our website contains links to the websites of third parties ("external links"). As the content of these websites is not under our control, we cannot assume any liability for such external content. In all cases, the provider of information of the linked websites is liable for the content and accuracy of the information provided. At the point in time when the links were placed, no infringements of the law were recognizable to us. As soon as an infringement of the law becomes known to us, we will immediately remove the link in question.