1
Fork 0
rust/compiler/rustc_session/src
Michael Goulet 1a599d7d97
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`
2023-02-25 11:53:09 -08:00
..
config Change process spawning to inherit the parent's signal mask by default 2022-10-20 14:53:38 -07:00
cgu_reuse_tracker.rs Remove useless borrows and derefs 2022-12-01 17:34:43 +00:00
code_stats.rs Sort Generator print-type-sizes according to their yield points 2023-02-05 17:34:33 +01:00
config.rs Auto merge of #99679 - repnop:kernel-address-sanitizer, r=cuviper 2023-02-18 03:05:11 +00:00
cstore.rs Use a lock-free datastructure for source_span 2023-02-21 08:38:24 +00:00
errors.rs Rollup merge of #107489 - compiler-errors:non_lifetime_binders, r=cjgillot 2023-02-17 00:19:34 +01:00
filesearch.rs Replace some thens with some then_somes 2023-02-16 15:26:03 +00:00
lib.rs errors: generate typed identifiers in each crate 2023-02-22 09:15:53 +00:00
options.rs link-directives: clarify usage message 2023-02-22 10:34:51 -08:00
output.rs Auto merge of #106810 - oli-obk:resolver_reverse_plumbing, r=petrochenkov 2023-01-19 05:23:40 +00:00
parse.rs various: translation resources from cg backend 2023-02-22 09:15:54 +00:00
search_paths.rs incr. comp.: Don't export impl_stable_hash_via_hash!() and warn about using it. 2022-04-19 10:43:20 +02:00
session.rs various: translation resources from cg backend 2023-02-22 09:15:54 +00:00
utils.rs rustc: Remove needless lifetimes 2022-12-20 22:10:40 +01:00