diff --git a/Makefile.in b/Makefile.in index 93d7f7abaa7b..fb6ca8b07dc6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -166,7 +166,12 @@ define SREQ # Destinations of artifacts for target architectures TARGET_ROOT$(1)$(2) = stage$(1)/lib/rustc/$(2) TARGET_BIN$(1)$(2) = $$(TARGET_ROOT$(1)$(2))/bin +# FIXME: Transitional +ifeq ($(1),0) TARGET_LIB$(1)$(2) = $$(TARGET_ROOT$(1)$(2)) +else +TARGET_LIB$(1)$(2) = $$(TARGET_ROOT$(1)$(2))/lib +endif # Destinations of artifacts for the host compiler HOST_ROOT$(1) = stage$(1) diff --git a/configure b/configure index ec73a59f3fd0..dcbe33e00ff4 100755 --- a/configure +++ b/configure @@ -390,17 +390,17 @@ for t in $CFG_TARGET_TRIPLES do for i in 0 1 2 3 do - # old-style "bin" dir - make_dir stage$i - - # new-style bin dir, not yet used + # host bin dir make_dir stage$i/bin - # old-style non-arch libs + # host lib dir make_dir stage$i/lib - # new-style arch-prefixed libs, not yet used - make_dir stage$i/lib/rustc/$t + # target bin dir + make_dir stage$i/lib/rustc/$t/bin + + # target lib dir + make_dir stage$i/lib/rustc/$t/lib done done diff --git a/mk/tests.mk b/mk/tests.mk index 77ff20e5a014..7dae7e6d552f 100644 --- a/mk/tests.mk +++ b/mk/tests.mk @@ -151,7 +151,7 @@ test/rustctest.stage$(2)$$(X): $$(COMPILER_CRATE) $$(COMPILER_INPUTS) \ $$(HOST_LIB$(2))/$$(CFG_RUSTLLVM) \ $$(SREQ$(1)$$(CFG_HOST_TRIPLE)) @$$(call E, compile_and_link: $$@) - $$(STAGE$(1)) -o $$@ $$< --test + $$(STAGE$(1)) -L $$(HOST_LIB$(2)) -o $$@ $$< --test test/rustctest.stage$(2).out.tmp: test/rustctest.stage$(2)$$(X) @$$(call E, run: $$<) diff --git a/src/comp/back/link.rs b/src/comp/back/link.rs index c1d417afa16a..a0c6aac09fd5 100644 --- a/src/comp/back/link.rs +++ b/src/comp/back/link.rs @@ -39,16 +39,23 @@ fn llvm_err(sess: session::session, msg: str) { } else { sess.fatal(msg + ": " + str::str_from_cstr(buf)); } } -fn get_target_lib_path(sess: session::session) -> fs::path { +fn make_target_lib_path(sysroot: fs::path, target_triple: str) -> fs::path { let path = [ - sess.get_opts().sysroot, + sysroot, "lib/rustc", - sess.get_opts().target_triple]; + target_triple, + "lib" + ]; check vec::is_not_empty(path); let path = fs::connect_many(path); ret path; } +fn get_target_lib_path(sess: session::session) -> fs::path { + make_target_lib_path(sess.get_opts().sysroot, + sess.get_opts().target_triple) +} + fn get_target_lib_file_path(sess: session::session, file: fs::path) -> fs::path { fs::connect(get_target_lib_path(sess), file) diff --git a/src/comp/driver/rustc.rs b/src/comp/driver/rustc.rs index 3907f1c3500d..20dfe674fd1e 100644 --- a/src/comp/driver/rustc.rs +++ b/src/comp/driver/rustc.rs @@ -378,8 +378,7 @@ fn build_session_options(binary: str, match: getopts::match) some(s) { s } }; - let library_search_paths = [ - fs::connect(sysroot, "lib/rustc/" + target )]; + let library_search_paths = [link::make_target_lib_path(sysroot, target)]; let lsp_vec = getopts::opt_strs(match, "L"); // FIXME: These should probably go in front of the defaults for lsp: str in lsp_vec { library_search_paths += [lsp]; }