The binary files are available from GitHub releases.
The full details of installing the xPack GNU RISC-V Embedded GCC on various platforms are presented in the separate Install page.
To install the latest version available, use:
$ xpm install --global @xpack-dev-tools/riscv-none-embed-gcc@latest
To install this specific version, use:
$ xpm install --global @email@example.com
This release is based on the v2019.08.0 release, and includes the SiFive extensions (like CLIC interrupts and a an even larger multilib set).
The following commits (from sifive/freedom-tools) were used:
- the sifive/riscv-binutils-gdb
sifive-binutils-2.32, commit 03d23d5 from 2 September 2019
- the sifive/riscv-gcc project,
sifive-gcc-8.3.0, commit e195042 from from 7 Aug 2019
- the sifive/riscv-newlib project, the
masterbranch, commit 0d24a86 from 9 July 2019
GDB was upstreamed and does not require SiFive specific patches,
so the current build uses
9b40759 commit from
28 Feb 2019.
The supported libraries are:
$ riscv-none-embed-gcc -print-multi-lib .; rv32e/ilp32e;@march=rv32e@mabi=ilp32e rv32ea/ilp32e;@march=rv32ea@mabi=ilp32e rv32em/ilp32e;@march=rv32em@mabi=ilp32e rv32eac/ilp32e;@march=rv32eac@mabi=ilp32e rv32emac/ilp32e;@march=rv32emac@mabi=ilp32e rv32i/ilp32;@march=rv32i@mabi=ilp32 rv32ia/ilp32;@march=rv32ia@mabi=ilp32 rv32im/ilp32;@march=rv32im@mabi=ilp32 rv32if/ilp32f;@march=rv32if@mabi=ilp32f rv32ifd/ilp32d;@march=rv32ifd@mabi=ilp32d rv32iaf/ilp32f;@march=rv32iaf@mabi=ilp32f rv32iafd/ilp32d;@march=rv32iafd@mabi=ilp32d rv32imaf/ilp32f;@march=rv32imaf@mabi=ilp32f rv32imf/ilp32f;@march=rv32imf@mabi=ilp32f rv32imfd/ilp32d;@march=rv32imfd@mabi=ilp32d rv32iac/ilp32;@march=rv32iac@mabi=ilp32 rv32imac/ilp32;@march=rv32imac@mabi=ilp32 rv32imafc/ilp32f;@march=rv32imafc@mabi=ilp32f rv32imafdc/ilp32d;@march=rv32imafdc@mabi=ilp32d rv64i/lp64;@march=rv64i@mabi=lp64 rv64ia/lp64;@march=rv64ia@mabi=lp64 rv64im/lp64;@march=rv64im@mabi=lp64 rv64if/lp64f;@march=rv64if@mabi=lp64f rv64ifd/lp64d;@march=rv64ifd@mabi=lp64d rv64iaf/lp64f;@march=rv64iaf@mabi=lp64f rv64iafd/lp64d;@march=rv64iafd@mabi=lp64d rv64imf/lp64f;@march=rv64imf@mabi=lp64f rv64imaf/lp64f;@march=rv64imaf@mabi=lp64f rv64iac/lp64;@march=rv64iac@mabi=lp64 rv64imac/lp64;@march=rv64imac@mabi=lp64 rv64imafc/lp64f;@march=rv64imafc@mabi=lp64f rv64imafdc/lp64d;@march=rv64imafdc@mabi=lp64d
Due to an omission in the build scripts, the content of the
libgcovlibrary was mostly empty; the script was fixed and now the library has the expected content.
Due to a bug in the build scripts, the Windows binaries included two
copies of the
docsfolder, one in root and one in the
sharefolder; the script was fixed and now there is only one copy in
Compared to the original SiFive version, the same architecture and API options are supported, and there are minimal functional changes
libglosswas removed from the list of libraries always linked to the application, since it issues
ECALLinstructions that fail in bare metal environments
march=rv32imaf/mabi=ilp32fwas added to the list of multilibs
- the standard documentation, in PDF and HTML, is included
- experimental support for Pyhton in GDB was added
Support for newlib-nano is available using the
--specs=nano.specs option. For better results, this option must be
added to both compile and link time.
If no syscalls are needed,
--specs=nosys.specs can be used at link
time to provide empty implementations for the POSIX system calls.
The libraries are compiled with
-O2 -mcmodel=medany. The nano version is
-mcmodel=medany, otherwise the link will fail.
riscv-none-embed-gdb-pyfails to start on Ubuntu (and possibly other Debian) systems, it fails with a message like:
$ PYTHONHOME=/usr PYTHONPATH=/usr/lib/python2.7 riscv-none-embed-gdb-py --version Traceback (most recent call last): File "/usr/lib/python2.7/site.py", line 554, in <module> main() File "/usr/lib/python2.7/site.py", line 536, in main known_paths = addusersitepackages(known_paths) File "/usr/lib/python2.7/site.py", line 272, in addusersitepackages user_site = getusersitepackages() File "/usr/lib/python2.7/site.py", line 247, in getusersitepackages user_base = getuserbase() # this will also set USER_BASE File "/usr/lib/python2.7/site.py", line 237, in getuserbase USER_BASE = get_config_var('userbase') File "/usr/lib/python2.7/sysconfig.py", line 587, in get_config_var return get_config_vars().get(name) File "/usr/lib/python2.7/sysconfig.py", line 533, in get_config_vars _init_posix(_CONFIG_VARS) File "/usr/lib/python2.7/sysconfig.py", line 417, in _init_posix from _sysconfigdata import build_time_vars File "/usr/lib/python2.7/_sysconfigdata.py", line 6, in <module> from _sysconfigdata_nd import * ImportError: No module named _sysconfigdata_nd
The problem is caused by gdb-py not being able to locate the Python system libraries, split into multiple packages and installed in multiple folders.
The workaround is to pass the Python environment to gdb-py:
PYTHONPATH="$(python -c 'import os; import sys; print(os.pathsep.join(sys.path))')" \ PYTHONHOME="$(python -c 'import sys; print(sys.prefix)')"
The original PDF documentation is available in the
Binaries for Windows, macOS and GNU/Linux are provided.
The binaries were built using the xPack Build Box (XBB), a set of build environments based on slightly older distributions, that should be compatible with most recent systems.
- GNU/Linux: all binaries were built with GCC 7.4, running in a CentOS 6 Docker container
- Windows: all binaries were built with mingw-w64 GCC 7.4, running in a CentOS 6 Docker container
- macOS: most binaries were built with GCC 7.4, running in a separate folder on macOS 10.10.5; GDB cannot be compiled with GCC, so Apple clang was used.
The binaries were testes on Windows 10 Pro 32/64-bit, Ubuntu 18 LTS 64-bit, Xubuntu 18 LTS 32-bit and macOS 10.14.
The tests consist in building and debugging some simple Eclipse projects available in the build project.
Since the source code used for GCC is identical to the one used by SiFive, the long and complex tests performed by SiFive to validate their release were not executed again.
The SHA-256 hashes for the files are:
532f719c11f7311a0103eac6ddd7dd012716a2c3030dd1ee7e64374b1af41d34 xpack-riscv-none-embed-gcc-8.3.0-1.1-darwin-x64.tgz c40d8e74a3f87839131287ecd68be2e691c84af0b75d684c1e47ab60687ff987 xpack-riscv-none-embed-gcc-8.3.0-1.1-linux-x32.tgz 7b95d397a2bd319892f5c930757f7b3bc47acac633dafcf055b0901172513c00 xpack-riscv-none-embed-gcc-8.3.0-1.1-linux-x64.tgz 5d608a0438c5f5c4a2c8b6d4eb13499a60a17618da04fb20972eb0f4965ed4bd xpack-riscv-none-embed-gcc-8.3.0-1.1-win32-x32.zip 10443f00627473f08c44fd00c8011b17c67953d1eb4f1609fb00e5653165d5d3 xpack-riscv-none-embed-gcc-8.3.0-1.1-win32-x64.zip
- GitHub xpack-dev-tools/riscv-none-embed-gcc-xpack
- this release
- all xPack releases
- all GNU MCU Eclipse releases
- individual file counters (grouped per release)
- npmjs.com @xpack-dev-tools/riscv-none-embed-gcc