mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-21 11:23:03 +00:00
Tweak makefiles, change the way the fuzzer is built
Since librustc and the fuzzer depend on rustllvm, build them like rustc, linking to libraries in lib instead of lib/rustc/$(target)
This commit is contained in:
parent
9385ad4952
commit
9f9666af6e
@ -226,7 +226,8 @@ CFG_INFO := $(info cfg: *** compiler is in snapshot transition ***)
|
||||
CFG_INFO := $(info cfg: *** stage2 and later will not be built ***)
|
||||
CFG_INFO := $(info cfg:)
|
||||
|
||||
all: $(SREQ0$(CFG_HOST_TRIPLE)) $(SREQ1$(CFG_HOST_TRIPLE)) $(GENERATED) $(DOCS) $(FUZZ)
|
||||
all: $(SREQ0$(CFG_HOST_TRIPLE)) $(SREQ1$(CFG_HOST_TRIPLE)) \
|
||||
$(GENERATED) $(DOCS) $(FUZZ)
|
||||
else
|
||||
|
||||
ALL_SREQS = $(foreach target,$(CFG_TARGET_TRIPLES), \
|
||||
|
22
mk/fuzzer.mk
22
mk/fuzzer.mk
@ -1,9 +1,19 @@
|
||||
# At the moment the fuzzer only exists in stage1.
|
||||
|
||||
FUZZER_CRATE := $(S)src/fuzzer/fuzzer.rc
|
||||
FUZZER_INPUTS := $(wildcard $(addprefix $(S)src/fuzzer/, *.rs))
|
||||
|
||||
stage1/bin/fuzzer$(X): $(FUZZER_CRATE) $(FUZZER_INPUTS) $(SREQ1) \
|
||||
stage1/lib/rustc/$(CFG_HOST_TRIPLE)/$(CFG_LIBRUSTC)
|
||||
@$(call E, compile_and_link: $@)
|
||||
$(STAGE1) -o $@ $<
|
||||
define FUZZ_STAGE_N
|
||||
|
||||
stage$(2)/bin/fuzzer$$(X): $$(FUZZER_CRATE) $$(FUZZER_INPUTS) \
|
||||
$$(SREQ$(2)$(CFG_HOST_TRIPLE)) \
|
||||
stage$(2)/lib/$$(CFG_RUNTIME) \
|
||||
stage$(2)/lib/$$(CFG_RUSTLLVM) \
|
||||
stage$(2)/lib/$$(CFG_STDLIB) \
|
||||
stage$(2)/lib/$$(CFG_LIBRUSTC)
|
||||
@$$(call E, compile_and_link: $$@)
|
||||
$$(STAGE$(1)) -L stage1/lib -o $$@ $$<
|
||||
|
||||
endef
|
||||
|
||||
$(eval $(call FUZZ_STAGE_N,0,1))
|
||||
$(eval $(call FUZZ_STAGE_N,1,2))
|
||||
$(eval $(call FUZZ_STAGE_N,2,3))
|
||||
|
14
mk/stageN.mk
14
mk/stageN.mk
@ -36,7 +36,13 @@ stage$(2)/bin/rustc$$(X): $$(COMPILER_CRATE) $$(COMPILER_INPUTS) \
|
||||
stage$(1)/bin/lib/$$(CFG_STDLIB) \
|
||||
$$(SREQ$(1)$(3))
|
||||
@$$(call E, compile_and_link: $$@)
|
||||
$$(STAGE$(1)) -L stage$(2) -o $$@ $$<
|
||||
$$(STAGE$(1)) -L stage$(2)/lib -o $$@ $$<
|
||||
|
||||
stage$(2)/lib/$$(CFG_LIBRUSTC): \
|
||||
$$(COMPILER_CRATE) $$(COMPILER_INPUTS) \
|
||||
$$(SREQ$(2)$(3))
|
||||
@$$(call E, compile_and_link: $$@)
|
||||
$$(STAGE$(1)) -L stage$(2)/lib --lib -o $$@ $$<
|
||||
|
||||
stage$(2)/lib/$$(CFG_RUNTIME): rt/$$(CFG_RUNTIME)
|
||||
@$$(call E, cp: $$@)
|
||||
@ -71,12 +77,6 @@ stage$(2)/lib/rustc/$(3)/main.o: rt/main.o
|
||||
@$$(call E, cp: $$@)
|
||||
$$(Q)cp $$< $$@
|
||||
|
||||
stage$(2)/lib/rustc/$(3)/$$(CFG_LIBRUSTC): \
|
||||
$$(COMPILER_CRATE) $$(COMPILER_INPUTS) \
|
||||
$$(SREQ$(2)$(3))
|
||||
@$$(call E, compile_and_link: $$@)
|
||||
$$(STAGE$(2)) --lib -o $$@ $$<
|
||||
|
||||
stage$(2)/lib/rustc/$(3)/$$(CFG_STDLIB): \
|
||||
$$(STDLIB_CRATE) $$(STDLIB_INPUTS) \
|
||||
stage$(2)/bin/rustc$$(X) \
|
||||
|
Loading…
Reference in New Issue
Block a user