Skip to content

Commit cad8c73

Browse files
committed
Add a flag to run the compiler under valgrind
1 parent 0b73b29 commit cad8c73

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Diff for: Makefile.in

+11-2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ endif
3434
# platform-specific auto-configuration
3535
include $(CFG_SRC_DIR)/mk/platform.mk
3636

37+
# Run the stage1/2 compilers under valgrind
38+
ifdef VALGRIND_COMPILE
39+
CFG_VALGRIND_COMPILE :=$(CFG_VALGRIND)
40+
else
41+
CFG_VALGRIND_COMPILE :=
42+
endif
43+
3744
CFG_RUNTIME :=$(call CFG_LIB_NAME,rustrt)
3845
CFG_RUSTLLVM :=$(call CFG_LIB_NAME,rustllvm)
3946
CFG_STDLIB :=$(call CFG_LIB_NAME,std)
@@ -107,9 +114,11 @@ VPATH := $(S)doc $(S)src
107114
STAGE0 := $(Q)$(call CFG_RUN_TARG,stage0,\
108115
stage0/rustc$(X) $(CFG_RUSTC_FLAGS) -L stage1)
109116
STAGE1 := $(Q)$(call CFG_RUN_TARG,stage1, \
110-
stage1/rustc$(X) $(CFG_RUSTC_FLAGS) -L stage2)
117+
$(CFG_VALGRIND_COMPILE) stage1/rustc$(X) \
118+
$(CFG_RUSTC_FLAGS) -L stage2)
111119
STAGE2 := $(Q)$(call CFG_RUN_TARG,stage2, \
112-
stage2/rustc$(X) $(CFG_RUSTC_FLAGS) -L stage3)
120+
$(CFG_VALGRIND_COMPILE) stage2/rustc$(X) \
121+
$(CFG_RUSTC_FLAGS) -L stage3)
113122

114123
# "Source" files we generate in builddir along the way.
115124
GENERATED :=

0 commit comments

Comments
 (0)