about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-05-28 16:21:53 -0700
committerbors <bors@rust-lang.org>2016-05-28 16:21:53 -0700
commit7746a334da364e5e4c25360cd52e97691cbddc08 (patch)
treec4da2fef705e4f95344c8a9afee80bc66a4f4080
parent90d9a515af7b80ab99d77cf8b3fa29d0272e2b3c (diff)
parenta2434eb950bee72f8c7e5186fad657852cbf14bf (diff)
Auto merge of #33825 - alexcrichton:fix-beta, r=aturon
mk: Fix bootstrapping cross-hosts on beta

The beta builds are currently failing, unfortunately, due to what is presumably
some odd behavior with our makefiles. The wrong bootstrap key is being used to
generate the stage1 cross-compiled libraries, which fails the build.
Interestingly enough if the targets are directly specified as part of the build
then it works just fine! Just a bare `make` fails...

Instead of trying to understand what's happening in the makefiles instead just
tweak how we configure the bootstrap key in a way that's more likely to work.
-rw-r--r--mk/target.mk29
1 files changed, 20 insertions, 9 deletions
diff --git a/mk/target.mk b/mk/target.mk
index 37181b05438..2a08b7b0465 100644
--- a/mk/target.mk
+++ b/mk/target.mk
@@ -42,6 +42,23 @@ $(foreach host,$(CFG_HOST), \
    $(foreach crate,$(CRATES), \
     $(eval $(call RUST_CRATE_FULLDEPS,$(stage),$(target),$(host),$(crate)))))))
 
+# $(1) stage
+# $(2) target
+# $(3) host
+define DEFINE_BOOTSTRAP_KEY
+BOOTSTRAP_KEY$(1)_T_$(2)_H_$(3) := $$(CFG_BOOTSTRAP_KEY)
+ifeq ($(1),0)
+ifeq ($(3),$$(CFG_BUILD))
+BOOTSTRAP_KEY$(1)_T_$(2)_H_$(3) := $$(CFG_BOOTSTRAP_KEY_STAGE0)
+endif
+endif
+endef
+
+$(foreach host,$(CFG_TARGET), \
+ $(foreach target,$(CFG_TARGET), \
+  $(foreach stage,$(STAGES), \
+   $(eval $(call DEFINE_BOOTSTRAP_KEY,$(stage),$(target),$(host))))))
+
 # RUST_TARGET_STAGE_N template: This defines how target artifacts are built
 # for all stage/target architecture combinations. This is one giant rule which
 # works as follows:
@@ -65,13 +82,10 @@ $(foreach host,$(CFG_HOST), \
 # $(4) is the crate name
 define RUST_TARGET_STAGE_N
 
-ifeq ($(1),0)
-$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \
-	export RUSTC_BOOTSTRAP_KEY := $$(CFG_BOOTSTRAP_KEY_STAGE0)
-endif
-
 $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): CFG_COMPILER_HOST_TRIPLE = $(2)
 $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \
+	export RUSTC_BOOTSTRAP_KEY := $$(BOOTSTRAP_KEY$(1)_T_$(2)_H_$(3))
+$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \
 		$$(CRATEFILE_$(4)) \
 		$$(CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4)) \
 		$$(LLVM_CONFIG_$(2)) \
@@ -118,11 +132,8 @@ endef
 # $(4) - name of the tool being built
 define TARGET_TOOL
 
-ifeq ($(1),0)
 $$(TBIN$(1)_T_$(2)_H_$(3))/$(4)$$(X_$(2)): \
-	export RUSTC_BOOTSTRAP_KEY := $$(CFG_BOOTSTRAP_KEY_STAGE0)
-endif
-
+	export RUSTC_BOOTSTRAP_KEY := $$(BOOTSTRAP_KEY$(1)_T_$(2)_H_$(3))
 $$(TBIN$(1)_T_$(2)_H_$(3))/$(4)$$(X_$(2)): \
 		$$(TOOL_SOURCE_$(4)) \
 		$$(TOOL_INPUTS_$(4)) \