Tracking Issue for fine-grained `-C link-self-contained`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
This is a tracking issue for the unstable parts of the command line option -C link-self-contained=+component1,-component2.
There's no RFC, but some of the feature was stabilized by an FCP for LLD-by-default.
The stable subset is documented in https://doc.rust-lang.org/rustc/codegen-options/index.html#link-self-contained.
The unstable and mostly unimplemented subset is documented in https://doc.rust-lang.org/beta/unstable-book/compiler-flags/codegen-options.html#link-self-contained.
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
- Support other components besides
linkerinrustc_codegen_ssaand maybe other places - Move all the libraries and binaries to subdirectories of the
self-containeddirectories corresponding to the individual components - Move self-contained components not currently living in the
self-containeddirectories to those directories- Move libunwind
- Move mingw linker and C compiler
- Move sanitizers
- Migrate targets using some shipped components without considering the self-contained mechanism to that mechanism
- libunwind on some targets
- linker and C compiler on mingw
- sanitizers everywhere
- Migrate bare-metal targets using
rust-lldas linker to usingld.lldthrough the self-contained mechanism - On targets where
-C link-self-contained=+something/yesdoes nothing it should be prohibited or unstable - On targets where
-C link-self-contained=-something/nodoes nothing and the target behaves correctly with regards to self-contained (rust-lld/libunwind/etc are migrated), it can be allowed and stabilized. - On targets where
-C link-self-containeddoesn't behave correctly (rust-lld/libunwind/etc are not migrated), it should be prohibited or unstable - On targets where
-C link-self-contained=somethingdoes something it can be allowed and stabilized through an FCP or MCP mechanism - Perhaps rename
self-containeddirectories toscto shorten all the paths
Unresolved Questions
- TBD
Implementation history
- TODO
Some relevant PRs
- https://github.com/rust-lang/rust/pull/96884 (initial design for the component list)
- https://github.com/rust-lang/rust/pull/112910 (initial implementation)
- https://github.com/rust-lang/rust/pull/116014
- https://github.com/rust-lang/rust/pull/116035
- https://github.com/rust-lang/rust/pull/119024
- https://github.com/rust-lang/rust/pull/140525
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the stable and unstable documentation for -C link-self-contained, then inspect the rustc_codegen_ssa support mentioned in the checklist and the relevant self-contained target directories. A complete contribution would address one clearly scoped checklist item, with the affected targets behaving consistently and the corresponding documentation updated where needed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 15/100