Skip to content

Commit eeae861

Browse files
committed
feat: use meson to build dnsdist fuzz targets
This should fix the Fuzz errors in PowerDNS/pdns#17010
1 parent 007df06 commit eeae861

2 files changed

Lines changed: 21 additions & 11 deletions

File tree

projects/powerdns/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
FROM gcr.io/oss-fuzz-base/base-builder
1919

2020
# install required packages to build your project
21-
RUN apt-get update && apt-get install -y autoconf automake bison dh-autoreconf flex libluajit-5.1-dev libedit-dev libprotobuf-dev libssl-dev libtool make pkg-config protobuf-compiler ragel
21+
RUN apt-get update && apt-get install -y autoconf automake bison dh-autoreconf flex libluajit-5.1-dev libedit-dev libprotobuf-dev libssl-dev libtool make pkg-config protobuf-compiler ragel meson ninja-build
2222
RUN wget https://archives.boost.io/release/1.84.0/source/boost_1_84_0.tar.bz2 # Temporarily use manual installation over the outdated libboost-dev package
2323

2424
# checkout all sources needed to build your project

projects/powerdns/build.sh

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,29 @@ cp fuzz_target_* "${OUT}/"
5858
# build the dnsdist fuzzing target, if any
5959
if [ -f dnsdistdist/fuzz_dnsdistcache.cc ]; then
6060
cd dnsdistdist
61-
sed -i 's/AC_CC_PIE//' configure.ac
62-
autoreconf -vi
63-
./configure \
64-
--enable-fuzz-targets \
65-
--disable-dependency-tracking \
66-
--disable-silent-rules || /bin/bash
67-
if [ -d ext/arc4random/ ]; then
68-
make -j$(nproc) -C ext/arc4random/
61+
build_dir='.'
62+
if [ -f configure.ac ]; then
63+
sed -i 's/AC_CC_PIE//' configure.ac
64+
autoreconf -vi
65+
./configure \
66+
--enable-fuzz-targets \
67+
--disable-dependency-tracking \
68+
--disable-silent-rules || /bin/bash
69+
if [ -d ext/arc4random/ ]; then
70+
make -j$(nproc) -C ext/arc4random/
71+
fi
72+
make -j$(nproc) fuzz_targets
73+
else
74+
build_dir='build'
75+
sed -i "/'b_pie=true',/d" meson.build
76+
meson setup \
77+
-D fuzz-targets=true \
78+
${build_dir}
79+
meson compile -C ${build_dir} fuzz-targets
6980
fi
70-
make -j$(nproc) fuzz_targets
7181

7282
# copy the fuzzing target binaries
73-
cp fuzz_target_* "${OUT}/"
83+
cp ${build_dir}/fuzz_target_* "${OUT}/"
7484

7585
# back to the pdns/ directory
7686
cd ..

0 commit comments

Comments
 (0)