Skip to content

Commit 0494594

Browse files
committed
---
yaml --- r: 6491 b: refs/heads/master c: 8371beb h: refs/heads/master i: 6489: aaf39e3 6487: f86f211 v: v3
1 parent 30899c9 commit 0494594

File tree

4 files changed

+43
-8
lines changed

4 files changed

+43
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 791dc23c8313c213ef5ca3cfc1e5c4a9dd93ead7
2+
refs/heads/master: 8371beb5905158377689b9efb5cdb4a07ae17ada

trunk/Makefile.in

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,14 @@ GEN_MKFILES := $(wildcard $(CFG_SRC_DIR)/mk/libuv/*/*/*) \
5959

6060
MKFILES := $(OUR_MKFILES) $(3RDPARTY_MKFILES) $(GEN_MKFILES)
6161

62+
NON_HOST_TRIPLES = $(filter-out $(CFG_HOST_TRIPLE),$(CFG_TARGET_TRIPLES))
63+
6264
ifneq ($(MAKE_RESTARTS),)
6365
CFG_INFO := $(info cfg: make restarts: $(MAKE_RESTARTS))
6466
endif
6567

6668
CFG_INFO := $(info cfg: shell host triple $(CFG_HOST_TRIPLE))
69+
CFG_INFO := $(info cfg: non host triples $(NON_HOST_TRIPLES))
6770

6871
ifdef CFG_DISABLE_OPTIMIZE
6972
$(info cfg: disabling rustc optimization (CFG_DISABLE_OPTIMIZE))
@@ -220,7 +223,6 @@ endef
220223
$(foreach target,$(CFG_TARGET_TRIPLES), \
221224
$(eval $(call DEF_LLVM_VARS,$(target))))
222225

223-
224226
######################################################################
225227
# Exports for sub-utilities
226228
######################################################################

trunk/mk/stage0.mk

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,35 @@ $(HLIB0_H_$(CFG_HOST_TRIPLE))/$(CFG_STDLIB): \
2020
$(HLIB0_H_$(CFG_HOST_TRIPLE))/$(CFG_RUSTLLVM): \
2121
$(HBIN0_H_$(CFG_HOST_TRIPLE))/rustc$(X)
2222
$(Q)touch $@
23+
24+
# For other targets, let the host build the target:
25+
26+
define BOOTSTRAP_STAGE0
27+
# $(1) target to bootstrap
28+
# $(2) stage to bootstrap from
29+
# $(3) target to bootstrap from
30+
31+
$$(HBIN0_H_$(1))/rustc$$(X): \
32+
$$(TBIN$(2)_T_$(1)_H_$(3))/rustc$$(X)
33+
@$$(call E, cp: $$@)
34+
$$(Q)cp $$< $$@
35+
36+
$$(HLIB0_H_$(1))/$$(CFG_RUNTIME): \
37+
$$(TBIN$(2)_T_$(1)_H_$(3))/rustc$$(X)
38+
@$$(call E, cp: $$@)
39+
$$(Q)cp $$< $$@
40+
41+
$$(HLIB0_H_$(1))/$(CFG_STDLIB): \
42+
$$(TBIN$(2)_T_$(1)_H_$(3))/rustc$$(X)
43+
@$$(call E, cp: $$@)
44+
$$(Q)cp $$< $$@
45+
46+
$$(HLIB0_H_$(1))/$(CFG_RUSTLLVM): \
47+
$$(TBIN$(2)_T_$(1)_H_$(3))/rustc$$(X)
48+
@$$(call E, cp: $$@)
49+
$$(Q)cp $$< $$@
50+
51+
endef
52+
53+
$(foreach t,$(NON_HOST_TRIPLES), \
54+
$(eval $(call BOOTSTRAP_STAGE0,$(t),2,$(CFG_HOST_TRIPLE))))

trunk/mk/target.mk

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,10 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBRUSTC): \
5656

5757
endef
5858

59-
# Instantiate template for all stages
60-
$(foreach target,$(CFG_TARGET_TRIPLES), \
61-
$(eval $(call TARGET_STAGE_N,0,$(target),$(CFG_HOST_TRIPLE))) \
62-
$(eval $(call TARGET_STAGE_N,1,$(target),$(CFG_HOST_TRIPLE))) \
63-
$(eval $(call TARGET_STAGE_N,2,$(target),$(CFG_HOST_TRIPLE))) \
64-
$(eval $(call TARGET_STAGE_N,3,$(target),$(CFG_HOST_TRIPLE))))
59+
# In principle, each host can build each target:
60+
$(foreach source,$(CFG_TARGET_TRIPLES), \
61+
$(foreach target,$(CFG_TARGET_TRIPLES), \
62+
$(eval $(call TARGET_STAGE_N,0,$(source),$(target))) \
63+
$(eval $(call TARGET_STAGE_N,1,$(source),$(target))) \
64+
$(eval $(call TARGET_STAGE_N,2,$(source),$(target))) \
65+
$(eval $(call TARGET_STAGE_N,3,$(source),$(target)))))

0 commit comments

Comments
 (0)