mirror of
https://github.com/strongswan/strongswan.git
synced 2025-10-04 00:00:14 -04:00
fuzz: Support build with -fsanitize=fuzzer instead of libFuzzer.a
Recent clang versions (6.0+) include libFuzzer and OSS-Fuzz switched to that mode a while ago.
This commit is contained in:
parent
de07b77442
commit
05e3751ebb
16
configure.ac
16
configure.ac
@ -63,7 +63,7 @@ ARG_WITH_SUBST([routing-table], [220], [set routing table to use for IPsec
|
|||||||
ARG_WITH_SUBST([routing-table-prio], [220], [set priority for IPsec routing table])
|
ARG_WITH_SUBST([routing-table-prio], [220], [set priority for IPsec routing table])
|
||||||
ARG_WITH_SUBST([ipsec-script], [ipsec], [change the name of the ipsec script])
|
ARG_WITH_SUBST([ipsec-script], [ipsec], [change the name of the ipsec script])
|
||||||
ARG_WITH_SUBST([fips-mode], [0], [set openssl FIPS mode: disabled(0), enabled(1), Suite B enabled(2)])
|
ARG_WITH_SUBST([fips-mode], [0], [set openssl FIPS mode: disabled(0), enabled(1), Suite B enabled(2)])
|
||||||
ARG_WITH_SUBST([libfuzzer], [], [path to libFuzzer.a])
|
ARG_WITH_SUBST([libfuzzer], [], [-fsanitize=fuzzer or path to libFuzzer.a, a local driver is used if not specified])
|
||||||
ARG_WITH_SET([capabilities], [no], [set capability dropping library. Currently supported values are "libcap" and "native"])
|
ARG_WITH_SET([capabilities], [no], [set capability dropping library. Currently supported values are "libcap" and "native"])
|
||||||
ARG_WITH_SET([mpz_powm_sec], [yes], [use the more side-channel resistant mpz_powm_sec in libgmp, if available])
|
ARG_WITH_SET([mpz_powm_sec], [yes], [use the more side-channel resistant mpz_powm_sec in libgmp, if available])
|
||||||
ARG_WITH_SET([dev-headers], [no], [install strongSwan development headers to directory.])
|
ARG_WITH_SET([dev-headers], [no], [install strongSwan development headers to directory.])
|
||||||
@ -1294,18 +1294,26 @@ if test x$coverage = xtrue; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if test x$fuzzing = xtrue; then
|
if test x$fuzzing = xtrue; then
|
||||||
if test x$libfuzzer = x; then
|
case "$libfuzzer" in
|
||||||
|
"")
|
||||||
AC_MSG_NOTICE([fuzz targets enabled without libFuzzer, using local driver])
|
AC_MSG_NOTICE([fuzz targets enabled without libFuzzer, using local driver])
|
||||||
CFLAGS="${CFLAGS} -fsanitize=address"
|
CFLAGS="${CFLAGS} -fsanitize=address"
|
||||||
libfuzzer="libFuzzerLocal.a"
|
libfuzzer="libFuzzerLocal.a"
|
||||||
else
|
;;
|
||||||
|
"-fsanitize=fuzzer")
|
||||||
|
libfuzzer=""
|
||||||
|
FUZZING_CFLAGS="-fsanitize=fuzzer"
|
||||||
|
AC_SUBST(FUZZING_CFLAGS)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
# required for libFuzzer
|
# required for libFuzzer
|
||||||
FUZZING_LDFLAGS="-stdlib=libc++ -lstdc++"
|
FUZZING_LDFLAGS="-stdlib=libc++ -lstdc++"
|
||||||
if test "$SANITIZER" = "coverage"; then
|
if test "$SANITIZER" = "coverage"; then
|
||||||
FUZZING_LDFLAGS="$FUZZING_LDFLAGS -lm"
|
FUZZING_LDFLAGS="$FUZZING_LDFLAGS -lm"
|
||||||
fi
|
fi
|
||||||
AC_SUBST(FUZZING_LDFLAGS)
|
AC_SUBST(FUZZING_LDFLAGS)
|
||||||
fi
|
;;
|
||||||
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test x$ruby_gems = xtrue; then
|
if test x$ruby_gems = xtrue; then
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
AM_CPPFLAGS = @CPPFLAGS@ \
|
AM_CPPFLAGS = @CPPFLAGS@ \
|
||||||
|
@FUZZING_CFLAGS@ \
|
||||||
-I$(top_srcdir)/src/libstrongswan \
|
-I$(top_srcdir)/src/libstrongswan \
|
||||||
-I$(top_srcdir)/src/libimcv \
|
-I$(top_srcdir)/src/libimcv \
|
||||||
-I$(top_srcdir)/src/libtncif \
|
-I$(top_srcdir)/src/libtncif \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user