Up-to-date Prebuilt RISCV GNU toolchain for painless setup. No more build from source everytime. The purpose of this effort is to save time and computer resources for users and a contribution to eco-friendly computing practices.
Prebuilt riscv-gnu-toolchain binaries for x86_64 host running Linux. Built on Ubuntu Latest and tested on Ubuntu 23.10.
This repository makes use of GitHub actions to build the riscv-gnu-toolchain
from source. Just download the prebuilt binaries, add to path and use.
- RV64 Newlib
- RV64GCV
- RV64 Linux
- RV32 Newlib
- Multi-lib Cross Compiler (Baremetal)
- Multi-lib Cross Compiler (Linux)
If you require a custom configuration, consider building yourself or open an Issue with tag:Enhancement
1- Download prebuilt binaries from GitHub Actions > Artifacts
2- Create directory for sources. Preferred /home/usr/
to avoid the possibility of toolchain affecting any of the system files.
$ sudo mkdir /home/usr/riscv # Create a new directory
3- Extract the downloaded file and paste in newly created directory.
$ sudo tar -xzf riscv-toolchain.tar.gz -C /home/usr/riscv/
4- Add Path to your system environment variables
$ nano .bashrc # Open bashrc
$ export PATH=/home/usr/riscv/riscv-toolchain/bin:$PATH # Add the path at the end
5- Save .bashrc
(Ctrl+O, ENTER, Ctrl+X)
6- Apply Changes
$ source .bashrc
7- Add write permissions to the source folder
$ sudo chmod -R +x /home/usr/riscv/riscv-toolchain/
Run the following Command
$ riscv64-unknown-elf-gcc -v
- You should get
Using built-in specs.
COLLECT_GCC=riscv64-unknown-elf-gcc
COLLECT_LTO_WRAPPER=/home/aitesam961/riscv/riscv-toolchain/bin/../libexec/gcc/riscv64-unknown-elf/13.2.0/lto-wrapper
Target: riscv64-unknown-elf
It is highly recommended to install the dependencies mentioned in riscv-gnu-toolchain
readme. It will help avoid getting stuck at several stages if you move forward to building sibling tools.
$ sudo apt-get install autoconf automake autotools-dev curl python3 python3-pip libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev ninja-build git cmake libglib2.0-dev
Congratulations! You have successfully installed the riscv-gnu-toolchain without wasting your system resources.
This project is licensed under the GNU General Public License v3.0 (GPL-3.0), ensuring that it remains open source and freely accessible to all. Feel free to explore, contribute, and use this software in compliance with the terms of the GPL-3.0 license. Embrace the spirit of collaboration and freedom in software development!
Contributions from developers like you make open source a vibrant and innovative space. To contribute to soft-sky-riscv-gcc-prebuilt
, please follow the guidelines outlined in the CONTRIBUTING.md
file. Your efforts are highly valued, and together, we can continue to enhance and improve the project for the entire community.