Skew between clang and rust's compiler-rt causes linker errors #81808
Labels
A-LLVM
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
C-bug
Category: This is a bug.
T-bootstrap
Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
We're seeing this failure when linking stage0 rustc-main on aarch64-unknown-linux-gnu, with a recent clang built from tip-of-tree:
undefined reference to __aarch64_ldadd8_acq_rel
More information, with some paths elided as
/.../
:It seems rust-lang/llvm-project's compiler-rt doesn't include the out-of-line atomic functions that clang is now emitting by default since D93585.
For now we're going to try to fix this by adding
-mno-outline-atomics
to CFLAGS in config.toml.To prevent this sort of issue in the future, it would be nice if there were an option to drop the
-nodefaultlibs
option to clang and replace it with-nostdlib++ -nolibc
. This would cause "system" clang to use its own compiler runtime instead of the one shipped withrust-lang/llvm-project
.It may even be a good idea to make this the default. It’s unclear why Rust needs to link the
compiler-rt
in its own LLVM tree with code built by the system compiler.cc @tmandry
The text was updated successfully, but these errors were encountered: