Skip to content

Commit

Permalink
Fix logic for determining prefer-dynamic for a dylib.
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed Mar 11, 2021
1 parent 80c47b7 commit 48e0306
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cargo/core/compiler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ fn build_base_args(
}

let prefer_dynamic = (unit.target.for_host() && !unit.target.is_custom_build())
|| (crate_types.contains(&CrateType::Dylib) && bcx.ws.members().any(|p| *p != unit.pkg));
|| (crate_types.contains(&CrateType::Dylib) && !cx.is_primary_package(unit));
if prefer_dynamic {
cmd.arg("-C").arg("prefer-dynamic");
}
Expand Down

0 comments on commit 48e0306

Please sign in to comment.