Skip to content

Commit 5fb9cad

Browse files
committed
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.
1 parent 77f5d14 commit 5fb9cad

File tree

5 files changed

+10
-18
lines changed

5 files changed

+10
-18
lines changed

Makefile.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ endif
4747
CFG_RUNTIME :=$(call CFG_LIB_NAME,rustrt)
4848
CFG_RUSTLLVM :=$(call CFG_LIB_NAME,rustllvm)
4949
CFG_STDLIB :=$(call CFG_LIB_NAME,std)
50+
CFG_LIBRUSTC :=$(call CFG_LIB_NAME,rustc)
5051

5152
# version-string calculation
5253
CFG_GIT_DIR := $(CFG_SRC_DIR).git

mk/fuzzer.mk

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,8 @@
1-
# At the moment the fuzzer only exists in stage2. That's the first
2-
# stage built by the non-snapshot compiler so it seems a convenient
3-
# stage to work at.
1+
# At the moment the fuzzer only exists in stage1.
42

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

8-
stage2/fuzzer.o: $(FUZZER_CRATE) $(FUZZER_INPUTS) $(SREQ1)
9-
@$(call E, compile: $@)
10-
$(STAGE1) -c -o $@ $<
11-
12-
stage2/fuzzer$(X): stage2/fuzzer.o $(SREQ1)
13-
@$(call E, link [gcc]: $@)
14-
$(Q)gcc $(CFG_GCCISH_CFLAGS) rt/main.o stage2/glue.o -o $@ $< \
15-
-Lstage2 -Lrustllvm -Lrt -lrustrt -lrustllvm -lstd -lm -lrustc
16-
@# dsymutil sometimes fails or prints a warning, but the
17-
@# program still runs. Since it simplifies debugging other
18-
@# programs, I\'ll live with the noise.
19-
-$(Q)$(CFG_DSYMUTIL) $@
6+
stage1/fuzzer$(X): $(FUZZER_CRATE) $(FUZZER_INPUTS) $(SREQ1)
7+
@$(call E, compile_and_link: $@)
8+
$(STAGE1) -o $@ $<

mk/stage1.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,8 @@ stage1/%.o: stage1/%.s
2929
stage1/%$(X): $(COMPILER_CRATE) $(COMPILER_INPUTS) $(SREQ0) stage0/intrinsics.bc
3030
@$(call E, compile_and_link: $@)
3131
$(STAGE0) -o $@ $<
32+
33+
stage1/lib/$(CFG_LIBRUSTC): $(COMPILER_CRATE) $(COMPILER_INPUTS) $(SREQ1) \
34+
stage1/intrinsics.bc
35+
@$(call E, compile_and_link: $@)
36+
$(STAGE1) --shared -o $@ $<

src/fuzzer/fuzzer.rc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// -*- rust -*-
22

33
use std;
4-
use rustc;
54

65
mod fuzzer;
76

src/fuzzer/fuzzer.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import std::getopts::opt_str;
66
import std::io;
77
import std::vec;
88

9-
import rustc::front::ast;
10-
119
type src_gen = iter() -> str;
1210

1311
iter dir_src_gen(str dir) -> str {

0 commit comments

Comments
 (0)