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

オープン
#166,660 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rust
領域
build-system

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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
主要言語
Rust
スター
123k
フォーク
16.6k
平均マージ
2日 17時間
マージ済み PR(30日)
532

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

rust-lang/rust のほかの issue

rust-lang/rust の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。