Commit 5ffccf1641 for bind
commit 5ffccf164151877bedf5e8391ebc9488f5146671
Author: Michal Nowak <mnowak@isc.org>
Date: Mon Aug 10 16:08:38 2026 +0000
Require an AFL compiler for the "afl" fuzzing backend
Selecting -Dfuzzing-backend=afl without an AFL compiler wrapper leaves
__AFL_COMPILER undefined, which makes fuzz/main.c compile to nothing and
the fuzz binaries fail to link with a bare "undefined reference to
`main'". Detect that at configuration time, where it can still be
explained.
Assisted-by: Claude:claude-opus-5
diff --git a/meson.build b/meson.build
index f76fdf45a5..538721144f 100644
--- a/meson.build
+++ b/meson.build
@@ -460,6 +460,15 @@ endif
fuzz_link_args = []
if fuzzing_backend_opt == 'afl'
+ # Without an AFL compiler wrapper, __AFL_COMPILER is not defined,
+ # fuzz/main.c compiles to nothing and the fuzz binaries fail to link with
+ # a bare "undefined reference to `main'". Say so while it can still be
+ # explained.
+ assert(
+ afl_compiler,
+ 'the "afl" fuzzing backend requires an AFL compiler, e.g. CC=afl-cc',
+ )
+
config.set('FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION', 1)
config.set('ENABLE_AFL', 1)
elif fuzzing_backend_opt == 'libfuzzer'