0
0
mirror of https://github.com/zeux/pugixml.git synced 2024-12-25 20:14:10 +08:00

Move libFuzzer build to Makefile

Now the only thing fuzz_setup.sh does is installing new clang; if system
clang supports -fsanitize-coverage then fuzz_setup.sh is not required.
This commit is contained in:
Arseny Kapoulkine 2017-04-03 21:09:37 -07:00
parent 0eb1ddb975
commit 24d1a4562b
2 changed files with 7 additions and 5 deletions

View File

@ -86,9 +86,14 @@ build/pugixml-%: .FORCE | $(RELEASE)
$(EXECUTABLE): $(OBJECTS)
$(CXX) $(OBJECTS) $(LDFLAGS) -o $@
$(BUILD)/fuzz_%: tests/fuzz_%.cpp src/pugixml.cpp
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
@mkdir -p $(BUILD)
clang++ $(CXXFLAGS) -fsanitize=address -fsanitize-coverage=trace-pc-guard $^ libFuzzer.a -o $@
clang++ $(CXXFLAGS) -fsanitize=address -fsanitize-coverage=trace-pc-guard $^ -o $@
$(BUILD)/%.o: %
@mkdir -p $(dir $@)

View File

@ -9,6 +9,3 @@ cd ..
clang/clang/scripts/update.py
sudo cp -rf third_party/llvm-build/Release+Asserts/lib/* /usr/local/lib/
sudo cp -rf third_party/llvm-build/Release+Asserts/bin/* /usr/local/bin
svn co http://llvm.org/svn/llvm-project/llvm/trunk/lib/Fuzzer
Fuzzer/build.sh