Commit 4b73b18
dev user
target: recognize sh4 architecture in parse_arch()
SH4 (SuperH) is a Rust target tier 3 — sh4-unknown-linux-gnu and
sh4-unknown-redox both exist in upstream rustc as of 1.79+ — but
parse_arch() in cc-rs's target parser doesn't recognise the `sh4`
prefix, so any C-touching crate compiled against an sh4-* target
fails at config time:
error occurred in cc-rs: target `sh4-unknown-redox` had an
unknown architecture
Adding the one-line arm here matches the existing convention for
similar small soft-float architectures (mips, loongarch, riscv, bpf).
SH4 has no architecture-specific compile-flag adjustments needed in
cc-rs (no -march or similar), so just normalising the arch name is
sufficient.
Tested by building rustx-sh4 toolchain (rust-src + LLVM-from-source
with SuperH target) end-to-end against the resulting `cc` 1.2.28+sh4;
output is a working `rustnav-broker` SH4 ELF (6.6 MB) running on
sh4-unknown-redox.1 parent 33f84c5 commit 4b73b18
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
| 171 | + | |
171 | 172 | | |
172 | 173 | | |
173 | 174 | | |
| |||
0 commit comments