aboutsummaryrefslogtreecommitdiff
path: root/mk/fuzzer.mk
blob: b68693238f442c5e49521b0b0ea012497c49f91a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# At the moment the fuzzer only exists in stage2.  That's the first
# stage built by the non-snapshot compiler so it seems a convenient
# stage to work at.

FUZZER_CRATE := $(S)src/fuzzer/fuzzer.rc
FUZZER_INPUTS := $(wildcard $(addprefix $(S)src/fuzzer/, *.rs))

stage2/fuzzer.o: $(FUZZER_CRATE) $(FUZZER_INPUTS) $(SREQ1) \
		stage2/$(CFG_RUSTCLIB)
	@$(call E, compile: $@)
	$(STAGE1) -c -o $@ $<

stage2/fuzzer$(X): stage2/fuzzer.o $(SREQ1)
	@$(call E, link [gcc]: $@)
	$(Q)gcc $(CFG_GCC_CFLAGS) stage2/glue.o -o $@ $< \
      -Lstage2 -Lrustllvm -Lrt -lrustrt -lrustllvm -lstd -lm -lrustc
	@# dsymutil sometimes fails or prints a warning, but the
	@# program still runs.  Since it simplifies debugging other
	@# programs, I\'ll live with the noise.
	-$(Q)$(CFG_DSYMUTIL) $@