summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2017-10-29 19:50:42 -0700
committerArseny Kapoulkine <arseny.kapoulkine@gmail.com>2017-10-29 19:54:48 -0700
commitba9504325ed152ddc5b3fdc94e77df217e83f364 (patch)
tree7dca24d7d91d6c67559294e59eb47d8cacf74bde
parenta569e6a737714d33fe30284abcc2f1af1f856127 (diff)
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
-rw-r--r--Makefile9
1 files 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 $@)