The Eclipse Embedded CDT plug-ins for Arm & RISC-V C/C++ developers (formerly known as the GNU MCU Eclipse plug-ins). Includes the archive of previous plug-ins versions, as Releases.
Add _zicsr to the Other extensions settings (Project > Properties > C/C++ Build > Settings > Tool Settings > Target Processor > Other extensions). To be completely correct _zicsr_zidfencei should be added but the zifencei extensions is not relevant for this specific project.
Explanation
As some time in the recent past the RISC-V tools moved from one standard for RISC-V architecture strings to another, a canonical one. This means that what used to simply be specified as, say, rv32gc is now properly specified as rv32gd_zicsr or maybe rv32gc_zicsr_zifencei.
I spoke to @ilg-ul about this and he said that some or all RISC-V project templates will need to be updated to add the required Other extensions project settings to match the latest RISC-V toolchain and ensure that the projects compile and link out of the box. Unfortunately this will mean that newer project templates will not work with older toolchains until the relevant Other extensions are removed from the project settings.
Tools used (on Zorin OS Lite 16.2 - a Ubuntu 20.02 LTS derivative)
Issue
Create an example RISC-V project - SiFive HiFive1 blinky
Try to compile
Compilation fails with the errors below.
Workaround
Add
_zicsr
to the Other extensions settings (Project > Properties > C/C++ Build > Settings > Tool Settings > Target Processor > Other extensions). To be completely correct_zicsr_zidfencei
should be added but thezifencei
extensions is not relevant for this specific project.Explanation
rv32gc
is now properly specified asrv32gd_zicsr
or mayberv32gc_zicsr_zifencei
.