cpu/esp32: fix RISC-V ISA for ESP32-C3 with GCC 12.2 #19962
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Contribution description
This PR fixes the RISC-V ISA spec in compiler and linker flags for ESP32-C3 and GCC 12.2.
Earlier versions of the specs and tools subsumed
zicsr
andzifencei
into theI
extension which is no longer the case. Therefore, the RISC-V ISA spec in compiler and linker flags had to be changed from-march=rv32imc
to-march=rv32imc_zicsr_zifencei
.As a consequence floating-point arithmetics and I/O were no longer working with
-march=rv32imc
with GCC 12.2 sinceriscv32-esp-elf/lib/libm_nano.a
was linked instead ofriscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/libm_nano.a
becauseriscv32-esp-elf/lib/rv32imc/ilp32/libm_nano.a
is not existing in the toolchain.Testing procedure
Add a
in the
main
function of any application. Without this PR the application should crash while it should work with this PR.Issues/PRs references