diff options
| author | Mateusz Mikuła <mati865@gmail.com> | 2020-02-21 15:35:31 +0100 |
|---|---|---|
| committer | Mateusz Mikuła <mati865@gmail.com> | 2020-02-21 15:36:29 +0100 |
| commit | b3b252b401ad133fac6d7ea2b452da921ff7f3b4 (patch) | |
| tree | a340035cdfb78e991c69665b007262c601967af1 | |
| parent | 0176a9eef845e7421b7e2f7ef015333a41a7c027 (diff) | |
| download | rust-b3b252b401ad133fac6d7ea2b452da921ff7f3b4.tar.gz rust-b3b252b401ad133fac6d7ea2b452da921ff7f3b4.zip | |
Fix MinGW detection for Cygwin
| -rw-r--r-- | src/librustc_codegen_ssa/back/link.rs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/librustc_codegen_ssa/back/link.rs b/src/librustc_codegen_ssa/back/link.rs index aaa4448fc19..33036d97dfa 100644 --- a/src/librustc_codegen_ssa/back/link.rs +++ b/src/librustc_codegen_ssa/back/link.rs @@ -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 |
