Skip to content

Commit

Permalink
Fix MinGW detection for Cygwin
Browse files Browse the repository at this point in the history
  • Loading branch information
mati865 committed Feb 21, 2020
1 parent 0176a9e commit b3b252b
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/librustc_codegen_ssa/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1008,14 +1008,13 @@ fn get_crt_libs_path(sess: &Session) -> Option<PathBuf> {
path.pop();
path.pop();
// Based on Clang MinGW driver
let probe_path = path.join(&mingw_dir).join("lib");
if probe_path.exists() {
return Some(probe_path);
};
let probe_path = path.join(&mingw_dir).join("sys-root/mingw/lib");
if probe_path.exists() {
return Some(probe_path);
};
let probe_paths = vec!["lib", "sys-root/mingw/lib"];
for probe_path in probe_paths {
let probe_path = path.join(&mingw_dir).join(&probe_path);
if probe_path.join("crt2.o").exists() {
return Some(probe_path);
};
}
};
};
None
Expand Down

0 comments on commit b3b252b

Please sign in to comment.