diff options
author | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2017-10-29 19:50:42 -0700 |
---|---|---|
committer | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2017-10-29 19:54:48 -0700 |
commit | ba9504325ed152ddc5b3fdc94e77df217e83f364 (patch) | |
tree | 7dca24d7d91d6c67559294e59eb47d8cacf74bde | |
parent | a569e6a737714d33fe30284abcc2f1af1f856127 (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-- | Makefile | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -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 $@) |