Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable jitting in pcre2 #11195

Merged
merged 7 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 33 additions & 3 deletions projects/pcre2/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,43 @@

# build project
./autogen.sh
./configure --enable-fuzz-support --enable-never-backslash-C --with-match-limit=1000 --with-match-limit-depth=1000
./configure --enable-fuzz-support \
--enable-never-backslash-C --with-match-limit=1000 --with-match-limit-depth=1000 \
--enable-jit \
--enable-pcre2-16 --enable-pcre2-32
make -j$(nproc) clean
make -j$(nproc) all

# build fuzzer
# build fuzzers
$CXX $CXXFLAGS -o $OUT/pcre2_fuzzer \
$LIB_FUZZING_ENGINE .libs/libpcre2-fuzzsupport.a .libs/libpcre2-8.a
$CXX $CXXFLAGS -o $OUT/pcre2_fuzzer_16 \
$LIB_FUZZING_ENGINE .libs/libpcre2-fuzzsupport-16.a .libs/libpcre2-16.a
$CXX $CXXFLAGS -o $OUT/pcre2_fuzzer_32 \
$LIB_FUZZING_ENGINE .libs/libpcre2-fuzzsupport-32.a .libs/libpcre2-32.a

# test different link sizes
for i in $(seq 3 4); do
./configure --enable-fuzz-support \
--enable-never-backslash-C --with-match-limit=1000 --with-match-limit-depth=1000 \
--enable-jit \
--enable-pcre2-16 --enable-pcre2-32 --with-link-size=${i}
make -j$(nproc) clean
make -j$(nproc) all

# build fuzzers
$CXX $CXXFLAGS -o $OUT/pcre2_fuzzer_${i}l \
$LIB_FUZZING_ENGINE .libs/libpcre2-fuzzsupport.a .libs/libpcre2-8.a
$CXX $CXXFLAGS -o $OUT/pcre2_fuzzer_16_${i}l \
$LIB_FUZZING_ENGINE .libs/libpcre2-fuzzsupport-16.a .libs/libpcre2-16.a
$CXX $CXXFLAGS -o $OUT/pcre2_fuzzer_32_${i}l \
$LIB_FUZZING_ENGINE .libs/libpcre2-fuzzsupport-32.a .libs/libpcre2-32.a
done

# set up dictionary and options to use it
cp pcre2_fuzzer.options pcre2_fuzzer.dict $OUT/
for bits in {,_16,_32}; do
for linksize in {,_3l,_4l}; do
cp "pcre2_fuzzer${bits}.options" "${OUT}/pcre2_fuzzer${bits}${linksize}.options"
cp "pcre2_fuzzer${bits}.dict" "${OUT}/pcre2_fuzzer${bits}${linksize}.dict"
done
done
2 changes: 2 additions & 0 deletions projects/pcre2/project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ sanitizers:
architectures:
- x86_64
- i386
auto_ccs:
- "[email protected]"
Loading