Commit 65d17bc
committed
fix(esp32c3): skip atomic.c and use correct -march to avoid illegal instructions
Problem:
- ESP32-C3 only supports RV32IMC (no A extension for atomic operations)
- Using -march=rv32imac generates unsupported atomic instructions
- Including atomic.c causes compilation failure due to missing hardware support
Solution:
- Create riscv32-esp.json as base config for ESP RISC-V chips
- Use llvm-target "riscv32-esp-elf" to identify ESP targets
- Change -march from rv32imac to rv32imc for ESP targets
- Conditionally exclude atomic.c for ESP targets in compiler-rt
This fix applies to all ESP32-C3 variants through inheritance:
- esp32c3
- esp32c3-supermini
- m5stamp-c3
- esp32-c3-devkit-rust-1
- esp-c3-32s-kit
- esp32c3-12f
Reference: ESP-IDF uses riscv32-esp-elf as official target triple1 parent 4c2df66 commit 65d17bc
File tree
4 files changed
+18
-6
lines changed- internal/crosscompile
- compile/rtlib
- targets
4 files changed
+18
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
21 | 25 | | |
22 | 26 | | |
23 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
531 | 531 | | |
532 | 532 | | |
533 | 533 | | |
534 | | - | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
535 | 543 | | |
536 | 544 | | |
537 | 545 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
0 commit comments