oss-fuzz: convert to static cross-build

This way we can get rid of the pre-generated locale data and the
special fuzzers target, which invokes a full gbuild make for
every prereqisite, always parsing the whole tree, taking ages.

This also reverts:
- commit d0780b21cf ("fix oss-fuzz
  build") by adding epubgen and revenge dependencies.
- commit ff25d6a123 ("ofz#41602 fix
  more build failure"), which shouldn't happen anymore since
  commit d47628f287 ("don't want to
  link to system static libs for DISABLE_DYNLOADING")

Change-Id: I3aed9ec62da507254b42e4e7470bae1097b4bc8c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127031
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
This commit is contained in:
Jan-Marek Glogowski 2021-12-12 22:03:49 +01:00
parent fa5db38ae5
commit 37106f20bd
14 changed files with 24 additions and 24 deletions

View file

@ -504,8 +504,6 @@ $(BUILDDIR)/vs-code.code-workspace: $(BUILDDIR)/vs-code.code-workspace.template
@test -e $@ || cp $< $@ && \
cmp -s $@ $< || echo "ATTN: $(@F) differs from $(<F), please check yourself for changes"
fuzzers: StaticLibrary_dtoa StaticLibrary_zlib StaticLibrary_libjpeg-turbo Library_sal Library_salhelper Library_reg Library_store Library_unoidl codemaker Library_cppu Library_i18nlangtag Library_cppuhelper Library_comphelper StaticLibrary_ulingu StaticLibrary_findsofficepath Library_tl Library_basegfx Library_canvastools Library_cppcanvas Library_dbtools Library_deploymentmisc Library_editeng Library_i18nutil Library_localebe1 Library_sax Library_sofficeapp Library_ucbhelper Rdb_services udkapi offapi Library_icg Library_reflection Library_invocadapt Library_bootstrap Library_introspection Library_stocservices Library_xmlreader Library_gcc3_uno instsetoo_native StaticLibrary_boost_locale StaticLibrary_fuzzerstubs StaticLibrary_fuzzer_core StaticLibrary_fuzzer_calc StaticLibrary_fuzzer_draw StaticLibrary_fuzzer_writer StaticLibrary_fuzzer_math Library_forui Library_binaryurp Library_io Library_invocation Library_namingservice Library_proxyfac Library_uuresolver Module_ure Library_wpftwriter Library_sb Library_file Library_avmedia Executable_pptfuzzer Executable_cgmfuzzer Executable_ww2fuzzer Executable_ww6fuzzer Executable_ww8fuzzer Executable_qpwfuzzer Executable_slkfuzzer Executable_fodtfuzzer Executable_fodsfuzzer Executable_fodpfuzzer Executable_xlsfuzzer Executable_scrtffuzzer Executable_wksfuzzer Executable_diffuzzer Executable_docxfuzzer Executable_xlsxfuzzer Executable_pptxfuzzer Executable_htmlfuzzer Executable_rtffuzzer Executable_mmlfuzzer Executable_mtpfuzzer Executable_olefuzzer Executable_lwpfuzzer Executable_hwpfuzzer Executable_wmffuzzer Executable_dxffuzzer Executable_sftfuzzer Executable_svmfuzzer Executable_tiffuzzer Executable_epsfuzzer Executable_jpgfuzzer Executable_metfuzzer Executable_bmpfuzzer Executable_giffuzzer Executable_pngfuzzer Executable_602fuzzer Executable_tgafuzzer Executable_pcxfuzzer Executable_psdfuzzer Executable_ppmfuzzer Executable_pcdfuzzer Executable_rasfuzzer Executable_pctfuzzer Executable_xpmfuzzer Executable_xbmfuzzer Executable_dbffuzzer
endif # MAKE_RESTARTS
# vim: set noet sw=4 ts=4:

View file

@ -12,10 +12,14 @@ echo start at `date -u`
#shuffle CXXFLAGS -stdlib=libc++ arg into CXX as well because we use
#the CXX as the linker and need to pass -stdlib=libc++ to build
export CXX="$CXX -stdlib=libc++ -fsanitize-blacklist=$SRC/libreoffice/bin/sanitize-excludelist.txt"
export CXX_FOR_BUILD="$CXX"
export CC="$CC -fsanitize-blacklist=$SRC/libreoffice/bin/sanitize-excludelist.txt"
export CC_FOR_BUILD="$CC"
#similarly force the -fsanitize etc args in as well as pthread to get
#things to link successfully during the build
export LDFLAGS="$CFLAGS -Wl,--compress-debug-sections,zlib -lpthread"
#build-time rsc tool leaks a titch
export ASAN_OPTIONS="detect_leaks=0"
df -h $OUT $WORK
@ -24,10 +28,7 @@ $SRC/libreoffice/autogen.sh --with-distro=LibreOfficeOssFuzz --with-external-tar
make clean
#build-time rsc tool leaks a titch
export ASAN_OPTIONS="detect_leaks=0"
make fuzzers
make
pushd instdir/program
head -c -14 services.rdb > templateservices.rdb

View file

@ -3799,7 +3799,7 @@ if test -n "$WIN_MULTI_ARCH" -a -n "$WIN_OTHER_ARCH"; then
fi
if test "$build_cpu" != "$host_cpu" -o \( "$DISABLE_DYNLOADING" = TRUE -a "$enable_fuzzers" != yes \); then
if test "$build_cpu" != "$host_cpu" -o "$DISABLE_DYNLOADING" = TRUE; then
# To allow building Windows multi-arch releases without cross-tooling
if test "$DISABLE_DYNLOADING" = TRUE -o \( -z "$WIN_MULTI_ARCH" -a -z "$WIN_OTHER_ARCH" \); then
cross_compiling="yes"
@ -9574,7 +9574,7 @@ else
LIBXML_LIBS="${WORKDIR}/UnpackedTarball/libxml2/win32/bin.msvc/libxml2.lib"
else
LIBXML_LIBS="-L${WORKDIR}/UnpackedTarball/libxml2/.libs -lxml2"
if test "$DISABLE_DYNLOADING" = TRUE -a "$ENABLE_FUZZERS" != "TRUE"; then
if test "$DISABLE_DYNLOADING" = TRUE; then
LIBXML_LIBS="$LIBXML_LIBS -lm"
fi
fi

View file

@ -100,9 +100,11 @@ $(eval $(call gb_Module_add_targets,desktop,\
else ifeq (,$(filter MACOSX ANDROID iOS HAIKU,$(OS)))
ifeq (,$(filter FUZZERS,$(BUILD_TYPE)))
$(eval $(call gb_Module_add_targets,desktop,\
Executable_oosplash \
))
endif
endif

View file

@ -8,6 +8,7 @@
--disable-cups
--disable-dbus
--disable-dconf
--disable-extensions
--disable-firebird-sdbc
--disable-gio
--disable-gtk3
@ -29,5 +30,6 @@
--with-locales=en
--with-system-lockfile
--without-fonts
--without-galleries
--without-java
--without-webdav

View file

@ -12,10 +12,12 @@ $(eval $(call gb_Module_Module,smoketest))
ifeq ($(CROSS_COMPILING),)
ifneq (,$(filter DESKTOP,$(BUILD_TYPE)))
$(eval $(call gb_Module_add_targets,smoketest,\
Library_smoketest \
Zip_smoketestdoc \
))
endif
ifneq ($(ENABLE_JAVA),)
ifneq ($(filter EXTENSIONS,$(BUILD_TYPE)),)

View file

@ -19,6 +19,8 @@ $(eval $(call gb_Executable_use_api,docxfuzzer,\
$(eval $(call gb_Executable_use_externals,docxfuzzer,\
$(fuzzer_externals) \
epubgen \
revenge \
))
$(eval $(call gb_Executable_set_include,docxfuzzer,\

View file

@ -19,6 +19,8 @@ $(eval $(call gb_Executable_use_api,fodtfuzzer,\
$(eval $(call gb_Executable_use_externals,fodtfuzzer,\
$(fuzzer_externals) \
epubgen \
revenge \
))
$(eval $(call gb_Executable_set_include,fodtfuzzer,\

View file

@ -19,6 +19,8 @@ $(eval $(call gb_Executable_use_api,htmlfuzzer,\
$(eval $(call gb_Executable_use_externals,htmlfuzzer,\
$(fuzzer_externals) \
epubgen \
revenge \
))
$(eval $(call gb_Executable_set_include,htmlfuzzer,\

View file

@ -29,7 +29,7 @@ $(eval $(call gb_Module_add_targets,vcl,\
Package_opengl_denylist ) \
$(if $(filter SKIA,$(BUILD_TYPE)), \
Package_skia_denylist ) \
$(if $(filter DESKTOP,$(BUILD_TYPE)), \
$(if $(filter DESKTOP FUZZERS,$(BUILD_TYPE)), \
StaticLibrary_vclmain \
$(if $(DISABLE_GUI),, \
$(if $(filter LINUX MACOSX SOLARIS WNT %BSD,$(OS)), \
@ -151,7 +151,6 @@ $(eval $(call gb_Module_add_targets,vcl,\
CustomTarget_nativedraw \
CustomTarget_nativewriter \
CustomTarget_nativemath \
StaticLibrary_fuzzerstubs \
StaticLibrary_fuzzer_core \
StaticLibrary_fuzzer_calc \
StaticLibrary_fuzzer_draw \

View file

@ -44,7 +44,6 @@ fuzzer_externals = \
fuzzer_statics = \
findsofficepath \
fuzzerstubs \
ulingu \
fuzzer_core_libraries = \
@ -150,6 +149,9 @@ fuzzer_core_libraries = \
gcc3_uno \
salhelper \
sal \
index_data \
localedata_en \
localedata_others \
fuzzer_calc_libraries = \
analysis \

View file

@ -16,11 +16,6 @@ extern "C" void* SwCreateDialogFactory()
return nullptr;
}
extern "C" void* com_sun_star_comp_Writer_EPUBExportFilter_get_implementation()
{
return nullptr;
}
extern "C" bool TestImportDOCX(SvStream &rStream);
extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv)

View file

@ -16,11 +16,6 @@ extern "C" void* SwCreateDialogFactory()
return nullptr;
}
extern "C" void* com_sun_star_comp_Writer_EPUBExportFilter_get_implementation()
{
return nullptr;
}
extern "C" bool TestImportFODT(SvStream &rStream);
extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv)

View file

@ -13,8 +13,6 @@
extern "C" void* SwCreateDialogFactory() { return nullptr; }
extern "C" void* com_sun_star_comp_Writer_EPUBExportFilter_get_implementation() { return nullptr; }
extern "C" bool TestImportHTML(SvStream& rStream);
extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv)