Version v7.1.1-2-20170912-2255 is a new release of GNU MCU Eclipse RISC-V Embedded GCC; after the initial version of the
riscv64-unknown-elf toolchain was released, it was discovered that it was intended more to applications that include a kernel-like environment, and less to bare-metal environments. This second release is intended to provide a temporary fix to this problem and make the toolchain more suitable for embedded bare-metal applications; for this it was necessary to to update to the latest newlib 2.5 release which uses ‘underscore’ syscall functions and to remove the mandatory use of libgloss. Hopefully the official toolchain distribution will follow shortly and use the same approach.
In addition, based on users request, support for a new
march=rv32imaf/mabi=ilp32f library was added.
The current version is based on the following commits:
- the riscv/riscv-gcc project, branch
riscv-gcc-7, commit c95cdca from from Sep 12th, 2017, with a patch to remove the mandatory
libgloss, as commit c95cdca
- the riscv/riscv-binutils-gdb project, branch
riscv-binutils-2.29, commit 60cda8d from Sep 7th, 2017
- the riscv/riscv-newlib project, branch
riscv-newlib-2.5.0, commit bcf3078 from Jul 12th, 2017
The supported architectures (
The supported ABIs (
ilp32f(32-bit with single-precision in registers and double in memory, niche use only)
lp64(64-bit long and pointers, soft-float)
lp64f(64-bit long and pointers, with single-precision in registers and double in memory, niche use only)
lp64d(64-bit long and pointers, hard-float).
The supported libraries are (in parenthesis are combinations that reuse simpler libraries):
march=rv32i/mabi=ilp32 (march.rv32ic/mabi.ilp32) march=rv32im/mabi=ilp32 (march.rv32imc/mabi.ilp32) march=rv32iac/mabi=ilp32 march=rv32imac/mabi=ilp32 march=rv32imaf/mabi=ilp32f <-- New march=rv32imafc/mabi=ilp32f (march.rv32imafdc/mabi.ilp32f, march.rv32gc/mabi.ilp32f) march=rv64imac/mabi=lp64 march=rv64imafdc/mabi=lp64d (march.rv64gc/mabi.lp64d)
Please note that, although all combinations of
march/mabi are supported by the compiler, not all of them have libraries.
Compared to the original RISC-V
riscv64-unknown-elf toolchain, the following improvements can be noted:
- a newer
newlibwas included, which supports the ‘underscore’ syscall functions
- the mandatory reference to
libglossin the linker configuration was removed
march=rv32imaf/mabi=ilp32flibrary was added to the list of multilibs
- support for
- the standard documentation, in PDF and HTML, was added
Currently GNU MCU Eclipse RISC-V Embedded GCC is the only RISC-V toolchain that provides support for newlib-nano, using the
If no syscalls are needed,
--specs=nosys.specs can be used at link time to provide empty implementations for the POSIX system calls.
The nano versions of the libraries are configured with simplified implementations for
malloc(); in addition they are compiled with
-Os, while the regular versions are compiled with
‘Underscore’ newlib syscalls
The initial RISC-V newlib was erroneously configured to directly call system functions via their direct names (like
write()), assuming they are implemented via kernel traps in
The latest newlib 2.5.0 for RISC-V fixed this, and switched to the usual newlib configuration, which uses ‘underscore’ functions (like
_write()) that must be defined by the application to implement the system calls.
This change is welcome, since it brings the RISC-V toolchain in line with other toolchains, like
Unfortunately this change breaks the builds for the initial SiFive SDK samples, which implements the direct function names in the
libwrap library. To fix them,
libwrap should no longer be used, the
--wrap options should no longer be passed to the linker, and several functions (like
_istty(), …) must be implemented by the application.
For RISC-V, this library implements all syscalls via kernel traps; on other platforms (like ARM) it is used for semihosting.
The GNU MCU Eclipse RISC-V Embedded GCC toolchain no longer links automatically
libgloss is still available in the distribution and applications that need to access a kernel can include it using the usual
-lgloss link option.
Another addition compared to the official distribution is the presence of the documentation files, including the PDF manuals for all tools.
Binaries for Windows, macOS and GNU/Linux are provided. For Windows and macOS, separate installable and plain archives are provided. For Windows and GNU/Linux, both 32/64-bit binaries are provided.
Instructions on how to install them are available in the How to install the RISC-V toolchain? page.
For better control and repeatability, the build scripts use Docker containers; all files required during builds are available as a separate gnu-mcu-eclipse/riscv-none-gcc-build project.
The SHA-256 hashes for the files are:
424a4b7bbef59c4fa59e2103760ffc7e809f2d0fff44af80719a98c20d1cf874 ? gnu-mcu-eclipse-riscv-none-gcc-7.1.1-2-20170912-2255-debian32.tgz 8c4b7edcd312dbf3a3dcab975c3237e78e59d96eb5a8342bb4ac5f74a9e7cd53 ? gnu-mcu-eclipse-riscv-none-gcc-7.1.1-2-20170912-2255-debian64.tgz b9dced4d90cd836133aa29071c30659418e8705bb397f29b8b3e6207c1c8e416 ? gnu-mcu-eclipse-riscv-none-gcc-7.1.1-2-20170912-2255-osx.pkg 95c96df560f9fa4e21e9378b7ccbc94ea09bb3a250273a720e90ad3044351f93 ? gnu-mcu-eclipse-riscv-none-gcc-7.1.1-2-20170912-2255-osx.tgz 42a041af9381bc42bc5995b2247ce092c0a6ff2cda0c9e7ec53de26448202f9b ? gnu-mcu-eclipse-riscv-none-gcc-7.1.1-2-20170912-2255-win32-setup.exe c03585471ad042a7033f099e97eb50b965bcc90e134e12891bd6efac9d5d6b7a ? gnu-mcu-eclipse-riscv-none-gcc-7.1.1-2-20170912-2255-win32.zip f0dfb48e2e8612b37ac372af29e034aa43cecafb02f34b92d7ee9f74a16c1052 ? gnu-mcu-eclipse-riscv-none-gcc-7.1.1-2-20170912-2255-win64-setup.exe 543bcdb133ed6ca9157377ae8bee564e385ce5ccc0e46b8b2c5946982f50e864 ? gnu-mcu-eclipse-riscv-none-gcc-7.1.1-2-20170912-2255-win64.zip