Open XrXr opened 1 month ago
@rustbot modify labels: +regression-from-stable-to-stable +A-linkage
I was able to test https://github.com/rust-lang/compiler-builtins/pull/623 on a local rust build using [patch.crates-io]
and confirm that it solves the link error for ruby. So I'm now more confident to offer it as a potential solution. I'm not sure about the policy around bumping the compiler-builtins
dependency, though.
Also, the change removes one object file from staticlib
outputs, so it gives a small file size benefit even if people are not hitting the link error. 😛
I tried this code:
I expected to see this happen:
The
nm
output shouldn't sayU __builtin_copysignq
, since that's an x86 intrinsic unavailable onaarch64-unknown-linux-gnu
Instead, this happened:
Over in Ruby, because we consume the static archive by partial linking it into an
.o
file first, we've been getting reports of link errors due to this unused object in the archive:It looks like this particular intrinsic comes from a file that isn't included for ARM Windows targets:
https://github.com/rust-lang/compiler-builtins/blob/c04eb9e1afb72bdf943f5e5d77b3812f40526602/build.rs#L537-L539
so in fact it should be completely unused. In the README for
compiler-builtins
, the file is listed under "Unimplemented" and seemingly with no plan for usage:I'm wondering if rust could stop including this object in the archive.
Meta
This is regression that started in
1.78.0
. With1.77.0
the nm output is:and it works fine for ruby.
Issue exists in latest nightly.
rustc --version --verbose
: