Skip to content

Commit 568f619

Browse files
committed
Auto merge of #74410 - mati865:mingw-no-self-contained-when-cross-compiling, r=petrochenkov
MinGW: disable self-contained mode when cross compiling When cross compiling users have to provide own linker and libraries anyway. Using rust provided MinGW crt objects is harmful here and has no benefits. cc #68887
2 parents cee62c1 + 08990e5 commit 568f619

File tree

1 file changed

+3
-1
lines changed
  • src/librustc_codegen_ssa/back

1 file changed

+3
-1
lines changed

src/librustc_codegen_ssa/back/link.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1295,7 +1295,9 @@ fn crt_objects_fallback(sess: &Session, crate_type: CrateType) -> bool {
12951295
Some(CrtObjectsFallback::Musl) => sess.crt_static(Some(crate_type)),
12961296
// FIXME: Find some heuristic for "native mingw toolchain is available",
12971297
// likely based on `get_crt_libs_path` (https://github.com/rust-lang/rust/pull/67429).
1298-
Some(CrtObjectsFallback::Mingw) => sess.target.target.target_vendor != "uwp",
1298+
Some(CrtObjectsFallback::Mingw) => {
1299+
sess.host == sess.target.target && sess.target.target.target_vendor != "uwp"
1300+
}
12991301
// FIXME: Figure out cases in which WASM needs to link with a native toolchain.
13001302
Some(CrtObjectsFallback::Wasm) => true,
13011303
None => false,

0 commit comments

Comments
 (0)