Skip to content

Tracking Issue for fine-grained -C link-self-contained #149175

@petrochenkov

Description

@petrochenkov

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 linker in rustc_codegen_ssa and maybe other places
  • Move all the libraries and binaries to subdirectories of the self-contained directories corresponding to the individual components
  • Move self-contained components not currently living in the self-contained directories 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-lld as linker to using ld.lld through the self-contained mechanism
  • On targets where -C link-self-contained=+something/yes does nothing it should be prohibited or unstable
  • On targets where -C link-self-contained=-something/no does 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-contained doesn't behave correctly (rust-lld/libunwind/etc are not migrated), it should be prohibited or unstable
  • On targets where -C link-self-contained=something does something it can be allowed and stabilized through an FCP or MCP mechanism
  • Perhaps rename self-contained directories to sc to shorten all the paths

Unresolved Questions

  • TBD

Implementation history

  • TODO

Some relevant PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions