Skip to content

Commit 6178501

Browse files
committed
auto merge of #8907 : pnkfelix/rust/fsk-fix-makefile-8865, r=thestinger
Fix #8865.
2 parents a60c6a8 + b1a2251 commit 6178501

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

Diff for: mk/stage0.mk

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ $(HBIN0_H_$(CFG_BUILD_TRIPLE))/:
66
$(HLIB0_H_$(CFG_BUILD_TRIPLE))/:
77
mkdir -p $@
88

9-
$(HBIN0_H_$(CFG_BUILD_TRIPLE))/rustc$(X_$(CFG_BUILD_TRIPLE)): \
9+
SNAPSHOT_RUSTC_POST_CLEANUP=$(HBIN0_H_$(CFG_BUILD_TRIPLE))/rustc$(X_$(CFG_BUILD_TRIPLE))
10+
11+
$(SNAPSHOT_RUSTC_POST_CLEANUP): \
1012
$(S)src/snapshots.txt \
1113
$(S)src/etc/get-snapshot.py $(MKFILE_DEPS) \
1214
| $(HBIN0_H_$(CFG_BUILD_TRIPLE))/

Diff for: mk/target.mk

+14-3
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,28 @@ WFLAGS_ST2 = -D warnings
2727
# $(2) is the target triple
2828
# $(3) is the host triple
2929

30+
# Every recipe in TARGET_STAGE_N outputs to $$(TLIB$(1)_T_$(2)_H_$(3),
31+
# a directory that can be cleaned out during the middle of a run of
32+
# the get-snapshot.py script. Therefore, every recipe needs to have
33+
# an order-only dependency either on $(SNAPSHOT_RUSTC_POST_CLEANUP) or
34+
# on $$(TSREQ$(1)_T_$(2)_H_$(3)), to ensure that no products will be
35+
# put into the target area until after the get-snapshot.py script has
36+
# had its chance to clean it out; otherwise the other products will be
37+
# inadvertantly included in the clean out.
3038

3139
define TARGET_STAGE_N
3240

3341
$$(TLIB$(1)_T_$(2)_H_$(3))/libmorestack.a: \
3442
rt/$(2)/stage$(1)/arch/$$(HOST_$(2))/libmorestack.a \
35-
| $$(TLIB$(1)_T_$(2)_H_$(3))/
43+
| $$(TLIB$(1)_T_$(2)_H_$(3))/ \
44+
$(SNAPSHOT_RUSTC_POST_CLEANUP)
3645
@$$(call E, cp: $$@)
3746
$$(Q)cp $$< $$@
3847

3948
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_RUNTIME_$(2)): \
4049
rt/$(2)/stage$(1)/$(CFG_RUNTIME_$(2)) \
41-
| $$(TLIB$(1)_T_$(2)_H_$(3))/
50+
| $$(TLIB$(1)_T_$(2)_H_$(3))/ \
51+
$(SNAPSHOT_RUSTC_POST_CLEANUP)
4252
@$$(call E, cp: $$@)
4353
$$(Q)cp $$< $$@
4454

@@ -77,7 +87,8 @@ ifneq ($$(findstring $(2),$$(CFG_HOST_TRIPLES)),)
7787

7888
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_RUSTLLVM_$(3)): \
7989
rustllvm/$(2)/$(CFG_RUSTLLVM_$(3)) \
80-
| $$(TLIB$(1)_T_$(2)_H_$(3))/
90+
| $$(TLIB$(1)_T_$(2)_H_$(3))/ \
91+
$(SNAPSHOT_RUSTC_POST_CLEANUP)
8192
@$$(call E, cp: $$@)
8293
$$(Q)cp $$< $$@
8394

0 commit comments

Comments
 (0)