Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement -Zlink-directives=yes/no #107675

Merged
merged 2 commits into from
Feb 26, 2023
Merged

Implement -Zlink-directives=yes/no #107675

merged 2 commits into from
Feb 26, 2023

Commits on Feb 22, 2023

  1. Implement -Zlink-directives=yes/no

    `-Zlink-directives=no` will ignored `#[link]` directives while compiling a
    crate, so nothing is emitted into the crate's metadata.  The assumption is
    that the build system already knows about the crate's native dependencies
    and can provide them at link time without these directives.
    
    This is another way to address issue # rust-lang#70093, which is currently addressed
    by `-Zlink-native-libraries` (implemented in rust-lang#70095). The latter is
    implemented at link time, which has the effect of ignoring `#[link]`
    in *every* crate. This makes it a very large hammer as it requires all
    native dependencies to be known to the build system to be at all usable,
    including those in sysroot libraries. I think this means its effectively
    unused, and definitely under-used.
    
    Being able to control this on a crate-by-crate basis should make it much
    easier to apply when needed.
    
    I'm not sure if we need both mechanisms, but we can decide that later.
    jsgf committed Feb 22, 2023
    Configuration menu
    Copy the full SHA
    fc5db2c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    fde2e40 View commit details
    Browse the repository at this point in the history