rust-lang / rust-lang/rust

Compiling to Apple's `arm64e` got linking error!

Open
#138,481 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-linkage A-LLVM C-external-bug O-macos T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

When compiling to Apple's arm64e targets arm64e-apple-ios arm64e-apple-tvos arm64e-apple-darwin using -Zbuild-stdgot linking error:

linking with `cc` failed: exit status: 1
          rust-lld: error: INVALID relocation has width 8 bytes, but must be 0 bytes at offset 128 of __DATA,__data in /var/folders/r4/ph658m2d3vs0vj00g75q0zyr0000gn/T/rustcj3lmdR/symbols.o
          rust-lld: error: INVALID relocation has width 8 bytes, but must be 0 bytes at offset 0 of __DATA,__data in /var/folders/r4/ph658m2d3vs0vj00g75q0zyr0000gn/T/rustcj3lmdR/symbols.o
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

Rust: 1.87.0-nightly (cbfdf0b01 2025-03-13)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure for the arm64e-apple-ios, arm64e-apple-tvos, or arm64e-apple-darwin targets with -Zbuild-std, using the reported Rust nightly version and linker diagnostics as the baseline. Done means the affected target links successfully without the INVALID relocation errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.