@@ -86,13 +86,13 @@ CFG_INFO := $(info cfg: version $(CFG_VERSION))
8686
8787MKFILE_DEPS := config.stamp $(call rwildcard,$(CFG_SRC_DIR ) mk/,* )
8888MKFILES_FOR_TARBALL: =$(MKFILE_DEPS )
89- ifdef NO_MKFILE_DEPS
89+ ifneq ( $( NO_MKFILE_DEPS ) ,)
9090MKFILE_DEPS :=
9191endif
9292NON_BUILD_HOST = $(filter-out $(CFG_BUILD ) ,$(CFG_HOST ) )
9393NON_BUILD_TARGET = $(filter-out $(CFG_BUILD ) ,$(CFG_TARGET ) )
9494
95- ifdef MAKE_RESTARTS
95+ ifneq ( $( MAKE_RESTARTS ) ,)
9696CFG_INFO := $(info cfg: make restarts: $(MAKE_RESTARTS ) )
9797endif
9898
@@ -107,40 +107,28 @@ ifneq ($(wildcard $(NON_BUILD_TARGET)),)
107107CFG_INFO := $(info cfg: non-build target triples $(NON_BUILD_TARGET ) )
108108endif
109109
110- CFG_RUSTC_FLAGS :=
111- ifdef RUSTFLAGS
112- CFG_RUSTC_FLAGS += $(RUSTFLAGS )
113- endif
110+ CFG_RUSTC_FLAGS := $(RUSTFLAGS )
114111CFG_GCCISH_CFLAGS :=
115112CFG_GCCISH_LINK_FLAGS :=
116113
117114CFG_JEMALLOC_FLAGS :=
118- ifdef JEMALLOC_FLAGS
119- CFG_JEMALLOC_FLAGS += $(JEMALLOC_FLAGS )
120- endif
121115
122116ifdef CFG_DISABLE_OPTIMIZE
123117 $(info cfg : disabling rustc optimization (CFG_DISABLE_OPTIMIZE))
118+ CFG_RUSTC_FLAGS +=
124119 CFG_JEMALLOC_FLAGS += --enable-debug
125120else
126121 # The rtopt cfg turns off runtime sanity checks
127122 CFG_RUSTC_FLAGS += -O --cfg rtopt
128123endif
129124
125+ CFG_JEMALLOC_FLAGS += $(JEMALLOC_FLAGS )
126+
130127ifdef CFG_ENABLE_DEBUG_ASSERTIONS
131128 $(info cfg : enabling debug assertions (CFG_ENABLE_DEBUG_ASSERTIONS))
132129 CFG_RUSTC_FLAGS += -C debug-assertions=on
133130endif
134131
135- define DEF_RUSTFLAGS_STAGE
136- RUSTFLAGS_STAGE$(1 ) :=
137- endef
138-
139- STAGES = 0 1 2 3
140-
141- $(foreach stage,$(STAGES), \
142- $(eval $(call DEF_RUSTFLAGS_STAGE,$(stage))))
143-
144132ifdef CFG_ENABLE_DEBUGINFO
145133 $(info cfg : enabling debuginfo (CFG_ENABLE_DEBUGINFO))
146134 CFG_RUSTC_FLAGS += -g
@@ -198,9 +186,9 @@ endif
198186
199187
200188ifndef CFG_DISABLE_VALGRIND_RPASS
201- $(info cfg : enabling valgrind run-pass tests)
189+ $(info cfg : enabling valgrind run-pass tests (CFG_ENABLE_VALGRIND_RPASS) )
202190 $(info cfg : valgrind-rpass command set to $(CFG_VALGRIND ) )
203- CFG_VALGRIND_RPASS := $(CFG_VALGRIND )
191+ CFG_VALGRIND_RPASS :=$(CFG_VALGRIND )
204192else
205193 $(info cfg : disabling valgrind run-pass tests)
206194 CFG_VALGRIND_RPASS :=
@@ -384,6 +372,8 @@ export CFG_BOOTSTRAP_KEY
384372TRIPLE_TO_DEBUGGER_SCRIPT_SETTING =\
385373 $(if $(findstring windows,$(1 ) ) ,none,$(if $(findstring darwin,$(1 ) ) ,lldb,gdb) )
386374
375+ STAGES = 0 1 2 3
376+
387377define SREQ
388378# $(1) is the stage number
389379# $(2) is the target triple
0 commit comments