Skip to content

Commit d95de0d

Browse files
committed
Merge remote-tracking branch 'brson/win32'
2 parents fefdb63 + 17d504e commit d95de0d

File tree

7 files changed

+46
-19
lines changed

7 files changed

+46
-19
lines changed

Makefile.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ export CFG_HOST_TRIPLE
262262
export CFG_LLVM_ROOT
263263
export CFG_ENABLE_MINGW_CROSS
264264
export CFG_PREFIX
265+
export CFG_LIBDIR
265266

266267
######################################################################
267268
# Subprograms
@@ -279,12 +280,12 @@ define SREQ
279280
# Destinations of artifacts for the host compiler
280281
HROOT$(1)_H_$(3) = $(3)/stage$(1)
281282
HBIN$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/bin
282-
HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/lib
283+
HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR)
283284

284285
# Destinations of artifacts for target architectures
285286
TROOT$(1)_T_$(2)_H_$(3) = $$(HLIB$(1)_H_$(3))/rustc/$(2)
286287
TBIN$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/bin
287-
TLIB$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/lib
288+
TLIB$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/$$(CFG_LIBDIR)
288289

289290
# The name of the core and standard libraries used by rustc
290291
ifdef CFG_DISABLE_SHAREDSTD

configure

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,14 @@ do
397397
done
398398
done
399399

400+
# On windows we just store the libraries in the bin directory because
401+
# there's no rpath
402+
CFG_LIBDIR=lib
403+
if [ "$CFG_OSTYPE" = "pc-mingw32" ]
404+
then
405+
CFG_LIBDIR=bin
406+
fi
407+
400408
for h in $CFG_TARGET_TRIPLES
401409
do
402410
for t in $CFG_TARGET_TRIPLES
@@ -407,13 +415,13 @@ do
407415
make_dir $h/stage$i/bin
408416

409417
# host lib dir
410-
make_dir $h/stage$i/lib
418+
make_dir $h/stage$i/$CFG_LIBDIR
411419

412420
# target bin dir
413-
make_dir $h/stage$i/lib/rustc/$t/bin
421+
make_dir $h/stage$i/$CFG_LIBDIR/rustc/$t/bin
414422

415423
# target lib dir
416-
make_dir $h/stage$i/lib/rustc/$t/lib
424+
make_dir $h/stage$i/$CFG_LIBDIR/rustc/$t/$CFG_LIBDIR
417425
done
418426
done
419427

@@ -582,6 +590,7 @@ putvar CFG_HOST_TRIPLE
582590
putvar CFG_TARGET_TRIPLES
583591
putvar CFG_C_COMPILER
584592
putvar CFG_PREFIX
593+
putvar CFG_LIBDIR
585594

586595
# Setting this again because it may have been changed
587596
if [ $CFG_DISABLE_MANAGE_SUBMODULES ]

mk/platform.mk

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,14 @@ endif
108108

109109
CFG_TESTLIB=$(CFG_BUILD_DIR)/$(2)/$(strip \
110110
$(if $(findstring stage0,$(1)), \
111-
stage0/lib, \
111+
stage0/$(CFG_LIBDIR), \
112112
$(if $(findstring stage1,$(1)), \
113-
stage1/lib, \
113+
stage1/$(CFG_LIBDIR), \
114114
$(if $(findstring stage2,$(1)), \
115-
stage2/lib, \
115+
stage2/$(CFG_LIBDIR), \
116116
$(if $(findstring stage3,$(1)), \
117-
stage3/lib, \
118-
)))))/rustc/$(CFG_HOST_TRIPLE)/lib
117+
stage3/$(CFG_LIBDIR), \
118+
)))))/rustc/$(CFG_HOST_TRIPLE)/$(CFG_LIBDIR)
119119

120120
ifdef CFG_UNIXY
121121
CFG_INFO := $(info cfg: unix-y environment)

src/comp/back/rpath.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ fn minimize_rpaths(rpaths: [str]) -> [str] {
191191
#[cfg(target_os = "linux")]
192192
#[cfg(target_os = "macos")]
193193
#[cfg(target_os = "freebsd")]
194-
#[cfg(test)]
195194
mod test {
196195
#[test]
197196
fn test_rpaths_to_flags() {

src/comp/util/filesearch.rs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export pick_file;
1616
export search;
1717
export relative_target_lib_path;
1818
export get_cargo_root;
19+
export libdir;
1920

2021
type pick<T> = block(path: fs::path) -> option::t<T>;
2122

@@ -80,7 +81,7 @@ fn search<T: copy>(filesearch: filesearch, pick: pick<T>) -> option::t<T> {
8081
}
8182

8283
fn relative_target_lib_path(target_triple: str) -> [fs::path] {
83-
["lib", "rustc", target_triple, "lib"]
84+
[libdir(), "rustc", target_triple, libdir()]
8485
}
8586

8687
fn make_target_lib_path(sysroot: fs::path,
@@ -121,6 +122,16 @@ fn get_cargo_root() -> result::t<fs::path, str> {
121122

122123
fn get_cargo_lib_path() -> result::t<fs::path, str> {
123124
result::chain(get_cargo_root()) { |p|
124-
result::ok(fs::connect(p, "lib"))
125+
result::ok(fs::connect(p, libdir()))
125126
}
126-
}
127+
}
128+
129+
// The name of the directory rustc expects libraries to be located.
130+
// On Unix should be "lib", on windows "bin"
131+
fn libdir() -> str {
132+
let libdir = #env("CFG_LIBDIR");
133+
if str::is_empty(libdir) {
134+
fail "rustc compiled without CFG_LIBDIR environment variable";
135+
}
136+
libdir
137+
}

src/etc/snapshot.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ def scrub(b):
2929
"lib/librustrt.dylib",
3030
"lib/librustllvm.dylib"],
3131
"winnt": ["bin/rustc.exe",
32-
"lib/core-*.dll",
33-
"lib/std-*.dll",
34-
"lib/rustc-*.dll",
35-
"lib/rustrt.dll",
36-
"lib/rustllvm.dll"],
32+
"bin/core-*.dll",
33+
"bin/std-*.dll",
34+
"bin/rustc-*.dll",
35+
"bin/rustrt.dll",
36+
"bin/rustllvm.dll"],
3737
"freebsd": ["bin/rustc",
3838
"lib/libcore-*.so",
3939
"lib/libstd-*.so",

src/snapshots.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
S 2012-01-12 23e0d16
2+
winnt-i386 3d21b0cddbfd086afaf6632b2458d8457422ff62
3+
linux-i386 bb6b05e0e91ae51d696ebce299a45f89babccdee
4+
macos-i386 9e835b370db42b480eafab4f8365028f1c5a5197
5+
linux-x86_64 e9372901737124fe6b776101f0877cc13c86252f
6+
macos-x86_64 550d9a1b0fb30e5fc296a833682db15088a6c803
7+
18
S 2012-01-12 44352df
29
winnt-i386 fcb87845b0c80b1fa8b798d319a1bd4aaeaa91d1
310
linux-x86_64 dc84514290cafab43d0e79387931d6c79129b5ac

0 commit comments

Comments
 (0)