We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0176a9e commit b3b252bCopy full SHA for b3b252b
src/librustc_codegen_ssa/back/link.rs
@@ -1008,14 +1008,13 @@ fn get_crt_libs_path(sess: &Session) -> Option<PathBuf> {
1008
path.pop();
1009
1010
// 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
1017
1018
+ 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);
+ };
+ }
1019
};
1020
1021
None
0 commit comments