R. Elliott Childre 5d76707ede
Bump deps and fix Clippy warns in example fuzzers (#1043)
* Mostly addressing changing the `uninlined_format_args` lint which was
  changed to warn-by-default in rust clippy 1.67

* Bump dependencies:
  bindgen:  0.61 -> 0.63
  cc:       1.0 -> 1.0.42 (Exclue versions w/incompat rayon dependency)
  clap:     3.x -> 4.0
  rangemap: 0.1 -> 1
  xz -> xz2:  move to updated version

* Add fallthrough default return to `LLVMFuzzerTestOneInput` in
  **/fuzz.c to prevent Clang's -Wreturn-type

* libafl_atheris: Improve POSIX compatibility and reduce warnings
  * Check for .dylib and .so libraries
  * `source` -> `.` for POSIX shells
  * install wheel into the venv to support newer Python packaging
    standards
  * `LDPRELOAD` -> `LD_PRELOAD`
2023-02-05 21:53:45 +01:00

55 lines
1.4 KiB
Makefile

PROJECT_DIR=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
UNAME :="$(shell uname)"
LIB_DIR :="$(PROJECT_DIR)/target/release/libafl_atheris.a"
DEEXIT_PATH = "$(PROJECT_DIR)/../../target/release/libdeexit.dylib"
ifeq ("$(wildcard $(DEEXIT_PATH))", "")
DEEXIT_PATH = "$(PROJECT_DIR)/../../target/release/libdeexit.so"
endif
PHONY: all
all: fuzzer deexit
deexit: $(DEEXIT_PATH)
$(DEEXIT_PATH):
cd ../.. && cargo build --release -p deexit
atheris:
git clone https://github.com/google/atheris.git
target/release/libafl_atheris.a: src/*
# Build the libpng libfuzzer library
cargo build --release
fuzzer: target/release/libafl_atheris.a atheris env
(\
. env/bin/activate; \
pip install wheel; \
cd atheris; \
LIBFUZZER_LIB=$(LIB_DIR) pip install .; \
)
clean:
rm env
env:
python3 -m venv env
short_test: all
(\
rm -rf libafl_unix_shmem_server || true; \
. env/bin/activate; \
LD_PRELOAD=$(DEEXIT_PATH) DYLD_FORCE_FLAT_NAMESPACE=1 DYLD_INSERT_LIBRARIES=$(DEEXIT_PATH) RUST_BACKTRACE=1 timeout 10s python3 ./atheris/example_fuzzers/fuzzing_example.py --cores 0 -i in -o out || true; \
rm -rf out; \
)
test:
(\
rm -rf libafl_unix_shmem_server || true; \
. env/bin/activate; \
LD_PRELOAD=$(DEEXIT_PATH) DYLD_FORCE_FLAT_NAMESPACE=1 DYLD_INSERT_LIBRARIES=$(DEEXIT_PATH) RUST_BACKTRACE=1 timeout 60s python3 ./atheris/example_fuzzers/fuzzing_example.py --cores 0 -i in -o out || true; \
rm -rf out; \
)