xPack GNU RISC-V Embedded GCC v8.3.0-1.1 released
Version 8.3.0-1.1 is a new release of the xPack GNU RISC-V Embedded GCC, following SiFive release from August 2019.
Download
The binary files are available from GitHub Releases.
Install
The full details of installing the xPack GNU RISC-V Embedded GCC on various platforms are presented in the project README.
Compliance
Starting with v8.2.0-2, this distribution closely follows the official SiFive Freedom Tools distribution.
This release is based on the v2019.08.0 release, and includes the SiFive extensions (like CLIC interrupts and a an even larger multi-lib set).
The following commits (from sifive/freedom-tools) were used:
- the sifive/riscv-binutils-gdb
project, branch
sifive-binutils-2.32
, commit 03d23d5 from 2 September 2019 - the sifive/riscv-gcc project,
branch
sifive-gcc-8.3.0
, commit e195042 from from 7 Aug 2019 - the sifive/riscv-newlib project, the
master
branch, commit 0d24a86 from 9 July 2019
GDB was upstreamed and does not require SiFive specific patches,
so the current build uses
git://sourceware.org/git/binutils-gdb.git
, the 9b40759
commit from
28 Feb 2019.
Supported libraries
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
Bug fixes
- [#3]
Due to an omission in the build scripts, the content of the
libgcov
library was mostly empty; the script was fixed and now the library has the expected content. - [#4]
Due to a bug in the build scripts, the Windows binaries included two
copies of the
docs
folder, one in root and one in theshare
folder; the script was fixed and now there is only one copy inshare/docs
.
Improvements
Compared to the original SiFive version, the same architecture and API options are supported, and there are minimal functional changes
libgloss
was removed from the list of libraries always linked to the application, since it issuesECALL
instructions that fail in bare metal environmentsmarch=rv32imaf/mabi=ilp32f
was added to the list of multi-libs- the standard documentation, in PDF and HTML, is included
- experimental support for Python in GDB was added
newlib-nano
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.
nosys.specs
If no syscalls are needed, --specs=nosys.specs
can be used at link
time to provide empty implementations for the POSIX system calls.
Compile options
The libraries are compiled with -O2 -mcmodel=medany
. The nano version is
compiled with -Os -mcmodel=medany
.
It is mandatory for the applications to
be compiled with
-mcmodel=medany
, otherwise the link will fail." %}
Known problems
- [#5]
the
riscv-none-embed-gdb-py
fails 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)')"
Documentation
The original PDF documentation is available in the share/doc
folder.