rust-lang / rust-lang/rust

Tracking Issue for `raw_dylib_macho`

Open
#146,356 0 comments 3 reactions 1 assignee View on GitHub

@madsmtm is already working on this.

Since Sep 9, 2025.

A-linkage C-tracking-issue F-raw_dylib O-apple T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

This is a tracking issue for raw-dylib on Mach-O (no RFC, extending RFC 2627)
The feature gate for the issue is #![feature(raw_dylib_macho)].

raw-dylib on Mach-O links against a "Text-Based Stub" file (.tbd)[^tbd], allowing linking against libraries and frameworks that are not present on the host system (for example for cross-compilation scenarios).

See the unstable book (TODO) for example usage. See also https://github.com/rust-lang/rust/issues/58713 and https://github.com/rust-lang/rust/issues/135694.

[^tbd]: This is mostly an implementation detail that makes it nicer to inspect, it's possible to describe the same information in a generated stub .dylib.

About tracking issues

Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Discussion comments will get marked as off-topic or deleted.
Repeated discussions on the tracking issue may lead to the tracking issue getting locked.

Steps
Unresolved Questions
  • Should we allow omitting the verbatim modifier? How well is this supported by dyld?
  • Add some way to specify current-version and compatibility-version.
  • Should these overwrite the SDK, or augment the SDK? Especially relevant for the version fields above, could we make it so that the version is used from the SDK unless specified in Rust?
  • Should we avoid linking an SDK if raw-dylib is the only linkage requested? How would that interact with https://github.com/rust-lang/rust/issues/121293?
  • How do we make libc use this?
Implementation history

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.