mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 22:45:39 +00:00
Add explicit support of OSS-Fuzz
The --enable-fuzzing option now allows third choice "ossfuzz" that just adds $LIB_FUZZING_ENGINE to FUZZ_LDFLAGS to make the fuzzer builds compatible with OSS-Fuzz project that has some special quirks (the main() routine is provided in the static library the project provides).
This commit is contained in:
@@ -200,7 +200,7 @@ AC_ARG_ENABLE(buffer_useinline,
|
|||||||
AC_DEFINE([ISC_BUFFER_USEINLINE], [1]))
|
AC_DEFINE([ISC_BUFFER_USEINLINE], [1]))
|
||||||
|
|
||||||
AC_ARG_ENABLE([fuzzing],
|
AC_ARG_ENABLE([fuzzing],
|
||||||
[AS_HELP_STRING([--enable-fuzzing=<afl|libfuzzer>],
|
[AS_HELP_STRING([--enable-fuzzing=<afl|libfuzzer|ossfuzz>],
|
||||||
[Enable fuzzing using American Fuzzy Lop or libFuzzer (default=no)])],
|
[Enable fuzzing using American Fuzzy Lop or libFuzzer (default=no)])],
|
||||||
[],
|
[],
|
||||||
[enable_fuzzing=no])
|
[enable_fuzzing=no])
|
||||||
@@ -220,6 +220,9 @@ AS_CASE([$enable_fuzzing],
|
|||||||
LDFLAGS="$LDFLAGS -fsanitize=address,undefined"
|
LDFLAGS="$LDFLAGS -fsanitize=address,undefined"
|
||||||
FUZZ_LDFLAGS="-fsanitize=fuzzer,address,undefined"
|
FUZZ_LDFLAGS="-fsanitize=fuzzer,address,undefined"
|
||||||
FUZZ_LOG_COMPILER="libfuzzer.sh"],
|
FUZZ_LOG_COMPILER="libfuzzer.sh"],
|
||||||
|
[ossfuzz],[
|
||||||
|
AC_MSG_RESULT([using OSS-Fuzz])
|
||||||
|
FUZZ_LDFLAGS="$LIB_FUZZING_ENGINE"],
|
||||||
[*],[AC_MSG_ERROR([You need to explicitly select the fuzzer])])
|
[*],[AC_MSG_ERROR([You need to explicitly select the fuzzer])])
|
||||||
AM_CONDITIONAL([HAVE_FUZZ_LOG_COMPILER], [test -n "$FUZZ_LOG_COMPILER"])
|
AM_CONDITIONAL([HAVE_FUZZ_LOG_COMPILER], [test -n "$FUZZ_LOG_COMPILER"])
|
||||||
AC_SUBST([FUZZ_LOG_COMPILER])
|
AC_SUBST([FUZZ_LOG_COMPILER])
|
||||||
|
Reference in New Issue
Block a user