Getting Started with xPack GNU RISC-V Embedded GCC
Overview
xPack GNU RISC-V Embedded GCC is a standalone cross-platform (Windows, macOS, GNU/Linux) binary distribution of GNU RISC-V Embedded GCC, intended for reproducible builds.
GNU RISC-V Embedded GCC is the RISC-V cross-compiler variant of the GNU Compiler Collection, an open source project maintained by the Free Software Foundation.
In this context, embedded refers exclusively to bare-metal systems, not embedded Linux, which necessitates a different toolchain for building Linux user space applications.
The open source xPack GNU RISC-V Embedded GCC project is hosted on GitHub as
xpack-dev-tools/riscv-none-elf-gcc-xpack
;
it provides the platform specific binaries as
release assets.
In addition to the binary archives and the package metadata, this project also includes the build scripts.
This project replaces the deprecated
xpack-dev-tools/riscv-none-embed-gcc-xpack
project, which followed the
SiFive releases;
in order to have access to further versions,
it is recommended to update your projects.
Features
All binaries are:
- self-contained (include all required libraries)
- file-system relocatable (can be installed in any location)
- built on slightly older systems (to make them run on both old and new systems)
Compatibility with older systems
Given that most operating systems maintain significant compatibility with older versions, building an application on an older system ensures that the same binary can run on newer versions. Conversely, building an application on a newer system may utilize library features that are not available in older versions, making backward compatibility less feasible.
Benefits
The main advantages of using the xPack GNU RISC-V Embedded GCC are:
- a convenient, uniform and portable install/uninstall/upgrade procedure; the same procedure is used for all major platforms (x64 Windows, x64 macOS, arm64 macOS, x64 GNU/Linux, arm64 GNU/Linux, arm GNU/Linux)
- multiple versions of the same package can be installed at the same time on the same system
- no need to worry about dependent libraries, all are included
- significantly lighter and easier to use than Docker images that provide similar functionality and are GNU/Linux centric
- projects can be tied to specific tools versions; this provides a good reproducibility, especially useful in CI/CD environments.
Compatibility
The xPack GNU RISC-V Embedded GCC project is fully compatible with the upstream
riscv32-*-elf
and riscv64-*-elf
variants of the
upstream GCC.
Install
The binaries can be installed automatically as binary xPacks or manually as portable archives.
The details of installing the xPack GNU RISC-V Embedded GCC on various platforms are presented in the Install Guide.
Documentation
Documentation
The original GNU RISC-V Embedded GCC documentation is available from the GCC project web site:
Release schedule
This distribution generally follows the official GCC release timeline.
For each major version there are 2 releases, like 14.1 in the first part of the year (tentatively April-May) and 14.2 in the second part (tentatively in August-September).
Previous versions are maintained for 3 more years, and, around midyear, GNU releases updates for the previous 3 versions, (like 13.3, 12.4, 11.5).
Support & feedback
The quick advice for getting support and providing feedback is to use the GitHub Discussions.
For additional information, please refer to the Help Centre page.
Change log
The release and change log is available in the repository
CHANGELOG.md
file.
Maintainer & Developer information
For information on the workflow used to make releases, please see the Maintainer Info page.
For information on how to build the binaries, please see the Developer Info page.
However, the ultimate source for details are the build scripts themselves,
all available from the
riscv-none-elf-gcc-xpack.git/build-assets/scripts
folder. The scripts include common code from the @xpack-dev-tools/xbb-helper
package.
License
Unless otherwise stated, the original content is released under the terms of the MIT License, with all rights reserved to Liviu Ionescu.
The binary distributions include several open-source components; the
corresponding licenses are available in each archive in the
distro-info/licenses
folder.
Releases
The list of releases is available in the Releases pages.