-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiling to Apple's arm64e
got linking error!
#138481
Comments
Probably something wrong in rust/compiler/rustc_codegen_ssa/src/back/apple.rs Lines 30 to 111 in f7b4354
|
It seems to be a bug in void foo(void);
extern int bar;
void* foobar[2] = {
(void*)foo,
(void*)&bar,
};
int main() {
return 0;
} Fails when linking with $ clang -target arm64e-apple-macosx -fuse-ld=$HOME/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/bin/gcc-ld/ld64.lld foo.c
rust-lld: warning: directory not found for option -L/usr/local/lib
rust-lld: error: INVALID relocation has width 8 bytes, but must be 0 bytes at offset 0 of __DATA,__data in /var/folders/0j/tk3sfgz540712zgqd1hrry0m0000gn/T/foo-e172f0.o
rust-lld: error: undefined symbol: bar
>>> referenced by /var/folders/0j/tk3sfgz540712zgqd1hrry0m0000gn/T/foo-e172f0.o:(symbol foobar+0x8)
clang: error: linker command failed with exit code 1 (use -v to see invocation) |
Fundamentally because We could "fix" this in @rustbot label +A-llvm +A-linkage -S-needs-repro -needs-triage |
When compiling to Apple's
arm64e
targetsarm64e-apple-ios
arm64e-apple-tvos
arm64e-apple-darwin
using-Zbuild-std
got linking error:Rust: 1.87.0-nightly (cbfdf0b 2025-03-13)
The text was updated successfully, but these errors were encountered: