8000 cpu/esp32: fix RISC-V ISA for ESP32-C3 with GCC 12.2 by gschorcht · Pull Request #19962 · RIOT-OS/RIOT · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

cpu/esp32: fix RISC-V ISA for ESP32-C3 with GCC 12.2 #19962

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 2, 2023

Conversation

gschorcht
Copy link
Contributor

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 and zifencei into the I 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 since riscv32-esp-elf/lib/libm_nano.a was linked instead of riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/libm_nano.a because riscv32-esp-elf/lib/rv32imc/ilp32/libm_nano.a is not existing in the toolchain.

Testing procedure

Add a

#include <math.h>
...
printf("sin(x): %f\n", sin(1.0f));

in the main function of any application. Without this PR the application should crash while it should work with this PR.

Issues/PRs references

@github-actions github-actions bot added Platform: ESP Platform: This PR/issue effects ESP-based platforms Area: cpu Area: CPU/MCU ports labels Oct 1, 2023
@gschorcht gschorcht added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Oct 1, 2023
@gschorcht gschorcht requested a review from maribu October 1, 2023 23:42
@gschorcht gschorcht force-pushed the cpu/esp32c3/fix_isa_flags branch from c6f8152 to 9a49dcd Compare October 1, 2023 23:44
@riot-ci
Copy link
riot-ci commented Oct 2, 2023

Murdock results

✔️ PASSED

9a49dcd cpu/esp32: fix RISC-V ISA for ESP32-C3 with GCC 12.2

Success Failures Total Runtime
7937 0 7937 15m:36s

Artifacts

@maribu
Copy link
Member
maribu commented Oct 2, 2023

bors merge

@bors
Copy link
Contributor
bors bot commented Oct 2, 2023

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot merged commit b8e415c into RIOT-OS:master Oct 2, 2023
@gschorcht
Copy link
Contributor Author

@maribu Thanks.

@gschorcht gschorcht deleted the cpu/esp32c3/fix_isa_flags branch October 2, 2023 10:30
@MrKevinWeiss MrKevinWeiss added this to the Release 2023.10 milestone Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: cpu Area: CPU/MCU ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ESP Platform: This PR/issue effects ESP-based platforms Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0