about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJakub Bukaj <jakub@jakub.cc>2014-11-23 14:11:47 -0500
committerJakub Bukaj <jakub@jakub.cc>2014-11-23 14:11:47 -0500
commitf90471e4e31747533ae37712ad5841dce5bbd5d7 (patch)
tree77d8bf92a62ed573c15d67d28a76af8acae139ef
parent220b99b148559e8996a1dbd279e8ca190bf94b2e (diff)
parent12749fc8ec3f110d3fb8057b955c7fab98f85730 (diff)
rollup merge of #19161: jmesmon/mk-fixes
This is a collection of misc issues I've run into while adding bindir & libdir support that aren't really bindir & libdir specific.

While I continue to fiddle with bindir and libdir bugs, I figured these might be useful for others to have merged.
-rwxr-xr-xconfigure5
-rw-r--r--mk/main.mk7
-rw-r--r--mk/rt.mk2
-rw-r--r--mk/stage0.mk2
-rw-r--r--mk/target.mk2
-rw-r--r--src/librustdoc/core.rs3
6 files changed, 9 insertions, 12 deletions
diff --git a/configure b/configure
index 8a6ba86dd47..8ca2e2b5b5e 100755
--- a/configure
+++ b/configure
@@ -711,11 +711,6 @@ then
     fi
     step_msg "using rustc at: ${CFG_LOCAL_RUST_ROOT} with version: $LRV"
     putvar CFG_LOCAL_RUST_ROOT
-else
-    if [ ! -z "$CFG_LOCAL_RUST_ROOT" ]
-    then
-       warn "Use of --local-rust-root without --enable-local-rust"
-    fi
 fi
 
 # Force freebsd to build with clang; gcc doesn't like us there
diff --git a/mk/main.mk b/mk/main.mk
index 7b42c5b4ae9..a9a99f132fb 100644
--- a/mk/main.mk
+++ b/mk/main.mk
@@ -190,11 +190,14 @@ endif
 # Target-and-rule "utility variables"
 ######################################################################
 
-define DEF_X
+define DEF_FOR_TARGET
 X_$(1) := $(CFG_EXE_SUFFIX_$(1))
+ifndef CFG_LLVM_TARGET_$(1)
+CFG_LLVM_TARGET_$(1) := $(1)
+endif
 endef
 $(foreach target,$(CFG_TARGET), \
-  $(eval $(call DEF_X,$(target))))
+  $(eval $(call DEF_FOR_TARGET,$(target))))
 
 # "Source" files we generate in builddir along the way.
 GENERATED :=
diff --git a/mk/rt.mk b/mk/rt.mk
index a7d6a6e825f..38aec836316 100644
--- a/mk/rt.mk
+++ b/mk/rt.mk
@@ -75,7 +75,7 @@ $$(RT_OUTPUT_DIR_$(1))/%.o: $(S)src/rt/%.ll $$(MKFILE_DEPS) \
 	@mkdir -p $$(@D)
 	@$$(call E, compile: $$@)
 	$$(Q)$$(LLC_$$(CFG_BUILD)) $$(CFG_LLC_FLAGS_$(1)) \
-	    -filetype=obj -mtriple=$(1) -relocation-model=pic -o $$@ $$<
+	    -filetype=obj -mtriple=$$(CFG_LLVM_TARGET_$(1)) -relocation-model=pic -o $$@ $$<
 
 $$(RT_OUTPUT_DIR_$(1))/%.o: $(S)src/rt/%.c $$(MKFILE_DEPS)
 	@mkdir -p $$(@D)
diff --git a/mk/stage0.mk b/mk/stage0.mk
index e028bba73da..460a4a7f445 100644
--- a/mk/stage0.mk
+++ b/mk/stage0.mk
@@ -22,7 +22,7 @@ ifdef CFG_ENABLE_LOCAL_RUST
 else
 	$(Q)$(CFG_PYTHON) $(S)src/etc/get-snapshot.py $(CFG_BUILD) $(SNAPSHOT_FILE)
 endif
-	$(Q)touch $@
+	$(Q)if [ -e "$@" ]; then touch "$@"; else echo "ERROR: snapshot $@ not found"; exit 1; fi
 
 # For other targets, let the host build the target:
 
diff --git a/mk/target.mk b/mk/target.mk
index ed7d8bb497d..acdf780f105 100644
--- a/mk/target.mk
+++ b/mk/target.mk
@@ -116,7 +116,7 @@ $$(TBIN$(1)_T_$(2)_H_$(3))/$(4)$$(X_$(2)): \
 		$$(foreach dep,$$(TOOL_DEPS_$(4)), \
 		    $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(dep)) \
 		$$(TSREQ$(1)_T_$(2)_H_$(3)) \
-		| $$(TBIN$(1)_T_$(4)_H_$(3))/
+		| $$(TBIN$(1)_T_$(2)_H_$(3))/
 	@$$(call E, rustc: $$@)
 	$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --cfg $(4)
 
diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs
index 21242e6f1e4..b040a4bfd2a 100644
--- a/src/librustdoc/core.rs
+++ b/src/librustdoc/core.rs
@@ -18,7 +18,6 @@ use rustc_trans::back::link;
 use syntax::{ast, ast_map, codemap, diagnostic};
 
 use std::cell::RefCell;
-use std::os;
 use std::collections::{HashMap, HashSet};
 use arena::TypedArena;
 
@@ -89,7 +88,7 @@ pub fn run_core(libs: Vec<Path>, cfgs: Vec<String>, externs: Externs,
     let warning_lint = lint::builtin::WARNINGS.name_lower();
 
     let sessopts = config::Options {
-        maybe_sysroot: Some(os::self_exe_path().unwrap().dir_path()),
+        maybe_sysroot: None,
         addl_lib_search_paths: RefCell::new(libs),
         crate_types: vec!(config::CrateTypeRlib),
         lint_opts: vec!((warning_lint, lint::Allow)),