-
Notifications
You must be signed in to change notification settings - Fork 13k
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
target arm64e-apple-darwin removing functions #131811
Comments
This is probably #130085. You can try linking using lld or downgrading to XCode 14 or lower. The issue I think this is only happens with the linker of XCode 15. |
@bjorn3 I have xcode 16 btw, issue still exists. I tried using lld but then the output is arm64 not arm64e, and as far as im aware lld does not support arg |
I think your options for now are limited to downgrading to XCode 14 or trying to compile rustc against Apple's LLVM fork (https://github.com/swiftlang/llvm-project). XCode 14 should be compatible with the arm64e abi in upstream LLVM, and using Apple's LLVM fork should make rustc able to emit the new arm64e abi. |
Hey @ds-ep, I believe this is connected to the issue. $ clang --version
Homebrew clang version 19.1.2
Target: x86_64-apple-darwin24.0.0
Thread model: posix
InstalledDir: /usr/local/Cellar/llvm/19.1.2/bin $ echo "int main() { return 0; }" > foo.c
$ clang -o llvm_foo.o -c foo.c --target=arm64e-apple-darwin
$ clang -o llvm_foo llvm_foo.o --target=arm64e-apple-darwin -fuse-ld=lld
$ file llvm_foo
llvm_foo: Mach-O 64-bit executable arm64 So, there are significant differences between Apple's |
This is also the known issue. We have to force using |
For anyone coming across this on MacOS 15 where Xcode 14 is not compatible and will refuse to install. you can download CL tools for xcode 14 here: https://developer.apple.com/download/all/ and use that. |
I tried this code:
I expected to see this happen:
without specifying a target everything works fine (using
cargo +nightly build
)Instead, this happened:
when i specify arm64e-apple-darwin (using:
cargo +nightly build -Z build-std --target arm64e-apple-darwin
) my function seems to be removed.compiling both as dylib
Meta
rustc --version --verbose
:From aarch64-apple-darwin build in ghidra
whereas on the arm64e build there is no functions at all :|
CC @arttet
The text was updated successfully, but these errors were encountered: