# 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)
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
$$(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: $$<)
} 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)
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]; }