[libxml2]Add libxml2 library

This commit is contained in:
zhoujiale
2026-07-26 16:57:28 +08:00
committed by zhoujiale
parent 0a44ec8a06
commit e841ac915d
3790 changed files with 668244 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
#!/bin/sh
set -e
fuzzer="$1"
if [ -z "$fuzzer" ]; then
echo usage: $0 fuzzer
exit 1
fi
# Rebuild the project with coverage enabled
make distclean
export CC=clang
export CXX=clang++
export CFLAGS=" \
-O1 -gline-tables-only \
-fsanitize=fuzzer-no-link \
-fprofile-instr-generate -fcoverage-mapping \
-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION"
sh autogen.sh --without-python
make -j5
rm default.profraw
# Process corpus once
cd fuzz
make $fuzzer
./$fuzzer -runs=1 corpus/$fuzzer
# Generate HTML report
llvm-profdata merge default.profraw -o default.profdata
llvm-cov show -format=html -output-dir=report \
-instr-profile default.profdata \
../.libs/libxml2.so
rm default.profraw default.profdata
+21
View File
@@ -0,0 +1,21 @@
#!/bin/sh
set -e
fuzzer="$1"
if [ -z "$fuzzer" ]; then
echo usage: $0 fuzzer
exit 1
fi
cd fuzz
make $fuzzer
if [ ! -e corpus/${fuzzer}_ ]; then
mv corpus/$fuzzer corpus/${fuzzer}_
fi
mkdir -p corpus/$fuzzer
./$fuzzer -merge=1 -use_value_profile=1 corpus/$fuzzer corpus/${fuzzer}_
rm -rf corpus/${fuzzer}_