Auto merge of #128400 - petrochenkov:nowhole3, r= · rust-lang/rust@33f1d8b (original) (raw)

File tree

2 files changed

lines changed

2 files changed

lines changed

Original file line number Diff line number Diff line change
@@ -2568,16 +2568,7 @@ fn add_native_libs_from_crate(
2568 2568 NativeLibKind::Static { bundle, whole_archive } => {
2569 2569 if link_static {
2570 2570 let bundle = bundle.unwrap_or(true);
2571 -let whole_archive = whole_archive == Some(true)
2572 -// Backward compatibility case: this can be a rlib (so `+whole-archive`
2573 -// cannot be added explicitly if necessary, see the error in `fn link_rlib`)
2574 -// compiled as an executable due to `--test`. Use whole-archive implicitly,
2575 -// like before the introduction of native lib modifiers.
2576 - |
2577 - && bundle
2578 - && cnum == LOCAL_CRATE
2579 - && sess.is_test_crate());
2580 -
2571 +let whole_archive = whole_archive == Some(true);
2581 2572 if bundle && cnum != LOCAL_CRATE {
2582 2573 if let Some(filename) = lib.filename {
2583 2574 // If rlib contains native libs as archives, they are unpacked to tmpdir.
Original file line number Diff line number Diff line change
@@ -96,9 +96,7 @@ This modifier translates to `--whole-archive` for `ld`-like linkers,
96 96 to `/WHOLEARCHIVE` for `link.exe`, and to `-force_load` for `ld64`.
97 97 The modifier does nothing for linkers that don't support it.
98 98
99 -The default for this modifier is `-whole-archive`. \
100 -NOTE: The default may currently be different in some cases for backward compatibility,
101 -but it is not guaranteed. If you need whole archive semantics use `+whole-archive` explicitly.
99 +The default for this modifier is `-whole-archive`.
102 100
103 101 ### Linking modifiers: `bundle`
104 102