Skip to content

Commit 04c41eb

Browse files
committed
Move bundled gcc and its libs out into $rust/rustlib/<triple>/gcc/(bin|lib). This way the libs won't be on the -L library search path, and won't confuse external gcc, if one is used. The bundled gcc itself will still be able to find them, because it searches for libs relative to own install location.
1 parent 3b6e880 commit 04c41eb

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

Diff for: 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:

Diff for: 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)