Unable to compile rust for riscv32imc-unknown-none-elf with clang 19.0.0git #121371
Labels
C-bug
Category: This is a bug.
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
O-riscv
Target: RISC-V architecture
T-bootstrap
Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
We're running into an issue on Fuchsia where we fail to compile tip-of-tree rust targeting
riscv32imc-unknown-none-elf
while using a nightly build of clang 19.0.0git, which is at the moment:Rust compilation will fail trying to compile
compiler-builtins
with this error:The full build logs can be seen here, with the compilation logs, our config.toml, and our environment variables.
According to that target's spec, it should be using the
riscv32
target with llvm and clang.Tracing through the commits, it appears the compilation failure was introduced in rust-lang/compiler-builtins#563, when
compiler-builtins
added support to fall back tocompiler-rt
for riscv for some intrinsics. However I'm not sure if it's acompiler-builtins
issue. According to the build logs and my investigation, it looks like the rustc build system is explicitly setting setting the environment variable that's being used bycompiler-builtins
when it tries to compile the intrinsics:Unfortunately I haven't been able to figure out yet why rust is using the wrong llvm target here. However, we've figured out a workaround in this patch where we're setting the environment variable to this to use the
--target=riscv32
.Meta
This was compiled against the rust-lang/rust commit 2b43e75.
The text was updated successfully, but these errors were encountered: