From: Nathan Moinvaziri Date: Thu, 31 Mar 2022 16:50:52 +0000 (-0700) Subject: Remove support for building fuzzers from configure. X-Git-Tag: 2.1.0-beta1~287 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=42843861036c048a3c6f1475972a51c5a662b950;p=thirdparty%2Fzlib-ng.git Remove support for building fuzzers from configure. --- diff --git a/Makefile.in b/Makefile.in index 2b826909..96bb9382 100644 --- a/Makefile.in +++ b/Makefile.in @@ -154,7 +154,7 @@ PIC_OBJS = $(PIC_OBJC) all: static shared -static: example$(EXE) minigzip$(EXE) fuzzers makefixed$(EXE) maketrees$(EXE) makecrct$(EXE) +static: example$(EXE) minigzip$(EXE) makefixed$(EXE) maketrees$(EXE) makecrct$(EXE) shared: examplesh$(EXE) minigzipsh$(EXE) @@ -177,59 +177,6 @@ $(ARCHDIR)/%.lo: $(SRCDIR)/$(ARCHDIR)/%.c test: all $(MAKE) -C test -# This variable is set by configure. -WITH_FUZZERS= - -# By default, use our own standalone_fuzz_target_runner. -# This runner does no fuzzing, but simply executes the inputs -# provided via parameters. -# Run e.g. "make all LIB_FUZZING_ENGINE=/path/to/libFuzzer.a" -# to link the fuzzer(s) against a real fuzzing engine. -ifeq (,$(LIB_FUZZING_ENGINE)) - LIB_FUZZING_ENGINE = standalone_fuzz_target_runner.o -else - # OSS-Fuzz will define its own value for LIB_FUZZING_ENGINE. - WITH_FUZZERS=1 -endif - -ifeq (1,$(WITH_FUZZERS)) -fuzzers: fuzzer_checksum$(EXE) fuzzer_compress$(EXE) fuzzer_example_small$(EXE) fuzzer_example_large$(EXE) fuzzer_example_flush$(EXE) fuzzer_example_dict$(EXE) fuzzer_minigzip$(EXE) -else -fuzzers: -endif - -# The standalone fuzz target runner. -standalone_fuzz_target_runner.o: - $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $< -fuzzer_checksum.o: - $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $< -fuzzer_compress.o: - $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $< -fuzzer_example_small.o: - $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $< -fuzzer_example_large.o: - $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $< -fuzzer_example_flush.o: - $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $< -fuzzer_example_dict.o: - $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $< -fuzzer_minigzip.o: - $(CC) $(CFLAGS) -DWITH_GZFILEOP $(INCLUDES) -c -o $@ $< -fuzzer_checksum$(EXE): fuzzer_checksum.o standalone_fuzz_target_runner.o $(STATICLIB) - $(CC) $(LDFLAGS) -o $@ $(LIB_FUZZING_ENGINE) fuzzer_checksum.o $(STATICLIB) -lpthread -fuzzer_compress$(EXE): fuzzer_compress.o standalone_fuzz_target_runner.o $(STATICLIB) - $(CC) $(LDFLAGS) -o $@ $(LIB_FUZZING_ENGINE) fuzzer_compress.o $(STATICLIB) -lpthread -fuzzer_example_small$(EXE): fuzzer_example_small.o standalone_fuzz_target_runner.o $(STATICLIB) - $(CC) $(LDFLAGS) -o $@ $(LIB_FUZZING_ENGINE) fuzzer_example_small.o $(STATICLIB) -lpthread -fuzzer_example_large$(EXE): fuzzer_example_large.o standalone_fuzz_target_runner.o $(STATICLIB) - $(CC) $(LDFLAGS) -o $@ $(LIB_FUZZING_ENGINE) fuzzer_example_large.o $(STATICLIB) -lpthread -fuzzer_example_flush$(EXE): fuzzer_example_flush.o standalone_fuzz_target_runner.o $(STATICLIB) - $(CC) $(LDFLAGS) -o $@ $(LIB_FUZZING_ENGINE) fuzzer_example_flush.o $(STATICLIB) -lpthread -fuzzer_example_dict$(EXE): fuzzer_example_dict.o standalone_fuzz_target_runner.o $(STATICLIB) - $(CC) $(LDFLAGS) -o $@ $(LIB_FUZZING_ENGINE) fuzzer_example_dict.o $(STATICLIB) -lpthread -fuzzer_minigzip$(EXE): fuzzer_minigzip.o standalone_fuzz_target_runner.o $(OBJG) $(STATICLIB) - $(CC) $(LDFLAGS) -o $@ $(LIB_FUZZING_ENGINE) fuzzer_minigzip.o $(OBJG) $(STATICLIB) -lpthread - infcover.o: $(SRCDIR)/test/infcover.c zlib$(SUFFIX).h zconf$(SUFFIX).h zlib_name_mangling$(SUFFIX).h $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $(SRCDIR)/test/infcover.c @@ -410,7 +357,7 @@ clean: @if [ -f $(ARCHDIR)/Makefile ]; then $(MAKE) -C $(ARCHDIR) clean; fi @if [ -f test/Makefile ]; then $(MAKE) -C test clean; fi rm -f *.o *.lo *~ \ - example$(EXE) minigzip$(EXE) minigzipsh$(EXE) fuzzer_*$(EXE) \ + example$(EXE) minigzip$(EXE) minigzipsh$(EXE) \ infcover makefixed$(EXE) maketrees$(EXE) makecrct$(EXE) \ $(STATICLIB) $(IMPORTLIB) $(SHAREDLIB) $(SHAREDLIBV) $(SHAREDLIBM) \ foo.gz so_locations \ diff --git a/README.md b/README.md index b0842bc4..f178ed54 100644 --- a/README.md +++ b/README.md @@ -120,7 +120,7 @@ Build Options | WITH_NEW_STRATEGIES | --without-new-strategies | Use new strategies | ON | | WITH_NATIVE_INSTRUCTIONS | --native | Compiles with full instruction set supported on this host (gcc/clang -march=native) | OFF | | WITH_SANITIZER | --with-sanitizer | Build with sanitizer (memory, address, undefined) | OFF | -| WITH_FUZZERS | --with-fuzzers | Build test/fuzz | OFF | +| WITH_FUZZERS | | Build test/fuzz | OFF | | WITH_BENCHMARKS | | Build test/benchmarks | OFF | | WITH_MAINTAINER_WARNINGS | | Build with project maintainer warnings | OFF | | WITH_CODE_COVERAGE | | Enable code coverage reporting | OFF | diff --git a/configure b/configure index b8216abf..bf64ae35 100755 --- a/configure +++ b/configure @@ -100,7 +100,6 @@ builddfltccdeflate=0 builddfltccinflate=0 buildcrc32vx=1 with_sanitizer="" -with_fuzzers=0 floatabi= native=0 forcesse2=0 @@ -178,7 +177,6 @@ case "$1" in echo ' [--force-sse2] Assume SSE2 instructions are always available (disabled by default on x86, enabled on x86_64)' | tee -a configure.log echo ' [--force-tzcnt] Assume TZCNT instructions are always available (disabled by default)' | tee -a configure.log echo ' [--with-sanitizer] Build with sanitizer (memory, address, undefined)' | tee -a configure.log - echo ' [--with-fuzzers] Build test/fuzz (disabled by default)' | tee -a configure.log echo ' [--native] Compiles with full instruction set supported on this host' | tee -a configure.log exit 0 ;; -p*=* | --prefix=*) prefix=$(echo $1 | sed 's/.*=//'); shift ;; @@ -221,7 +219,6 @@ case "$1" in -w* | --warn) warn=1; shift ;; -d* | --debug) debug=1; shift ;; --with-sanitizer=*) with_sanitizer=$(echo $1 | sed 's/.*=//'); shift ;; - --with-fuzzers) with_fuzzers=1; shift ;; *) echo "unknown option: $1" | tee -a configure.log @@ -2043,7 +2040,6 @@ if [ "$SRCDIR" != "$BUILDDIR" ]; then INCLUDES="-I$BUILDDIR ${INCLUDES}"; fi sed < $SRCDIR/Makefile.in " /^CC *=/s#=.*#=$CC# /^CFLAGS *=/s#=.*#=$CFLAGS# -/^WITH_FUZZERS *=/s#=.*#=$with_fuzzers# /^SFLAGS *=/s#=.*#=$SFLAGS# /^LDFLAGS *=/s#=.*#=$LDFLAGS# /^LDSHARED *=/s#=.*#=$LDSHARED# @@ -2211,7 +2207,6 @@ sed < $SRCDIR/test/Makefile.in " /^SRCDIR *=/s#=.*#=$SRCDIR/test# /^SRCTOP *=/s#=.*#=$SRCDIR# /^QEMU_RUN *=/s#=.*#=$QEMU_RUN# -/^WITH_FUZZERS *=/s#=.*#=$with_fuzzers# /^LIBNAME *=/s#=.*#=$LIBNAME# " > test/Makefile diff --git a/test/Makefile.in b/test/Makefile.in index 00050798..4078d60d 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -9,12 +9,11 @@ SRCDIR= SRCTOP= LIBNAME= TEST_LDFLAGS=-L.. ../$(LIBNAME).a -WITH_FUZZERS= QEMU_RUN= QEMU_VER:=$(shell command -v $(QEMU_RUN) --version 2> /dev/null) -all: oldtests cvetests fuzzer ghtests +all: oldtests cvetests ghtests oldtests: #set by ../configure check_cross_dep: @@ -26,24 +25,6 @@ endif ALL_SRC_FILES := $(wildcard ../*) -# Only check the fuzzer when it is a stand-alone executable. -ifneq (,$(LIB_FUZZING_ENGINE)) -fuzzer: -else - ifeq (0,$(WITH_FUZZERS)) -fuzzer: - else -fuzzer: - @${QEMU_RUN} ../fuzzer_checksumr$(EXE) $(ALL_SRC_FILES) && \ - ${QEMU_RUN} ../fuzzer_compress$(EXE) $(ALL_SRC_FILES) && \ - ${QEMU_RUN} ../fuzzer_example_small$(EXE) $(ALL_SRC_FILES) && \ - ${QEMU_RUN} ../fuzzer_example_large$(EXE) $(ALL_SRC_FILES) && \ - ${QEMU_RUN} ../fuzzer_example_flush$(EXE) $(ALL_SRC_FILES) && \ - ${QEMU_RUN} ../fuzzer_example_dict$(EXE) $(ALL_SRC_FILES) && \ - ${QEMU_RUN} ../fuzzer_minigzip$(EXE) $(ALL_SRC_FILES) - endif -endif - teststatic: check_cross_dep @TMPST=tmpst_$$$$; \ HELLOST=tmphellost_$$$$; \