mirror of
git://github.com/lxc/lxc
synced 2025-09-04 00:49:31 +00:00
build-system: turn off lto=thin when building the fuzzers
With lto=thin the fuzzers fail as soon as they start with ``` ERROR: The size of coverage PC tables does not match the number of instrumented PCs. This might be a compiler bug, please contact the libFuzzer developers. Also check https://bugs.llvm.org/show_bug.cgi?id=34636 for possible workarounds (tl;dr: don't use the old GNU ld) ``` Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
This commit is contained in:
15
configure.ac
15
configure.ac
@@ -484,12 +484,16 @@ else
|
|||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "x$enable_fuzzers" = "xyes" -a "x$LIB_FUZZING_ENGINE" = x; then
|
if test "x$enable_fuzzers" = "xyes"; then
|
||||||
CC_CHECK_FLAGS_APPEND([AM_CFLAGS],[CFLAGS],[ \
|
if test "x$LIB_FUZZING_ENGINE" = x; then
|
||||||
-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION \
|
CC_CHECK_FLAGS_APPEND([AM_CFLAGS],[CFLAGS],[ \
|
||||||
-fsanitize=fuzzer-no-link])
|
-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION \
|
||||||
AC_SUBST(AM_CFLAGS)
|
-fsanitize=fuzzer-no-link])
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
CC_CHECK_FLAGS_APPEND([AM_CFLAGS],[CFLAGS],[-flto=thin])
|
||||||
fi
|
fi
|
||||||
|
AC_SUBST(AM_CFLAGS)
|
||||||
|
|
||||||
# Optional test binaries
|
# Optional test binaries
|
||||||
AC_ARG_ENABLE([tests],
|
AC_ARG_ENABLE([tests],
|
||||||
@@ -815,7 +819,6 @@ CC_CHECK_FLAGS_APPEND([AM_CFLAGS],[CFLAGS],[ \
|
|||||||
-Warray-bounds \
|
-Warray-bounds \
|
||||||
-Wrestrict \
|
-Wrestrict \
|
||||||
-Wreturn-local-addr \
|
-Wreturn-local-addr \
|
||||||
-flto=thin \
|
|
||||||
-fsanitize=cfi \
|
-fsanitize=cfi \
|
||||||
-Wstringop-overflow])
|
-Wstringop-overflow])
|
||||||
AC_SUBST(AM_CFLAGS)
|
AC_SUBST(AM_CFLAGS)
|
||||||
|
@@ -24,9 +24,6 @@ mkdir -p $OUT
|
|||||||
|
|
||||||
export LIB_FUZZING_ENGINE=${LIB_FUZZING_ENGINE:--fsanitize=fuzzer}
|
export LIB_FUZZING_ENGINE=${LIB_FUZZING_ENGINE:--fsanitize=fuzzer}
|
||||||
|
|
||||||
# AFL++ and hoggfuzz are both incompatible with lto=thin apparently
|
|
||||||
sed -i '/-flto=thin/d' configure.ac
|
|
||||||
|
|
||||||
# turn off the libutil dependency
|
# turn off the libutil dependency
|
||||||
sed -i 's/^AC_CHECK_LIB(util/#/' configure.ac
|
sed -i 's/^AC_CHECK_LIB(util/#/' configure.ac
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user