From ba9504325ed152ddc5b3fdc94e77df217e83f364 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Sun, 29 Oct 2017 19:50:42 -0700 Subject: build: Switch fuzz builds to use Clang 5.0 sanitize=fuzzer The old fuzzer location is deprecated; this also makes it almost trivial to fuzz, provided that the clang is set up correctly... on Ubuntu 17.10, a command sequence like this works now: sudo apt install clang-5.0 sudo apt install libfuzzer-5.0 sudo cp /usr/lib/llvm-5.0/lib/libFuzzer.a /usr/lib/libLLVMFuzzer.a CXX=clang++-5.0 make fuzz_parse --- Makefile | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index edc3c42..e6ddb62 100644 --- a/Makefile +++ b/Makefile @@ -86,14 +86,9 @@ build/pugixml-%: .FORCE | $(RELEASE) $(EXECUTABLE): $(OBJECTS) $(CXX) $(OBJECTS) $(LDFLAGS) -o $@ -build/libFuzzer.o: - svn co http://llvm.org/svn/llvm-project/llvm/trunk/lib/Fuzzer build/Fuzzer - ls build/Fuzzer/*.cpp | xargs printf '#include "%s"\n' >build/libFuzzer.cpp - clang++ build/libFuzzer.cpp -c -g -O2 -fno-omit-frame-pointer -std=c++11 -I . -o build/libFuzzer.o - -$(BUILD)/fuzz_%: tests/fuzz_%.cpp src/pugixml.cpp build/libFuzzer.o +$(BUILD)/fuzz_%: tests/fuzz_%.cpp src/pugixml.cpp @mkdir -p $(BUILD) - clang++ $(CXXFLAGS) -fsanitize=address -fsanitize-coverage=trace-pc-guard $^ -o $@ + $(CXX) $(CXXFLAGS) -fsanitize=address,fuzzer $^ -o $@ $(BUILD)/%.o: % @mkdir -p $(dir $@) -- cgit v1.2.3