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
Unresolved Questions
Implementation history
Some relevant PRs
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
linkerinrustc_codegen_ssaand maybe other placesself-containeddirectories corresponding to the individual componentsself-containeddirectories to those directoriesrust-lldas linker to usingld.lldthrough the self-contained mechanism-C link-self-contained=+something/yesdoes nothing it should be prohibited or unstable-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.-C link-self-containeddoesn't behave correctly (rust-lld/libunwind/etc are not migrated), it should be prohibited or unstable-C link-self-contained=somethingdoes something it can be allowed and stabilized through an FCP or MCP mechanismself-containeddirectories toscto shorten all the pathsUnresolved Questions
Implementation history
Some relevant PRs
-Clink-self-containedvalues for MCP 510 #96884 (initial design for the component list)-Clink-self-contained=-linkeropt out #116014x86_64-unknown-linux-gnustable #140525