mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-16 05:10:03 +01:00
Rework build of fuzzers.
- Do not require any libraries installed, download everything from upstream git, statically compile (use include, libs and pkg-config from local directory under tests/fuzz). Script should work both from OSS-Fuzz and locally. - Do not require local protobuf (only staticallly compiled, see above). - Add README.md (TBD, still not finished). - Fix make dist and distcheck. - Remove common.[ch] as we can use internal function. This makes fuzzers also C++ only (remove CFLAGS from Makefile).
This commit is contained in:
18
configure.ac
18
configure.ac
@@ -215,27 +215,16 @@ if test "x$enable_pwquality" = "xyes"; then
|
||||
fi
|
||||
|
||||
dnl ==========================================================================
|
||||
dnl libprotobuf-fuzzer library
|
||||
dnl fuzzers, it requires own static library compilation later
|
||||
AC_ARG_ENABLE([fuzz-targets],
|
||||
AS_HELP_STRING([--enable-fuzz-targets], [enable building fuzz targets]))
|
||||
AM_CONDITIONAL(ENABLE_FUZZ_TARGETS, test "x$enable_fuzz_targets" = "xyes")
|
||||
|
||||
if test "x$enable_fuzz_targets" = "xyes"; then
|
||||
if test "x$CC" != "xclang" || test "x$CXX" != "xclang++"; then
|
||||
AC_MSG_ERROR([Building fuzz targets is only supported using clang. Please set CC=clang CXX=clang++])
|
||||
fi
|
||||
PKG_CHECK_MODULES([PROTOBUF], [protobuf],,
|
||||
AC_MSG_ERROR([You need protobuf library to build fuzz targets.]))
|
||||
AC_SUBST([PROTOBUF_LIBS])
|
||||
|
||||
PKG_CHECK_MODULES([LIBPROTOBUF_MUTATOR], [ libprotobuf-mutator ],,
|
||||
AC_MSG_ERROR([You need libprotobuf-mutator library to build fuzz targets.]))
|
||||
AC_SUBST([LIBPROTOBUF_MUTATOR_LIBS])
|
||||
AC_SUBST([LIBPROTOBUF_MUTATOR_CFLAGS])
|
||||
AC_CONFIG_FILES([tests/fuzz/Makefile])
|
||||
AX_CHECK_COMPILE_FLAG([-fsanitize=fuzzer-no-link],,
|
||||
AC_MSG_ERROR([Required compiler options not supported; use clang.]), [-Werror])
|
||||
fi
|
||||
|
||||
|
||||
dnl ==========================================================================
|
||||
dnl passwdqc library (cryptsetup CLI only)
|
||||
AC_ARG_ENABLE([passwdqc],
|
||||
@@ -778,5 +767,6 @@ lib/libcryptsetup.pc
|
||||
po/Makefile.in
|
||||
scripts/cryptsetup.conf
|
||||
tests/Makefile
|
||||
tests/fuzz/Makefile
|
||||
])
|
||||
AC_OUTPUT
|
||||
|
||||
Reference in New Issue
Block a user