Prebuilt RISC-V GCC toolchains.
The toolchains were built according to the instructions on the official RISC-V GNU Compiler Toolchain page using Ubuntu 20.04 LTS on a 64-bit x86 machine (actually on Ubuntu on Windows). The compressed toolchain archives are available as releases only.
march column below. Keep in mind that – for instance – a rv32imc toolchain only provides library code compiled with compressed and mul/div instructions! Hence, this code cannot be executed (without emulation) on an architecture without these extensions! In contrast, a rv32i toolchain only reuqires the RISC-V I extension.
ℹ️ All toolchains support standard CPU extensions like C (compressed instructions) and M (hardware multiplier and divider).
The GitHub actions worklflow only tests the toolchains (using riscv32-unknown-elf-gcc -v).
🔧 These prebuilt toolchains are used by the NEORV32 Processor project.
Toolchain prefix: riscv32-unknown-elf
| Release (tag) | Download archive | GCC | binutils | march | mabi | clib |
|---|---|---|---|---|---|---|
| rv32i-2.0.0 | 💾 download (.tar.gz) | 10.2.0 |
2.35 |
rv32i |
ilp32 |
newlib |
| rv32e-1.0.0 | 💾 download (.tar.gz) | 10.1.0 |
2.34 |
rv32e |
ilp32e |
newlib |
Click on the according download link in the table above to directly download the archive of choice from the according release page.
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-1.0.0/riscv32-unknown-elf.gcc-10.1.0.rv32i.ilp32.newlib.tar.gz
git clone of the repository will not include the relase assets (= the toolchain archives)!
wget might take a while if you are outside the US. Consider direct downloading via your browser.
Create a folder where you want to install the toolchain, for example /opt/riscv (you will need sudo rights 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 (or add this line to your .bashrc if applicable):
$ export PATH=$PATH:/opt/riscv/bin
Test the toolchain:
$ riscv32-unknown-elf-gcc -v
$ ldd /opt/riscv32i/bin/riscv32-unknown-elf-gcc
linux-vdso.so.1
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6
/lib64/ld-linux-x86-64.so.2
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.
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 recognisable to us. As soon as an infringement of the law becomes known to us, we will immediately remove the link in question.