Skip to content

Commit 8d3728f

Browse files
committed
auto merge of #17412 : vadimcn/rust/gccpref, r=alexcrichton
Fixes #17251
2 parents b8599ec + 94f0532 commit 8d3728f

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

src/etc/make-win-dist.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ def make_win_dist(dist_root, target_triple):
5858
for src in rustc_dlls:
5959
shutil.copy(src, dist_bin_dir)
6060

61-
# Copy platform tools (and another copy of runtime dlls) to platform-spcific bin directory
62-
target_bin_dir = os.path.join(dist_root, "bin", "rustlib", target_triple, "bin")
61+
# Copy platform tools to platform-specific bin directory
62+
target_bin_dir = os.path.join(dist_root, "bin", "rustlib", target_triple, "gcc", "bin")
6363
if not os.path.exists(target_bin_dir):
6464
os.makedirs(target_bin_dir)
6565
for src in target_tools:
6666
shutil.copy(src, target_bin_dir)
6767

6868
# Copy platform libs to platform-spcific lib directory
69-
target_lib_dir = os.path.join(dist_root, "bin", "rustlib", target_triple, "lib")
69+
target_lib_dir = os.path.join(dist_root, "bin", "rustlib", target_triple, "gcc", "lib")
7070
if not os.path.exists(target_lib_dir):
7171
os.makedirs(target_lib_dir)
7272
for src in target_libs:

src/librustc/driver/driver.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -560,8 +560,8 @@ pub fn phase_6_link_output(sess: &Session,
560560
trans: &CrateTranslation,
561561
outputs: &OutputFilenames) {
562562
let old_path = os::getenv("PATH").unwrap_or_else(||String::new());
563-
let mut new_path = os::split_paths(old_path.as_slice());
564-
new_path.push_all_move(sess.host_filesearch().get_tools_search_paths());
563+
let mut new_path = sess.host_filesearch().get_tools_search_paths();
564+
new_path.push_all_move(os::split_paths(old_path.as_slice()));
565565
os::setenv("PATH", os::join_paths(new_path.as_slice()).unwrap());
566566

567567
time(sess.time_passes(), "linking", (), |_|

src/librustc/metadata/filesearch.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,12 @@ impl<'a> FileSearch<'a> {
150150
p.push(find_libdir(self.sysroot));
151151
p.push(rustlibdir());
152152
p.push(self.triple);
153-
p.push("bin");
154-
vec![p]
153+
let mut p1 = p.clone();
154+
p1.push("bin");
155+
let mut p2 = p.clone();
156+
p2.push("gcc");
157+
p2.push("bin");
158+
vec![p1, p2]
155159
}
156160
}
157161

0 commit comments

Comments
 (0)