Skip to content

Commit a5ea56c

Browse files
committed
Introduce the fuzzer crate and make rules
1 parent f627c2f commit a5ea56c

File tree

4 files changed

+26
-0
lines changed

4 files changed

+26
-0
lines changed

Makefile.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,3 +211,4 @@ include $(CFG_SRC_DIR)/mk/dist.mk
211211
include $(CFG_SRC_DIR)/mk/snap.mk
212212
include $(CFG_SRC_DIR)/mk/clean.mk
213213
include $(CFG_SRC_DIR)/mk/autodep.mk
214+
include $(CFG_SRC_DIR)/mk/fuzzer.mk

mk/fuzzer.mk

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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.
4+
5+
FUZZER_CRATE := $(S)src/fuzzer/fuzzer.rc
6+
FUZZER_INPUTS := $(wildcard $(addprefix $(S)src/fuzzer/, *.rs))
7+
8+
stage2/fuzzer.o: $(FUZZER_CRATE) $(FUZZER_INPUTS) $(SREQ1)
9+
@$(call E, compile: $@)
10+
$(STAGE1) -c -o $@ $<

src/fuzzer/Fuzzer.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
fn main() {
2+
}

src/fuzzer/fuzzer.rc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// -*- rust -*-
2+
3+
use std;
4+
5+
mod Fuzzer;
6+
7+
// Local Variables:
8+
// fill-column: 78;
9+
// indent-tabs-mode: nil
10+
// c-basic-offset: 4
11+
// buffer-file-coding-system: utf-8-unix
12+
// compile-command: "make -k -C $RBUILD 2>&1 | sed -e 's/\\/x\\//x:\\//g'";
13+
// End:

0 commit comments

Comments
 (0)