-
Notifications
You must be signed in to change notification settings - Fork 14k
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
- Implement unstable
-Clink-self-containedvalues for MCP 510 #96884 (initial design for the component list) - Implement most of MCP510 #112910 (initial implementation)
- Implement
-Clink-self-contained=-linkeropt out #116014 - Allow target specs to use an LLD flavor, and self-contained linking components #116035
- Document unstable linker flags in the unstable book #119024
- Use lld by default on
x86_64-unknown-linux-gnustable #140525