From 6c063b1e82a62cc48e3f5dc42caf1f2b030659ab Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Mon, 28 Aug 2023 09:34:20 -0400 Subject: [PATCH] Update fuzzer to work with new fixtures location Also some DX improvements for fuzzing: - add a fuzz-clean make target - have the fuzz binaries build task handle directory creation --- Makefile | 6 +++++- fuzz/corpus/parse | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index a0d39092b80..d7570825976 100644 --- a/Makefile +++ b/Makefile @@ -44,6 +44,7 @@ build/static/%.o: src/%.c Makefile $(HEADERS) build/fuzz.%: $(SOURCES) fuzz/%.c fuzz/fuzz.c $(ECHO) "building $* fuzzer" + $(Q) mkdir -p $(@D) $(ECHO) "building main fuzz binary" $(Q) AFL_HARDEN=1 afl-clang-lto $(DEBUG_FLAGS) $(CPPFLAGS) $(CFLAGS) $(FUZZ_FLAGS) -O0 -fsanitize-ignorelist=fuzz/asan.ignore -fsanitize=fuzzer,address -ggdb3 -std=c99 -Iinclude -o $@ $^ $(ECHO) "building cmplog binary" @@ -70,10 +71,13 @@ fuzz-run-%: FORCE fuzz-docker-build $(Q) docker run -it --rm -v $(shell pwd):/yarp -v $(FUZZ_OUTPUT_DIR):/fuzz_output yarp/fuzz /bin/bash -c "./fuzz/$*.sh /fuzz_output/$*" FORCE: +fuzz-clean: + $(Q) rm -f -r fuzz/output + clean: $(Q) rm -f -r build -.PHONY: clean +.PHONY: clean fuzz-clean all-no-debug: DEBUG_FLAGS := -DNDEBUG=1 all-no-debug: OPTFLAGS := -O3 diff --git a/fuzz/corpus/parse b/fuzz/corpus/parse index 9b147ce9afb..8cc514fe259 120000 --- a/fuzz/corpus/parse +++ b/fuzz/corpus/parse @@ -1 +1 @@ -../../test/fixtures/ \ No newline at end of file +../../test/yarp/fixtures \ No newline at end of file