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

Đang mở
#166,660 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
build-system

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
Rust
Star
123k
Fork
16.6k
Merge trung bình
2 ngày 17 giờ
Pull request đã merge (30 ngày)
532

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của rust-lang/rust

Tất cả issue của rust-lang/rust

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.