Upgrade fuzzers to LIB_FUZZING_ENGINE

Desktop / LibreOffice - Andrzej Hunt [ahunt.org] - 28 February 2021 18:46 UTC

And check that LIB_FUZZING_ENGINE is set during configure.

Because: 1. It's easier to build locally this way (you don't need to build or hack a libFuzzingEngine.a - instead you can just specify LIB_FUZZING_ENGINE=-fsanitize=fuzzer to produce a valid build). 2. Using -lFuzzingEngine is deprecated [1] for various reasons [2].

The old behaviour can be emulated if desired by setting LIB_FUZZING_ENGINE=-lFuzzingEngine .

This patch was tested as follows:- Building LO within oss-fuzz via: python infra/helper.py build_fuzzers --sanitizer address libreoffice python infra/helper.py check_build libreoffice- Building LO fuzzers standalone via: export CC="clang-11" export CXX="clang++-11 -stdlib=libc++" export CFLAGS="-fsanitize=address -fsanitize-address-use-after-scope -fsanitize=fuzzer-no-link -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION" export CXXFLAGS="$CFLAGS -stdlib=libc++" export LDFLAGS="$CFLAGS -Wl,--compress-debug-sections,zlib -lpthread" export LIB_FUZZING_ENGINE=-fsanitize=fuzzer ./autogen.sh --with-distro=LibreOfficeOssFuzz --with-system-libxml make fuzzers (--with-system-libxml only appears to be needed because of issues specific to my build environment/Suse 15.2. I'm invoking clang-11 simply because that's the most modern clang I have installed, plain clang should also work on most sufficiently modern systems).

[1] https://github.com/google/oss-fuzz/blob/481280c65048fd12fb2141b9225af511a9ef7ed2/infra/presubmit.py#L46 [2] https://github.com/google/oss-fuzz/issues/2164

Change-Id: Iddb577c30a39620e72372ef6c2d3fda67f8aabdf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111691

44b36a0602b0 Upgrade fuzzers to LIB_FUZZING_ENGINE
config_host.mk.in | 1 +
configure.ac | 4 ++++
vcl/Executable_602fuzzer.mk | 2 +-
vcl/Executable_bmpfuzzer.mk | 2 +-
vcl/Executable_cgmfuzzer.mk | 2 +-
vcl/Executable_diffuzzer.mk | 2 +-
vcl/Executable_docxfuzzer.mk | 2 +-
vcl/Executable_dxffuzzer.mk | 2 +-
vcl/Executable_epsfuzzer.mk | 2 +-
vcl/Executable_fodpfuzzer.mk | 2 +-
vcl/Executable_fodsfuzzer.mk | 2 +-
vcl/Executable_fodtfuzzer.mk | 2 +-
vcl/Executable_giffuzzer.mk | 2 +-
vcl/Executable_htmlfuzzer.mk | 2 +-
vcl/Executable_hwpfuzzer.mk | 2 +-
vcl/Executable_jpgfuzzer.mk | 2 +-
vcl/Executable_lwpfuzzer.mk | 2 +-
vcl/Executable_metfuzzer.mk | 2 +-
vcl/Executable_mmlfuzzer.mk | 2 +-
vcl/Executable_mtpfuzzer.mk | 2 +-
vcl/Executable_olefuzzer.mk | 2 +-
vcl/Executable_pcdfuzzer.mk | 2 +-
vcl/Executable_pctfuzzer.mk | 2 +-
vcl/Executable_pcxfuzzer.mk | 2 +-
vcl/Executable_pngfuzzer.mk | 2 +-
vcl/Executable_ppmfuzzer.mk | 2 +-
vcl/Executable_pptfuzzer.mk | 2 +-
vcl/Executable_pptxfuzzer.mk | 2 +-
vcl/Executable_psdfuzzer.mk | 2 +-
vcl/Executable_qpwfuzzer.mk | 2 +-
vcl/Executable_rasfuzzer.mk | 2 +-
vcl/Executable_rtffuzzer.mk | 2 +-
vcl/Executable_scrtffuzzer.mk | 2 +-
vcl/Executable_sftfuzzer.mk | 2 +-
vcl/Executable_slkfuzzer.mk | 2 +-
vcl/Executable_svmfuzzer.mk | 2 +-
vcl/Executable_tgafuzzer.mk | 2 +-
vcl/Executable_tiffuzzer.mk | 2 +-
vcl/Executable_wksfuzzer.mk | 2 +-
vcl/Executable_wmffuzzer.mk | 2 +-
vcl/Executable_ww2fuzzer.mk | 2 +-
vcl/Executable_ww6fuzzer.mk | 2 +-
vcl/Executable_ww8fuzzer.mk | 2 +-
vcl/Executable_xbmfuzzer.mk | 2 +-
vcl/Executable_xlsfuzzer.mk | 2 +-
vcl/Executable_xlsxfuzzer.mk | 2 +-
vcl/Executable_xpmfuzzer.mk | 2 +-
47 files changed, 50 insertions(+), 45 deletions(-)

Upstream: cgit.freedesktop.org


  • Share