From 5fb9cad38d68408907b0e1a9a40f871c91a7186e Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Thu, 30 Jun 2011 23:16:01 -0700 Subject: [PATCH] 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. --- Makefile.in | 1 + mk/fuzzer.mk | 19 ++++--------------- mk/stage1.mk | 5 +++++ src/fuzzer/fuzzer.rc | 1 - src/fuzzer/fuzzer.rs | 2 -- 5 files changed, 10 insertions(+), 18 deletions(-) diff --git a/Makefile.in b/Makefile.in index ecaf7718548..2a21feaa12e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -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 diff --git a/mk/fuzzer.mk b/mk/fuzzer.mk index 566d9b0d657..bdab57248d0 100644 --- a/mk/fuzzer.mk +++ b/mk/fuzzer.mk @@ -1,19 +1,8 @@ -# 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 $@ $< diff --git a/mk/stage1.mk b/mk/stage1.mk index a7a5e4b1c0d..883c5e07f54 100644 --- a/mk/stage1.mk +++ b/mk/stage1.mk @@ -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 $@ $< diff --git a/src/fuzzer/fuzzer.rc b/src/fuzzer/fuzzer.rc index 473a7b20615..12e6562e702 100644 --- a/src/fuzzer/fuzzer.rc +++ b/src/fuzzer/fuzzer.rc @@ -1,7 +1,6 @@ // -*- rust -*- use std; -use rustc; mod fuzzer; diff --git a/src/fuzzer/fuzzer.rs b/src/fuzzer/fuzzer.rs index 09872431831..2de291eac5b 100644 --- a/src/fuzzer/fuzzer.rs +++ b/src/fuzzer/fuzzer.rs @@ -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 { -- GitLab