Skip to content

Commit 21ef888

Browse files
committed
auto merge of #15481 : alexcrichton/rust/fix-nightly, r=luqmana
The stage0 compiler for a non-CFG_BUILD architecture needs to have the new `-C extra-filename` argument passed.
2 parents c97f885 + 6d4d83c commit 21ef888

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

mk/target.mk

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,6 @@ $(foreach host,$(CFG_HOST), \
4444
$(foreach crate,$(CRATES), \
4545
$(eval $(call RUST_CRATE_FULLDEPS,$(stage),$(target),$(host),$(crate)))))))
4646

47-
# NOTE: after a stage0 snap this should be just EXTRA_FILENAME, not with a stage
48-
# bound
49-
EXTRA_FILENAME_0 =
50-
EXTRA_FILENAME_1 = -C extra-filename=-$(CFG_FILENAME_EXTRA)
51-
EXTRA_FILENAME_2 = -C extra-filename=-$(CFG_FILENAME_EXTRA)
52-
EXTRA_FILENAME_3 = -C extra-filename=-$(CFG_FILENAME_EXTRA)
53-
5447
# RUST_TARGET_STAGE_N template: This defines how target artifacts are built
5548
# for all stage/target architecture combinations. This is one giant rule which
5649
# works as follows:
@@ -75,6 +68,15 @@ EXTRA_FILENAME_3 = -C extra-filename=-$(CFG_FILENAME_EXTRA)
7568
# $(4) is the crate name
7669
define RUST_TARGET_STAGE_N
7770

71+
# NOTE: after a stage0 snap this should be just EXTRA_FILENAME, not with a stage
72+
# or target bound
73+
EXTRA_FILENAME_$(1)_$(2) = -C extra-filename=-$$(CFG_FILENAME_EXTRA)
74+
ifeq ($(1),0)
75+
ifeq ($$(CFG_BUILD),$(2))
76+
EXTRA_FILENAME_$(1)_$(2) =
77+
endif
78+
endif
79+
7880
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): CFG_COMPILER_HOST_TRIPLE = $(2)
7981
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \
8082
$$(CRATEFILE_$(4)) \
@@ -93,7 +95,7 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \
9395
-L "$$(dir $$(LLVM_STDCPP_LOCATION_$(2)))" \
9496
$$(RUSTFLAGS_$(4)) \
9597
--out-dir $$(@D) \
96-
$$(EXTRA_FILENAME_$(1)) \
98+
$$(EXTRA_FILENAME_$(1)_$(2)) \
9799
$$<
98100
@touch $$@
99101
$$(call LIST_ALL_OLD_GLOB_MATCHES,\

0 commit comments

Comments
 (0)