Skip to content

Commit b3b252b

Browse files
committed
Fix MinGW detection for Cygwin
1 parent 0176a9e commit b3b252b

File tree

1 file changed

+7
-8
lines changed
  • src/librustc_codegen_ssa/back

1 file changed

+7
-8
lines changed

src/librustc_codegen_ssa/back/link.rs

+7-8
Original file line numberDiff line numberDiff line change
@@ -1008,14 +1008,13 @@ fn get_crt_libs_path(sess: &Session) -> Option<PathBuf> {
10081008
path.pop();
10091009
path.pop();
10101010
// Based on Clang MinGW driver
1011-
let probe_path = path.join(&mingw_dir).join("lib");
1012-
if probe_path.exists() {
1013-
return Some(probe_path);
1014-
};
1015-
let probe_path = path.join(&mingw_dir).join("sys-root/mingw/lib");
1016-
if probe_path.exists() {
1017-
return Some(probe_path);
1018-
};
1011+
let probe_paths = vec!["lib", "sys-root/mingw/lib"];
1012+
for probe_path in probe_paths {
1013+
let probe_path = path.join(&mingw_dir).join(&probe_path);
1014+
if probe_path.join("crt2.o").exists() {
1015+
return Some(probe_path);
1016+
};
1017+
}
10191018
};
10201019
};
10211020
None

0 commit comments

Comments
 (0)