Change the directory for target libs

This pushes them down from stageN/lib/rustc/$(target) to
stageN/lib/rustc/$(target)/lib in order to make room for a target bin dir
This commit is contained in:
Brian Anderson 2011-09-30 16:55:18 -07:00
parent e71d17ffa6
commit 821dd6c02c
5 changed files with 24 additions and 13 deletions

View File

@ -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)

14
configure vendored
View File

@ -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

View File

@ -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: $$<)

View File

@ -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)

View File

@ -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]; }