提交 5fb9cad3 编写于 作者: B Brian Anderson

Partially restore the fuzzer crate's build rules

Right now the stage1/fuzzer crate will build but it's not linked to librustc
because stage1/librustc won't link.
上级 77f5d14f
......@@ -47,6 +47,7 @@ endif
CFG_RUNTIME :=$(call CFG_LIB_NAME,rustrt)
CFG_RUSTLLVM :=$(call CFG_LIB_NAME,rustllvm)
CFG_STDLIB :=$(call CFG_LIB_NAME,std)
CFG_LIBRUSTC :=$(call CFG_LIB_NAME,rustc)
# version-string calculation
CFG_GIT_DIR := $(CFG_SRC_DIR).git
......
# 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.
# At the moment the fuzzer only exists in stage1.
FUZZER_CRATE := $(S)src/fuzzer/fuzzer.rc
FUZZER_INPUTS := $(wildcard $(addprefix $(S)src/fuzzer/, *.rs))
stage2/fuzzer.o: $(FUZZER_CRATE) $(FUZZER_INPUTS) $(SREQ1)
@$(call E, compile: $@)
$(STAGE1) -c -o $@ $<
stage2/fuzzer$(X): stage2/fuzzer.o $(SREQ1)
@$(call E, link [gcc]: $@)
$(Q)gcc $(CFG_GCCISH_CFLAGS) rt/main.o 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) $@
stage1/fuzzer$(X): $(FUZZER_CRATE) $(FUZZER_INPUTS) $(SREQ1)
@$(call E, compile_and_link: $@)
$(STAGE1) -o $@ $<
......@@ -29,3 +29,8 @@ stage1/%.o: stage1/%.s
stage1/%$(X): $(COMPILER_CRATE) $(COMPILER_INPUTS) $(SREQ0) stage0/intrinsics.bc
@$(call E, compile_and_link: $@)
$(STAGE0) -o $@ $<
stage1/lib/$(CFG_LIBRUSTC): $(COMPILER_CRATE) $(COMPILER_INPUTS) $(SREQ1) \
stage1/intrinsics.bc
@$(call E, compile_and_link: $@)
$(STAGE1) --shared -o $@ $<
// -*- rust -*-
use std;
use rustc;
mod fuzzer;
......
......@@ -6,8 +6,6 @@
import std::io;
import std::vec;
import rustc::front::ast;
type src_gen = iter() -> str;
iter dir_src_gen(str dir) -> str {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册