Skip to content

Commit a9caa2d

Browse files
authored
Enable jitting in pcre2 (#11195)
This corresponds to an issue on PCRE2 regarding fuzzer improvements w.r.t. JIT: PCRE2Project/pcre2#317
1 parent c58ac44 commit a9caa2d

File tree

2 files changed

+35
-3
lines changed

2 files changed

+35
-3
lines changed

projects/pcre2/build.sh

+33-3
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,43 @@
1717

1818
# build project
1919
./autogen.sh
20-
./configure --enable-fuzz-support --enable-never-backslash-C --with-match-limit=1000 --with-match-limit-depth=1000
20+
./configure --enable-fuzz-support \
21+
--enable-never-backslash-C --with-match-limit=1000 --with-match-limit-depth=1000 \
22+
--enable-jit \
23+
--enable-pcre2-16 --enable-pcre2-32
2124
make -j$(nproc) clean
2225
make -j$(nproc) all
2326

24-
# build fuzzer
27+
# build fuzzers
2528
$CXX $CXXFLAGS -o $OUT/pcre2_fuzzer \
2629
$LIB_FUZZING_ENGINE .libs/libpcre2-fuzzsupport.a .libs/libpcre2-8.a
30+
$CXX $CXXFLAGS -o $OUT/pcre2_fuzzer_16 \
31+
$LIB_FUZZING_ENGINE .libs/libpcre2-fuzzsupport-16.a .libs/libpcre2-16.a
32+
$CXX $CXXFLAGS -o $OUT/pcre2_fuzzer_32 \
33+
$LIB_FUZZING_ENGINE .libs/libpcre2-fuzzsupport-32.a .libs/libpcre2-32.a
34+
35+
# test different link sizes
36+
for i in $(seq 3 4); do
37+
./configure --enable-fuzz-support \
38+
--enable-never-backslash-C --with-match-limit=1000 --with-match-limit-depth=1000 \
39+
--enable-jit \
40+
--enable-pcre2-16 --enable-pcre2-32 --with-link-size=${i}
41+
make -j$(nproc) clean
42+
make -j$(nproc) all
43+
44+
# build fuzzers
45+
$CXX $CXXFLAGS -o $OUT/pcre2_fuzzer_${i}l \
46+
$LIB_FUZZING_ENGINE .libs/libpcre2-fuzzsupport.a .libs/libpcre2-8.a
47+
$CXX $CXXFLAGS -o $OUT/pcre2_fuzzer_16_${i}l \
48+
$LIB_FUZZING_ENGINE .libs/libpcre2-fuzzsupport-16.a .libs/libpcre2-16.a
49+
$CXX $CXXFLAGS -o $OUT/pcre2_fuzzer_32_${i}l \
50+
$LIB_FUZZING_ENGINE .libs/libpcre2-fuzzsupport-32.a .libs/libpcre2-32.a
51+
done
2752

2853
# set up dictionary and options to use it
29-
cp pcre2_fuzzer.options pcre2_fuzzer.dict $OUT/
54+
for bits in "" "_16" "_32"; do
55+
cp "pcre2_fuzzer${bits}.dict" "${OUT}/pcre2_fuzzer${bits}.dict"
56+
for linksize in "" "_3l" "_4l"; do
57+
cp "pcre2_fuzzer${bits}.options" "${OUT}/pcre2_fuzzer${bits}${linksize}.options"
58+
done
59+
done

projects/pcre2/project.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ sanitizers:
1212
architectures:
1313
- x86_64
1414
- i386
15+
auto_ccs:
16+

0 commit comments

Comments
 (0)