Using -C prefer-dynamic on Apple lipo-able targets results in mismatched libstd load commands

Aperta
#166,660 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
build-system

Direzione di ricerca

Start by reproducing the two cargo build --release commands with RUSTFLAGS="-C prefer-dynamic" for the aarch64-apple-darwin and x86_64-apple-darwin targets. Compare the executables’ libstd load commands and investigate how Rust chooses their dylib names for Apple targets; the report provides no Rust source file or test to begin from. Done means both architectures use compatible load command names so their executables and libstd dylibs can be combined.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

C-bug needs-triage O-apple

I tried this code:

git clone https://gitlab.freedesktop.org/amyspark/dragonfire.git
env RUSTFLAGS="-C prefer-dynamic" cargo build --release --target aarch64-apple-darwin
env RUSTFLAGS="-C prefer-dynamic" cargo build --release --target x86_64-apple-darwin

I expected to see this happen: both dragonfire executables lipo'able together with the respective libstd

Instead, this happened: the dragonfire executables differ in the load commands, as the libstd dylibs have mismatched names. The mismatch will also affect libraries targeting e.g. iOS, iOS simulator, etc. for which we (GStreamer) also ship fat binaries, so we can't ship the libstd dylibs nor their dSYMs and must build stuff the usual way.

I'm not sure if this was intended, so I'm filing this bug to figure things out.

Meta

rustc --version --verbose:

rustc 1.100.0 (0ef1bc386 2026-11-09)
binary: rustc
commit-hash: 0ef1bc386059596dada8fb65b50425aab2ea637a
commit-date: 2026-11-09
host: aarch64-apple-darwin
release: 1.100.0
LLVM version: 23.1.5
Lingua principale
Rust
Stelle
123k
Fork
16.6k
Merge medio
2g 17h
PR unite (30g)
532

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rust-lang/rust

Tutte le issue di rust-lang/rust

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.