linker: Remove the "--whole-archive
in test mode" backcompat hack
This commit is contained in:
parent
1ddedbaa59
commit
3d2d7cfe18
2 changed files with 2 additions and 13 deletions
|
@ -2568,16 +2568,7 @@ fn add_native_libs_from_crate(
|
|||
NativeLibKind::Static { bundle, whole_archive } => {
|
||||
if link_static {
|
||||
let bundle = bundle.unwrap_or(true);
|
||||
let whole_archive = whole_archive == Some(true)
|
||||
// Backward compatibility case: this can be a rlib (so `+whole-archive`
|
||||
// cannot be added explicitly if necessary, see the error in `fn link_rlib`)
|
||||
// compiled as an executable due to `--test`. Use whole-archive implicitly,
|
||||
// like before the introduction of native lib modifiers.
|
||||
|| (whole_archive == None
|
||||
&& bundle
|
||||
&& cnum == LOCAL_CRATE
|
||||
&& sess.is_test_crate());
|
||||
|
||||
let whole_archive = whole_archive == Some(true);
|
||||
if bundle && cnum != LOCAL_CRATE {
|
||||
if let Some(filename) = lib.filename {
|
||||
// If rlib contains native libs as archives, they are unpacked to tmpdir.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue