about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2023-02-25 11:53:09 -0800
committerGitHub <noreply@github.com>2023-02-25 11:53:09 -0800
commit1a599d7d97c7ab4b03a75f1405bb19293ea2ca6a (patch)
treea9c4b6d0c3d15586deab0f97608a33141fd65f3b /compiler/rustc_codegen_llvm/src
parenta4119ba0aeb6b32375be85a1f47cfc785b147084 (diff)
parentfde2e40e43b487357fad103beec0ec228b077f61 (diff)
downloadrust-1a599d7d97c7ab4b03a75f1405bb19293ea2ca6a.tar.gz
rust-1a599d7d97c7ab4b03a75f1405bb19293ea2ca6a.zip
Rollup merge of #107675 - jsgf:link-directives, r=davidtwco
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 # #70093, which is currently addressed by `-Zlink-native-libraries` (implemented in #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.

cc `@pcwalton` `@cramertj`
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions