Skip to content

Commit 08990e5

Browse files
committed
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.
1 parent 6ee1b62 commit 08990e5

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)