[Libreoffice-commits] core.git: Branch 'feature/wasm' - 1106 commits - accessibility/inc accessibility/Library_acc.mk accessibility/source avmedia/Library_avmedia.mk avmedia/Module_avmedia.mk avmedia/source basctl/Library_basctl.mk basctl/source basegfx/source basic/CppunitTest_basic_macros.mk basic/Library_sb.mk basic/qa basic/source binaryurp/source bin/check-missing-unittests.py bin/find-unneeded-includes bin/run bin/ui-rules-enforcer.py bridges/inc bridges/Library_cpp_uno.mk bridges/source canvas/Module_canvas.mk canvas/source chart2/CppunitTest_chart2_pivot_chart_test.mk chart2/export_setup.mk chart2/IwyuFilter_chart2.yaml chart2/Library_chartcontroller.mk chart2/Library_chartcore.mk chart2/qa chart2/source chart2/uiconfig codemaker/source comphelper/qa comphelper/source compilerplugins/clang config_host/config_features.h.in config_host/config_wasm_strip.h.in config_host.mk.in configmgr/source configure.ac connectivity/Library_postgresql-sdbc-impl.mk connectivity/source cppuhelper/source cpp u/source cpputools/Module_cpputools.mk cui/inc cui/Library_cui.mk cui/qa cui/source cui/uiconfig cui/UIConfig_cui.mk dbaccess/Module_dbaccess.mk dbaccess/source desktop/CustomTarget_soffice.mk desktop/Executable_soffice_bin.mk desktop/Library_deployment.mk desktop/Module_desktop.mk desktop/Package_scripts.mk desktop/Pagein_common.mk desktop/scripts desktop/source desktop/unx dictionaries distro-configs/LibreOfficeOssFuzz.conf distro-configs/LibreOfficeWASM32.conf download.lst drawinglayer/Library_drawinglayer.mk drawinglayer/source editeng/inc editeng/Library_editeng.mk editeng/qa editeng/source embeddedobj/source embedserv/source emfio/qa eventattacher/source extensions/Library_bib.mk extensions/Module_extensions.mk extensions/source extensions/uiconfig external/breakpad external/clucene external/ct2n external/curl external/harfbuzz external/hunspell external/hyphen external/libnumbertext external/libxml2 external/Module_external.mk external/pdfium external/poppler external/python3 external/redland extras/Module_extras.mk extras/source filter/Configuration_filter.mk filter/Library_icg.mk filter/source filter/uiconfig forms/source formula/source fpicker/source framework/inc framework/Library_fwk.mk framework/qa framework/source framework/util g .git-blame-ignore-revs .gitignore helpcompiler/Module_helpcompiler.mk helpcontent2 hwpfilter/source i18nlangtag/qa i18nlangtag/source i18npool/CustomTarget_breakiterator.mk i18npool/inc i18npool/Library_collator_data.mk i18npool/Library_dict_ja.mk i18npool/Library_dict_zh.mk i18npool/Library_i18npool.mk i18npool/Library_index_data.mk i18npool/Library_localedata_en.mk i18npool/Library_localedata_es.mk i18npool/Library_localedata_euro.mk i18npool/Library_localedata_others.mk i18npool/Library_textconv_dict.mk i18npool/source i18npool/util i18nutil/source icon-themes/breeze icon-themes/breeze_dark icon-themes/breeze_dark_svg icon-themes/breeze_svg icon-themes/colibre icon-themes/colibre_svg icon-themes/elementary icon-theme s/elementary_svg idlc/source idl/source include/com include/comphelper include/editeng include/formula include/i18nlangtag include/i18nutil include/oox include/rtl include/sfx2 include/svl include/svtools include/svx include/tools include/unotest include/unotools include/vcl include/xmloff jvmfwk/CppunitTest_jvmfwk_sunversion.mk jvmfwk/Module_jvmfwk.mk jvmfwk/plugins jvmfwk/qa l10ntools/source leak-suppress.txt lingucomponent/Library_guesslang.mk lingucomponent/Module_lingucomponent.mk linguistic/source logerrit lotuswordpro/source m4/libo_externals.m4 Makefile.fetch Makefile.gbuild Makefile.in nlpsolver/src nlpsolver/ThirdParty odk/CustomTarget_build-examples.mk odk/docs odk/examples odk/Package_examples.mk offapi/com offapi/UnoApi_offapi.mk officecfg/registry oox/CppunitTest_oox_drawingml.mk oox/CppunitTest_oox_tokenmap.mk oox/Library_oox.mk oox/qa oox/source oox/util package/inc package/source postprocess/CustomTarget_components.mk postprocess/CustomTarget_registry.mk postprocess /Module_postprocess.mk postprocess/Rdb_services.mk readlicense_oo/license README.help.md README.wasm registry/Module_registry.mk registry/source reportdesign/source RepositoryExternal.mk RepositoryFixes.mk Repository.mk RepositoryModule_build.mk RepositoryModule_host.mk sal/Library_cppunitmain.mk sal/Library_sal.mk sal/Library_sal_textenc.mk sal/Module_sal.mk sal/osl sal/qa sal/rtl sax/source scaddins/source sccomp/Module_sccomp.mk sc/CppunitTest_sc_bugfix_test.mk sc/CppunitTest_sc_filters_test.mk sc/CppunitTest_sc_macros_test.mk sc/CppunitTest_sc_pivottable_filters_test.mk sc/CppunitTest_sc_uicalc.mk schema/libreoffice sc/inc sc/Library_sc.mk sc/Library_scui.mk sc/Module_sc.mk scp2/source sc/qa scripting/Module_scripting.mk scripting/source sc/source sc/subsequent_setup.mk sc/uiconfig sc/UIConfig_scalc.mk sc/UITest_csv_dialog.mk sc/UITest_pasteSpecial.mk sc/UITest_textToColumns.mk sd/CppunitTest_sd_import_tests.mk sd/CppunitTest_sd_import_tests_smartart.mk sd/CppunitTest_sd_misc_te sts.mk sd/CppunitTest_sd_tiledrendering.mk sd/export_setup.mk sdext/CppunitTest_sdext_pdfimport.mk sdext/Executable_xpdfimport.mk sdext/source sd/inc sd/Library_sd.mk sd/Library_sdui.mk sd/qa sd/source sd/uiconfig sd/UIConfig_simpress.mk sfx2/inc sfx2/Library_sfx.mk sfx2/qa sfx2/sdi sfx2/source sfx2/uiconfig sfx2/util shell/Module_shell.mk shell/source slideshow/source solenv/bin solenv/clang-format solenv/CompilerTest_compilerplugins_clang.mk solenv/Executable_lockfile.mk solenv/flatpak-manifest.in solenv/gbuild solenv/gdb solenv/lockfile solenv/Module_solenv.mk solenv/sanitizers soltools/cpp soltools/mkdepend starmath/inc starmath/qa starmath/source starmath/uiconfig static/CustomTarget_components.mk static/CustomTarget_wasm_fs_image.mk static/environment.js static/Library_components.mk static/Makefile static/Module_static.mk static/Package_wasm_fs_image.mk static/README stoc/source svgio/qa svgio/source svl/qa svl/source svtools/source svtools/uiconfig svx/inc svx/Library_svxcore .mk svx/Library_svx.mk svx/Module_svx.mk svx/qa svx/source svx/uiconfig svx/util sw/CppunitTest_sw_apitests.mk sw/CppunitTest_sw_macros_test.mk sw/CppunitTest_sw_odfexport2.mk sw/CppunitTest_sw_odfexport.mk sw/CppunitTest_sw_odfimport.mk sw/CppunitTest_sw_uwriter.mk sw/inc sw/Library_sw.mk sw/Library_swui.mk sw/ooxmlexport_setup.mk sw/qa sw/sdi sw/source sw/uiconfig sw/uiwriter_setup.mk sw/util sysui/desktop test/qa test/source toolkit/inc toolkit/source tools/inc tools/source translations ucbhelper/source ucb/source uitest/demo_ui uitest/impress_tests uitest/math_tests uitest/test_main.py uitest/uitest UnoControls/inc UnoControls/source unotest/source unotools/Library_utl.mk unotools/qa unotools/source ure/Package_install.mk ure/source vbahelper/source vcl/android vcl/backendtest vcl/CppunitTest_vcl_svm_test.mk vcl/headless vcl/inc vcl/ios vcl/jsdialog vcl/Library_vcl.mk vcl/Library_vclplug_gen.mk vcl/Library_vclplug_gtk3_kde5.mk vcl/Library_vclplug_gtk3.mk vcl/Library_vclplug_gtk4 .mk vcl/Library_vclplug_kf5.mk vcl/Library_vclplug_osx.mk vcl/Library_vclplug_qt5.mk vcl/Library_vclplug_win.mk vcl/Module_vcl.mk vcl/osx vcl/qa vcl/qt5 vcl/skia vcl/source vcl/uiconfig vcl/unx vcl/win wasm-qt/Module_wasm-qt.mk winaccessibility/source wizards/Package_scriptforge.mk wizards/Package_sfdocuments.mk wizards/source writerfilter/inc writerfilter/qa writerfilter/source writerperfect/Library_wpftwriter.mk writerperfect/Module_writerperfect.mk writerperfect/source xmlhelp/README.md xmlhelp/source xmloff/inc xmloff/Library_xof.mk xmloff/Library_xo.mk xmloff/source xmloff/util xmlsecurity/CppunitTest_xmlsecurity_signing.mk xmlsecurity/Library_xmlsecurity.mk xmlsecurity/Library_xsec_xmlsec.mk xmlsecurity/Module_xmlsecurity.mk xmlsecurity/source xmlsecurity/util

Jan-Marek Glogowski (via logerrit) logerrit at kemper.freedesktop.org
Fri Jul 23 13:06:01 UTC 2021


Rebased ref, commits from common ancestor:
commit 8498e9d617b652127e94d43e532800b2b0161ac9
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Fri Jul 23 14:17:26 2021 +0200
Commit:     Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Fri Jul 23 14:50:31 2021 +0200

    Create WASM FS image via gbuild
    
    README.wasm has a summary how to add files.
    Also renames static/debug.js to static/environment.js.
    
    Change-Id: If6804e282a37a37ffae1d291d2af8430e60b59d1

diff --git a/README.wasm b/README.wasm
index abe7c2af6f4e..3c9863da0e26 100644
--- a/README.wasm
+++ b/README.wasm
@@ -1,23 +1,3 @@
-= Manually updating the WASM FS image =
-
-.../git_emsdk/upstream/emscripten/tools/file_packager instdir/program/soffice.data --use-preload-plugins --preload instdir/program/*rc instdir/program/*.rdb instdir/program/services/services.rdb instdir/program/resource/* instdir/program/types/* instdir/presets/  --js-output=instdir/program/soffice.data.js --separate-metadata
-
-Anything can be added to the list. I just kept the normal instdir layout.
-
-This generates the reqired image files. --separate-metadata is used, so
-regenerating the image doesn't require re-linking.
-
-The environment settings are in static/debug.js. This unfortunatly needs re-
-linking. It could probably use some mechanism equal to the FS metadata, but
-I didn't find anything.
-
-There is a stub of the generation CustomTarget in static/CustomTarget_data.mk.
-
-The actual data should probably just be generated in workdir/CustomTarget/static
-and then linked to instdir/program and workdir/LinkTarget/Executable/. 
-
-
-
 = Status =
 
 $ make
@@ -133,6 +113,10 @@ https://developer.chrome.com/blog/wasm-debugging-2020/
 This way you don't need source maps (much faster linking!) and can resolve local WASM
 variables to C++ names!
 
+== Updating the WASM FS image ==
+
+All files included in the image are listened in static/CustomTarget_wasm_fs_image.mk,
+$(gb_wasm_image_filelist). Read its comment for further info and restrictions.
 
 == Using Docker to cross-build with emscripten ==
 
diff --git a/Repository.mk b/Repository.mk
index e384d5fdd32c..21fda022154d 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -1048,6 +1048,7 @@ $(eval $(call gb_Helper_register_packages_for_install,ooo,\
 	) \
 	resource_fonts \
 	cui \
+    static/wasm_fs_image \
 ))
 
 $(eval $(call gb_Helper_register_packages_for_install,ooo_fonts,\
diff --git a/solenv/gbuild/Executable.mk b/solenv/gbuild/Executable.mk
index 70879bb9eb8c..6b040e99bce1 100644
--- a/solenv/gbuild/Executable.mk
+++ b/solenv/gbuild/Executable.mk
@@ -75,6 +75,9 @@ $(call gb_Executable_get_runtime_target,$(1)) : $(call gb_Executable_get_target_
 $(call gb_Executable_get_clean_target,$(1)) : $(call gb_LinkTarget_get_clean_target,$(2))
 $(call gb_Executable_get_clean_target,$(1)) : AUXTARGETS :=
 $(call gb_Executable_Executable_platform,$(1),$(2),$(gb_Executable_BINDIR)/$(1).lib)
+ifeq ($(OS),EMSCRIPTEN)
+$(call gb_LinkTarget_get_target,$(call gb_Executable_get_linktarget,$(1))) : $(call gb_CustomTarget_get_workdir,static/wasm_fs_image)/soffice.data.js.link
+endif
 
 $$(eval $$(call gb_Module_register_target,$(call gb_Executable_get_target,$(1)),$(call gb_Executable_get_clean_target,$(1))))
 $(call gb_Helper_make_userfriendly_targets,$(1),Executable)
diff --git a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
index 2eb8e6be197a..326fdd78f5ec 100644
--- a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
+++ b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
@@ -17,7 +17,7 @@ gb_EMSCRIPTEN_CPPFLAGS := -pthread -s TOTAL_MEMORY=1GB -s USE_PTHREADS=1 -s PTHR
 # To keep the link time (and memory) down, prevent all rewriting options from wasm-emscripten-finalize
 # See emscrypten.py, finalize_wasm, modify_wasm = True
 # So we need WASM_BIGINT=1 and ASSERTIONS=1 (2 implies STACK_OVERFLOW_CHECK)
-gb_EMSCRIPTEN_LDFLAGS := $(gb_EMSCRIPTEN_CPPFLAGS) --bind -s FORCE_FILESYSTEM=1 -s WASM_BIGINT=1 -s ERROR_ON_UNDEFINED_SYMBOLS=1 -s FETCH=1 -s ASSERTIONS=1 -s EXIT_RUNTIME=0 -s EXTRA_EXPORTED_RUNTIME_METHODS=["UTF16ToString","stringToUTF16"] --pre-js $(INSTDIR)/program/soffice.data.js --pre-js $(SRCDIR)/static/debug.js
+gb_EMSCRIPTEN_LDFLAGS := $(gb_EMSCRIPTEN_CPPFLAGS) --bind -s FORCE_FILESYSTEM=1 -s WASM_BIGINT=1 -s ERROR_ON_UNDEFINED_SYMBOLS=1 -s FETCH=1 -s ASSERTIONS=1 -s EXIT_RUNTIME=0 -s EXTRA_EXPORTED_RUNTIME_METHODS=["UTF16ToString","stringToUTF16"] --pre-js $(call gb_CustomTarget_get_workdir,static/wasm_fs_image)/soffice.data.js.link --pre-js $(SRCDIR)/static/environment.js
 gb_EMSCRIPTEN_QTDEFS := -DQT_NO_LINKED_LIST -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB
 
 gb_Executable_EXT := .html
diff --git a/solenv/gbuild/platform/unxgcc.mk b/solenv/gbuild/platform/unxgcc.mk
index 1d8fd3da35db..715f09392a44 100644
--- a/solenv/gbuild/platform/unxgcc.mk
+++ b/solenv/gbuild/platform/unxgcc.mk
@@ -166,7 +166,10 @@ $(if $(filter Library,$(TARGETTYPE)), $(call gb_Helper_abbreviate_dirs,\
 		$(WORKDIR)/LinkTarget/$(2).exports,$(1))))
 $(if $(and $(filter CppunitTest Executable,$(TARGETTYPE)),$(filter EMSCRIPTEN,$(OS)),$(filter TRUE,$(ENABLE_QT5))), \
 	cp $(QT5_PLATFORMS_SRCDIR)/qtlogo.svg $(QT5_PLATFORMS_SRCDIR)/qtloader.js $(dir $(1)) ; \
-	sed -e 's/@APPNAME@/$(subst $(gb_Executable_EXT),,$(notdir $(1)))/' $(QT5_PLATFORMS_SRCDIR)/wasm_shell.html > $(dir $(1))qt_$(notdir $(1)))
+	sed -e 's/@APPNAME@/$(subst $(gb_Executable_EXT),,$(notdir $(1)))/' $(QT5_PLATFORMS_SRCDIR)/wasm_shell.html > $(dir $(1))qt_$(notdir $(1)) ; \
+	ln -sf $(call gb_CustomTarget_get_workdir,static/wasm_fs_image)/soffice.data $(dir $(1))/soffice.data ; \
+	ln -sf $(call gb_CustomTarget_get_workdir,static/wasm_fs_image)/soffice.data.js.metadata $(dir $(1))/soffice.data.js.metadata ; \
+)
 endef
 
 define gb_LinkTarget__command_staticlink
diff --git a/static/CustomTarget_data.mk b/static/CustomTarget_data.mk
deleted file mode 100644
index 52344b6c35cc..000000000000
--- a/static/CustomTarget_data.mk
+++ /dev/null
@@ -1,59 +0,0 @@
-# vim: set noet sw=4 ts=4:
-# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-
-$(eval $(call gb_CustomTarget_CustomTarget,static/data))
-
-/home/jmg/Development/libreoffice/git_emsdk/upstream/emscripten/tools/file_packager instdir/program/soffice.data --use-preload-plugins --preload instdir/program/*rc instdir/program/*.rdb instdir/program/services/services.rdb instdir/program/resource/* instdir/program/types/* instdir/presets/  --js-output=instdir/program/soffice.data.js --separate-metadata
-
-gb_objcopy_bfdname := $(shell objdump -a $(call gb_GenCxxObject_get_target,CustomTarget/static/component_maps) | sed -ne 's/^.*format //p')
-
-static_WORKDIR := $(call gb_CustomTarget_get_workdir,static)
-postprocess_WORKDIR := $(call gb_CustomTarget_get_workdir,postprocess)
-
-$(call gb_CustomTarget_get_target,static/components): \
-    $(static_WORKDIR)/component_maps.cxx \
-
-gb_GenCxxObject_get_target
-static_WORKDIR := $(call gb_CustomTarget_get_workdir,static)
-postprocess_WORKDIR := $(call gb_CustomTarget_get_workdir,postprocess)
-
-gb_GenCxxObject_get_target
-gb_GenCxxObject_get_dwo_target
-CustomTarget/static/component_maps
-
-define gb_static_components_create_component_map
-TEMPFILE=`$(gb_MKTEMP)` && \
-$(call gb_Helper_abbreviate_dirs, \
-    $(call gb_ExternalExecutable_get_command,python) $(1) \
-        $(if $(ENABLE_SERVICES_RDB_FROM_BUILD), \
-            -c $(postprocess_WORKDIR)/services_constructors.list, \
-            -g core -g writer -g desktop \
-        ) \
-) > $$TEMPFILE && \
-$(call gb_Helper_replace_if_different_and_touch,$${TEMPFILE},$(2))
-
-endef
-
-
-
-$(call gb_CustomTarget_get_target,static/data): \
-    $(static_WORKDIR)/soffice.data.js.metadata \
-    $(static_WORKDIR)/soffice.data \
-
-$(static_WORKDIR)/component_maps.cxx: \
-    $(SRCDIR)/solenv/bin/native-code.py \
-    | $(static_WORKDIR)/.dir
-        $(call gb_Output_announce,$(subst $(BUILDDIR)/,,$@),$(true),GEN,2)
-	objcopy -I binary -B i386 -O elf64-x86-64 \
-  --rename-section .data=.mydata,readonly,contents src dst.o
-	objdump -a $(call gb_GenCxxObject_get_target,CustomTarget/static/component_maps) | sed -ne 's/^.*format //p'
-        $(call gb_static_components_create_component_map,$<,$@)
-
-# vim: set noet sw=4:
diff --git a/static/CustomTarget_wasm_fs_image.mk b/static/CustomTarget_wasm_fs_image.mk
new file mode 100644
index 000000000000..bf89c7540f75
--- /dev/null
+++ b/static/CustomTarget_wasm_fs_image.mk
@@ -0,0 +1,52 @@
+# vim: set noet sw=4 ts=4:
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_CustomTarget_CustomTarget,static/wasm_fs_image))
+
+# WASM assumes the image has the same layout then instdir, so everything you want
+# to include must be "installed" somewhere in it, as there is no mechanism to easily
+# change paths or rename them (you could hack soffice.data.js.metadata).
+# We make them relative paths as input for the file_packager.py!
+gb_wasm_image_filelist := \
+    $(call gb_UnoApi_get_target,offapi) \
+    $(call gb_UnoApi_get_target,udkapi) \
+    $(INSTROOT)/$(LIBO_ETC_FOLDER)/$(call gb_Helper_get_rcfile,fundamental) \
+    $(INSTROOT)/$(LIBO_ETC_FOLDER)/$(call gb_Helper_get_rcfile,louno) \
+    $(INSTROOT)/$(LIBO_ETC_FOLDER)/services/services.rdb \
+    $(INSTROOT)/$(LIBO_URE_ETC_FOLDER)/$(call gb_Helper_get_rcfile,uno) \
+    $(INSTROOT)/$(LIBO_URE_MISC_FOLDER)/services.rdb \
+
+wasm_fs_image_WORKDIR := $(call gb_CustomTarget_get_workdir,static/wasm_fs_image)
+
+# we just need data.js.link at link time, which is equal to soffice.data.js
+$(call gb_CustomTarget_get_target,static/wasm_fs_image): \
+    $(wasm_fs_image_WORKDIR)/soffice.data \
+    $(wasm_fs_image_WORKDIR)/soffice.data.js.link \
+    $(wasm_fs_image_WORKDIR)/soffice.data.js.metadata \
+
+$(wasm_fs_image_WORKDIR)/soffice.data $(wasm_fs_image_WORKDIR)/soffice.data.js : $(wasm_fs_image_WORKDIR)/soffice.data.js.metadata
+
+$(wasm_fs_image_WORKDIR)/soffice.data.js.link: $(wasm_fs_image_WORKDIR)/soffice.data.js
+	cp $^ $^.tmp
+	$(call gb_Helper_replace_if_different_and_touch,$^.tmp,$@)
+
+$(wasm_fs_image_WORKDIR)/soffice.data.filelist: $(gb_wasm_image_filelist) | $(wasm_fs_image_WORKDIR)/.dir
+	TEMPFILE=$(call var2file,$(shell $(gb_MKTEMP)),1,$(subst $(BUILDDIR)/,,$^)) && \
+	    mv $$TEMPFILE $@.tmp
+	$(call gb_Helper_replace_if_different_and_touch,$@.tmp,$@)
+
+# Unfortunatly the file packager just allows a cmdline file list, but all paths are
+# relative to $(BUILDDIR), so we won't run out of cmdline space that fast...
+$(wasm_fs_image_WORKDIR)/soffice.data.js.metadata: $(wasm_fs_image_WORKDIR)/soffice.data.filelist \
+	$(call gb_Output_announce,$(subst $(BUILDDIR)/,,$(wasm_fs_image_WORKDIR)/soffice.data),$(true),GEN,2)
+	$(EMSDK_FILE_PACKAGER) $(wasm_fs_image_WORKDIR)/soffice.data --preload $(shell cat $^) --js-output=$(wasm_fs_image_WORKDIR)/soffice.data.js --separate-metadata \
+	    || rm -f $(wasm_fs_image_WORKDIR)/soffice.data.js $(wasm_fs_image_WORKDIR)/soffice.data $(wasm_fs_image_WORKDIR)/soffice.data.js.metadata
+
+# vim: set noet sw=4:
diff --git a/static/Module_static.mk b/static/Module_static.mk
index f8909994ab7b..0c8b4e6e1f29 100644
--- a/static/Module_static.mk
+++ b/static/Module_static.mk
@@ -12,7 +12,9 @@ ifeq ($(DISABLE_DYNLOADING),TRUE)
 
 $(eval $(call gb_Module_add_targets,static,\
     CustomTarget_components \
+    CustomTarget_wasm_fs_image \
     Library_components \
+    Package_wasm_fs_image \
 ))
 
 endif
diff --git a/static/Package_wasm_fs_image.mk b/static/Package_wasm_fs_image.mk
new file mode 100644
index 000000000000..cd1855b322b2
--- /dev/null
+++ b/static/Package_wasm_fs_image.mk
@@ -0,0 +1,17 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Package_Package,static/wasm_fs_image,$(call gb_CustomTarget_get_workdir,static/wasm_fs_image)))
+
+ifeq (EMSCRIPTEN,$(OS))
+$(eval $(call gb_Package_add_file,static/wasm_fs_image,$(LIBO_BIN_FOLDER)/soffice.data,soffice.data))
+$(eval $(call gb_Package_add_file,static/wasm_fs_image,$(LIBO_BIN_FOLDER)/soffice.data.js.metadata,soffice.data.js.metadata))
+endif
+
+# vim: set ts=4 sw=4 noet:
diff --git a/static/debug.js b/static/environment.js
similarity index 100%
rename from static/debug.js
rename to static/environment.js
commit 7d4a077636267161e0cff26e20b132ed9e3c1920
Author:     Thorsten Behrens <thorsten.behrens at allotropia.de>
AuthorDate: Tue Jul 20 22:25:28 2021 +0200
Commit:     Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Fri Jul 23 07:07:42 2021 +0200

    Use proper absolute paths on linker lines
    
    Change-Id: Ic09d2074144ebc58142f55a105d22540561628df

diff --git a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
index e8b090516633..2eb8e6be197a 100644
--- a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
+++ b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
@@ -17,7 +17,7 @@ gb_EMSCRIPTEN_CPPFLAGS := -pthread -s TOTAL_MEMORY=1GB -s USE_PTHREADS=1 -s PTHR
 # To keep the link time (and memory) down, prevent all rewriting options from wasm-emscripten-finalize
 # See emscrypten.py, finalize_wasm, modify_wasm = True
 # So we need WASM_BIGINT=1 and ASSERTIONS=1 (2 implies STACK_OVERFLOW_CHECK)
-gb_EMSCRIPTEN_LDFLAGS := $(gb_EMSCRIPTEN_CPPFLAGS) --bind -s FORCE_FILESYSTEM=1 -s WASM_BIGINT=1 -s ERROR_ON_UNDEFINED_SYMBOLS=1 -s FETCH=1 -s ASSERTIONS=1 -s EXIT_RUNTIME=0 -s EXTRA_EXPORTED_RUNTIME_METHODS=["UTF16ToString","stringToUTF16"] --pre-js instdir/program/soffice.data.js --pre-js static/debug.js
+gb_EMSCRIPTEN_LDFLAGS := $(gb_EMSCRIPTEN_CPPFLAGS) --bind -s FORCE_FILESYSTEM=1 -s WASM_BIGINT=1 -s ERROR_ON_UNDEFINED_SYMBOLS=1 -s FETCH=1 -s ASSERTIONS=1 -s EXIT_RUNTIME=0 -s EXTRA_EXPORTED_RUNTIME_METHODS=["UTF16ToString","stringToUTF16"] --pre-js $(INSTDIR)/program/soffice.data.js --pre-js $(SRCDIR)/static/debug.js
 gb_EMSCRIPTEN_QTDEFS := -DQT_NO_LINKED_LIST -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB
 
 gb_Executable_EXT := .html
commit 411efa276c359fcf380586774587feb35b64b8cb
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Fri Jul 2 11:49:37 2021 +0200
Commit:     Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Fri Jul 23 07:07:41 2021 +0200

    Build vcldemo + link image + image instructions
    
    Change-Id: Iaf6fbdaee0f8842fdde25de81f1345f1458cfcbb

diff --git a/README.wasm b/README.wasm
index 21a81d6684a4..abe7c2af6f4e 100644
--- a/README.wasm
+++ b/README.wasm
@@ -1,3 +1,23 @@
+= Manually updating the WASM FS image =
+
+.../git_emsdk/upstream/emscripten/tools/file_packager instdir/program/soffice.data --use-preload-plugins --preload instdir/program/*rc instdir/program/*.rdb instdir/program/services/services.rdb instdir/program/resource/* instdir/program/types/* instdir/presets/  --js-output=instdir/program/soffice.data.js --separate-metadata
+
+Anything can be added to the list. I just kept the normal instdir layout.
+
+This generates the reqired image files. --separate-metadata is used, so
+regenerating the image doesn't require re-linking.
+
+The environment settings are in static/debug.js. This unfortunatly needs re-
+linking. It could probably use some mechanism equal to the FS metadata, but
+I didn't find anything.
+
+There is a stub of the generation CustomTarget in static/CustomTarget_data.mk.
+
+The actual data should probably just be generated in workdir/CustomTarget/static
+and then linked to instdir/program and workdir/LinkTarget/Executable/. 
+
+
+
 = Status =
 
 $ make
diff --git a/config_host.mk.in b/config_host.mk.in
index 4f56771cc8af..4b3d8fc52269 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -132,6 +132,7 @@ export DO_FETCH_TARBALLS=@DO_FETCH_TARBALLS@
 export DPKG=@DPKG@
 export EBOOK_CFLAGS=$(gb_SPACE)@EBOOK_CFLAGS@
 export EBOOK_LIBS=$(gb_SPACE)@EBOOK_LIBS@
+export EMSDK_FILE_PACKAGER=@EMSDK_FILE_PACKAGER@
 export ENABLE_ANDROID_LOK=@ENABLE_ANDROID_LOK@
 export ENABLE_ANDROID_EDITING=@ENABLE_ANDROID_EDITING@
 export ENABLE_AVAHI=@ENABLE_AVAHI@
diff --git a/configure.ac b/configure.ac
index f55b2f65aa51..8d75e449e8ae 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1345,10 +1345,16 @@ if test "$_os" = "Emscripten"; then
         AC_MSG_WARN(["\$EMMAKEN_JUST_CONFIGURE wasn't set by emconfigure. Prefix configure or use autogen.sh])
         EMSCRIPTEN_ERROR=1
     fi
+    EMSDK_FILE_PACKAGER="$(em-config EMSCRIPTEN_ROOT)"/tools/file_packager
+    if ! test -x "$EMSDK_FILE_PACKAGER"; then
+        AC_MSG_WARN([No file_packager found in $(em-config EMSCRIPTEN_ROOT)/tools/file_packager.])
+	EMSCRIPTEN_ERROR=1
+    fi
     if test $EMSCRIPTEN_ERROR -ne 0; then
         AC_MSG_ERROR(["Please fix your EMSDK setup to build with Emscripten!"])
     fi
 fi
+AC_SUBST(EMSDK_FILE_PACKAGER)
 
 ###############################################################################
 # Extensions switches --enable/--disable
diff --git a/cppuhelper/source/paths.cxx b/cppuhelper/source/paths.cxx
index 41dd609e584c..0996321fb7ae 100644
--- a/cppuhelper/source/paths.cxx
+++ b/cppuhelper/source/paths.cxx
@@ -62,7 +62,11 @@ OUString cppu::getUnoIniUri() {
     //     defaultBootstrap_InitialComponentContext
     // and since rtlBootstrapHandle is not ref-counted doing anything
     // clean here is hardish.
+#if defined ANDROID
     OUString uri("file:///assets/program");
+#else
+    OUString uri("file:///instdir/program");
+#endif
 #else
 
     OUString uri;
diff --git a/sal/osl/unx/uunxapi.cxx b/sal/osl/unx/uunxapi.cxx
index 917476d7ab03..e301c54b34a0 100644
--- a/sal/osl/unx/uunxapi.cxx
+++ b/sal/osl/unx/uunxapi.cxx
@@ -214,14 +214,22 @@ template<> OUString fromOString(OString const & s)
 template<typename T> bool realpath_(const T& pstrFileName, T& ppstrResolvedName)
 {
     OString fn = toOString(pstrFileName);
-#ifdef ANDROID
+#if defined ANDROID || defined EMSCRIPTEN
+#if defined ANDROID
     if (fn == "/assets" || fn.startsWith("/assets/"))
+#else
+    if (fn == "/instdir" || fn.startsWith("/instdir/"))
+#endif
     {
         if (osl::access(fn, F_OK) == -1)
+        {
+            SAL_INFO("sal.file", "realpath(" << fn << "): FAILED");
             return false;
+        }
 
         ppstrResolvedName = pstrFileName;
 
+        SAL_INFO("sal.file", "realpath(" << fn << "): OK");
         return true;
     }
 #endif
diff --git a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
index da6169e9459c..e8b090516633 100644
--- a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
+++ b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
@@ -17,7 +17,7 @@ gb_EMSCRIPTEN_CPPFLAGS := -pthread -s TOTAL_MEMORY=1GB -s USE_PTHREADS=1 -s PTHR
 # To keep the link time (and memory) down, prevent all rewriting options from wasm-emscripten-finalize
 # See emscrypten.py, finalize_wasm, modify_wasm = True
 # So we need WASM_BIGINT=1 and ASSERTIONS=1 (2 implies STACK_OVERFLOW_CHECK)
-gb_EMSCRIPTEN_LDFLAGS := $(gb_EMSCRIPTEN_CPPFLAGS) --bind -s FORCE_FILESYSTEM=1 -s WASM_BIGINT=1 -s ERROR_ON_UNDEFINED_SYMBOLS=1 -s FETCH=1 -s ASSERTIONS=1 -s EXIT_RUNTIME=0 -s EXTRA_EXPORTED_RUNTIME_METHODS=["UTF16ToString","stringToUTF16"]
+gb_EMSCRIPTEN_LDFLAGS := $(gb_EMSCRIPTEN_CPPFLAGS) --bind -s FORCE_FILESYSTEM=1 -s WASM_BIGINT=1 -s ERROR_ON_UNDEFINED_SYMBOLS=1 -s FETCH=1 -s ASSERTIONS=1 -s EXIT_RUNTIME=0 -s EXTRA_EXPORTED_RUNTIME_METHODS=["UTF16ToString","stringToUTF16"] --pre-js instdir/program/soffice.data.js --pre-js static/debug.js
 gb_EMSCRIPTEN_QTDEFS := -DQT_NO_LINKED_LIST -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB
 
 gb_Executable_EXT := .html
@@ -32,7 +32,7 @@ gb_LINKEROPTFLAGS :=
 gb_LINKERSTRIPDEBUGFLAGS :=
 # This maps to g3, no source maps, but DWARF with current emscripten!
 # https://developer.chrome.com/blog/wasm-debugging-2020/
-gb_DEBUGINFO_FLAGS = -g3
+gb_DEBUGINFO_FLAGS = -g
 #gb_DEBUGINFO_FLAGS = -gsource-map --source-map-base=file://$(WORKDIR)/LinkTarget/Executable
 # We need at least code elimination, otherwise linking OOMs even with 64GB.
 # So we "fake" -Og support to mean -O1 for Emscripten and always enable it for debug in configure.
diff --git a/static/CustomTarget_data.mk b/static/CustomTarget_data.mk
new file mode 100644
index 000000000000..52344b6c35cc
--- /dev/null
+++ b/static/CustomTarget_data.mk
@@ -0,0 +1,59 @@
+# vim: set noet sw=4 ts=4:
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_CustomTarget_CustomTarget,static/data))
+
+/home/jmg/Development/libreoffice/git_emsdk/upstream/emscripten/tools/file_packager instdir/program/soffice.data --use-preload-plugins --preload instdir/program/*rc instdir/program/*.rdb instdir/program/services/services.rdb instdir/program/resource/* instdir/program/types/* instdir/presets/  --js-output=instdir/program/soffice.data.js --separate-metadata
+
+gb_objcopy_bfdname := $(shell objdump -a $(call gb_GenCxxObject_get_target,CustomTarget/static/component_maps) | sed -ne 's/^.*format //p')
+
+static_WORKDIR := $(call gb_CustomTarget_get_workdir,static)
+postprocess_WORKDIR := $(call gb_CustomTarget_get_workdir,postprocess)
+
+$(call gb_CustomTarget_get_target,static/components): \
+    $(static_WORKDIR)/component_maps.cxx \
+
+gb_GenCxxObject_get_target
+static_WORKDIR := $(call gb_CustomTarget_get_workdir,static)
+postprocess_WORKDIR := $(call gb_CustomTarget_get_workdir,postprocess)
+
+gb_GenCxxObject_get_target
+gb_GenCxxObject_get_dwo_target
+CustomTarget/static/component_maps
+
+define gb_static_components_create_component_map
+TEMPFILE=`$(gb_MKTEMP)` && \
+$(call gb_Helper_abbreviate_dirs, \
+    $(call gb_ExternalExecutable_get_command,python) $(1) \
+        $(if $(ENABLE_SERVICES_RDB_FROM_BUILD), \
+            -c $(postprocess_WORKDIR)/services_constructors.list, \
+            -g core -g writer -g desktop \
+        ) \
+) > $$TEMPFILE && \
+$(call gb_Helper_replace_if_different_and_touch,$${TEMPFILE},$(2))
+
+endef
+
+
+
+$(call gb_CustomTarget_get_target,static/data): \
+    $(static_WORKDIR)/soffice.data.js.metadata \
+    $(static_WORKDIR)/soffice.data \
+
+$(static_WORKDIR)/component_maps.cxx: \
+    $(SRCDIR)/solenv/bin/native-code.py \
+    | $(static_WORKDIR)/.dir
+        $(call gb_Output_announce,$(subst $(BUILDDIR)/,,$@),$(true),GEN,2)
+	objcopy -I binary -B i386 -O elf64-x86-64 \
+  --rename-section .data=.mydata,readonly,contents src dst.o
+	objdump -a $(call gb_GenCxxObject_get_target,CustomTarget/static/component_maps) | sed -ne 's/^.*format //p'
+        $(call gb_static_components_create_component_map,$<,$@)
+
+# vim: set noet sw=4:
diff --git a/static/debug.js b/static/debug.js
new file mode 100644
index 000000000000..9e4e263f3c73
--- /dev/null
+++ b/static/debug.js
@@ -0,0 +1,3 @@
+Module.preRun.push(function() {
+    ENV.SAL_LOG = "+INFO+WARN"
+});
diff --git a/vcl/Module_vcl.mk b/vcl/Module_vcl.mk
index c8f01c947217..aae6167817e1 100644
--- a/vcl/Module_vcl.mk
+++ b/vcl/Module_vcl.mk
@@ -36,7 +36,7 @@ $(eval $(call gb_Module_add_targets,vcl,\
         Package_skia_denylist ) \
     $(if $(filter DESKTOP,$(BUILD_TYPE)), \
         StaticLibrary_vclmain \
-        $(if $(or $(DISABLE_GUI),$(DISABLE_DYNLOADING)),, \
+        $(if $(or $(DISABLE_GUI),$(DISABLE_DYNLOADING)),Executable_vcldemo, \
             $(if $(ENABLE_MACOSX_SANDBOX),, \
                 Executable_ui-previewer) \
             $(if $(filter LINUX MACOSX SOLARIS WNT %BSD,$(OS)), \
commit 744000ac4d8f041f4f25858c6c7d929ead2752b6
Author:     Thorsten Behrens <thorsten.behrens at allotropia.de>
AuthorDate: Tue Jun 22 18:35:17 2021 +0200
Commit:     Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Fri Jul 23 07:07:41 2021 +0200

    Hack-fix missing hunspell (which mythes need)
    
    Change-Id: I84178e6551904b34932b1eaf8c2d88d807439039

diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index 4c0cd660b4b3..e70aa09c6ee7 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -551,7 +551,6 @@ endef
 gb_ExternalProject__use_hunspell :=
 
 else # !SYSTEM_HUNSPELL
-ifneq ($(ENABLE_WASM_STRIP_HUNSPELL),TRUE)
 
 define gb_LinkTarget__use_hunspell
 $(call gb_LinkTarget_add_defs,$(1),\
@@ -579,7 +578,6 @@ $(call gb_ExternalProject_use_external_project,$(1),hunspell)
 
 endef
 
-endif # ENABLE_WASM_STRIP_HUNSPELL
 endif # SYSTEM_HUNSPELL
 
 
diff --git a/external/mythes/ExternalProject_mythes.mk b/external/mythes/ExternalProject_mythes.mk
index 6a1e9b14e882..298607f0aa73 100644
--- a/external/mythes/ExternalProject_mythes.mk
+++ b/external/mythes/ExternalProject_mythes.mk
@@ -9,9 +9,7 @@
 
 $(eval $(call gb_ExternalProject_ExternalProject,mythes))
 
-ifneq ($(ENABLE_WASM_STRIP_HUNSPELL),TRUE)
 $(eval $(call gb_ExternalProject_use_external,mythes,hunspell))
-endif
 
 $(eval $(call gb_ExternalProject_register_targets,mythes,\
 	build \
commit 04186cddf8e20e627cbc03323fe8ea5d78e5bf20
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Tue Jun 22 17:15:12 2021 +0200
Commit:     Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Fri Jul 23 07:07:41 2021 +0200

    wasm UNO: use fixed path as on Android
    
    Change-Id: Ic51641338a6c85bfc67771e141ed76c7ccddba27

diff --git a/cppuhelper/source/paths.cxx b/cppuhelper/source/paths.cxx
index 79bb929183e4..41dd609e584c 100644
--- a/cppuhelper/source/paths.cxx
+++ b/cppuhelper/source/paths.cxx
@@ -35,7 +35,7 @@
 
 namespace {
 
-#ifndef ANDROID
+#if !(defined ANDROID || defined EMSCRIPTEN)
 OUString get_this_libpath() {
     static OUString s_uri = []() {
         OUString uri;
@@ -54,7 +54,7 @@ OUString get_this_libpath() {
 }
 
 OUString cppu::getUnoIniUri() {
-#if defined ANDROID
+#if defined ANDROID || defined EMSCRIPTEN
     // Wouldn't it be lovely to avoid this ugly hard-coding.
     // The problem is that the 'create_bootstrap_macro_expander_factory()'
     // required for bootstrapping services, calls cppu::get_unorc directly
diff --git a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
index 0c4c33bd6241..da6169e9459c 100644
--- a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
+++ b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
@@ -17,7 +17,7 @@ gb_EMSCRIPTEN_CPPFLAGS := -pthread -s TOTAL_MEMORY=1GB -s USE_PTHREADS=1 -s PTHR
 # To keep the link time (and memory) down, prevent all rewriting options from wasm-emscripten-finalize
 # See emscrypten.py, finalize_wasm, modify_wasm = True
 # So we need WASM_BIGINT=1 and ASSERTIONS=1 (2 implies STACK_OVERFLOW_CHECK)
-gb_EMSCRIPTEN_LDFLAGS := $(gb_EMSCRIPTEN_CPPFLAGS) --bind -s WASM_BIGINT=1 -s ERROR_ON_UNDEFINED_SYMBOLS=1 -s FETCH=1 -s ASSERTIONS=1 -s EXIT_RUNTIME=0 -s EXTRA_EXPORTED_RUNTIME_METHODS=["UTF16ToString","stringToUTF16"]
+gb_EMSCRIPTEN_LDFLAGS := $(gb_EMSCRIPTEN_CPPFLAGS) --bind -s FORCE_FILESYSTEM=1 -s WASM_BIGINT=1 -s ERROR_ON_UNDEFINED_SYMBOLS=1 -s FETCH=1 -s ASSERTIONS=1 -s EXIT_RUNTIME=0 -s EXTRA_EXPORTED_RUNTIME_METHODS=["UTF16ToString","stringToUTF16"]
 gb_EMSCRIPTEN_QTDEFS := -DQT_NO_LINKED_LIST -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB
 
 gb_Executable_EXT := .html
commit 1556d46cb2b249a4290373001e7cc48f0e47c2b6
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Tue Jun 22 15:01:45 2021 +0200
Commit:     Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Fri Jul 23 07:07:41 2021 +0200

    wasm: rename soffice.bin to soffice.html
    
    Change-Id: Ia957fae6edff4583f3d01dc5c6c7c215fab3879f

diff --git a/RepositoryFixes.mk b/RepositoryFixes.mk
index db78722ce545..0cbb5ad93e6c 100644
--- a/RepositoryFixes.mk
+++ b/RepositoryFixes.mk
@@ -34,8 +34,12 @@ endif
 ifeq ($(OS),MACOSX)
 gb_Executable_FILENAMES := $(patsubst soffice_bin:soffice_bin,soffice_bin:soffice,$(gb_Executable_FILENAMES))
 else
+ifeq ($(OS),EMSCRIPTEN)
+gb_Executable_FILENAMES := $(patsubst soffice_bin:soffice_bin%,soffice_bin:soffice.html,$(gb_Executable_FILENAMES))
+else
 gb_Executable_FILENAMES := $(patsubst soffice_bin:soffice_bin%,soffice_bin:soffice.bin,$(gb_Executable_FILENAMES))
 endif
+endif
 
 gb_Executable_FILENAMES := $(patsubst soffice_exe:soffice_exe%,soffice_exe:soffice.exe,$(gb_Executable_FILENAMES))
 gb_Executable_FILENAMES := $(patsubst soffice_com:soffice_com%,soffice_com:soffice.com,$(gb_Executable_FILENAMES))
commit 8b512f2f3000e8c578b26c533c7a089df5c22a7a
Author:     Thorsten Behrens <thorsten.behrens at allotropia.de>
AuthorDate: Tue Jun 22 14:40:11 2021 +0200
Commit:     Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Fri Jul 23 07:07:41 2021 +0200

    Workaround: missing i18npool.component dependency
    
    Fixes: No LIBFILENAME set at component target:
     <workdir>/ComponentTarget/i18npool/util/i18npool.component: Stop.
    Change-Id: I54b9fa6b4ed6bb1fd5f85da6c8962fc88258e487

diff --git a/distro-configs/LibreOfficeWASM32.conf b/distro-configs/LibreOfficeWASM32.conf
index 4d5062ff8958..962b76a55302 100644
--- a/distro-configs/LibreOfficeWASM32.conf
+++ b/distro-configs/LibreOfficeWASM32.conf
@@ -1,4 +1,5 @@
 --host=wasm32-local-emscripten
+--enable-services-rdb-from-build
 --enable-wasm-strip
 --disable-gtk3
 --enable-qt5
commit ff48ac62ddf97465618199fde54e3e5cdc1b8134
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Tue Jun 22 14:19:48 2021 +0200
Commit:     Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Fri Jul 23 07:07:41 2021 +0200

    wasm: test for Qt5 and non-system Freetype
    
    Change-Id: I91a99f5bb58ae6caad020f8159313413dfa0ab6a

diff --git a/configure.ac b/configure.ac
index 5c04cc0c560e..f55b2f65aa51 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1105,6 +1105,8 @@ emscripten)
     using_freetype_fontconfig=yes
     using_x11=no
     test_openldap=no
+    test_qt5=yes
+    test_system_freetype=no
     enable_compiler_plugins=no
     enable_wasm_strip=yes
     with_system_zlib=no
commit b6b41919802103434e7982fbb91fb66b97038a81
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Sun May 30 13:23:16 2021 +0200
Commit:     Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Fri Jul 23 07:07:40 2021 +0200

    libxml2: Use xml2-config dummy for internal
    
    When building a static LO with --disable-dynloading on Linux,
    --without-system-libs failed for me. And it left me really puzzled:
    raptor configure failed and claimed it couldn't link libxml2.
    config.log showed missing math functions. xml2-config of LO's
    build is patched and it includes a -lm. The xml2-config in my
    chroot doesn't. But we explicitly pass the xml2-config for
    non-system-libxml2 build. Reading the configure from raptor didn't
    reveal a way, that it could somehow pick up the xml2-config from
    the chroot, but that code is autoconf-complex...
    
    When running "sh -x configure", it turned out the configure script
    actually picks up the LIBXML_* flags from the environment, which
    are set by LO's config_host.mk. These just add -lm for Android.
    
    So this adds a xml2-config.in "dummy", which overwrites the one
    from the libxml2 source and just echos LO's LIBXML_* values.
    And it adds -lm for all DISABLE_DYNLOADING targets. And drops the
    atexit xmlCleanupParser test, which fails with duplicate symbols
    for a static build.
    
    Change-Id: Ia713cf80c8e7dc989cf23c224e7a0f7ea1210a87

diff --git a/configure.ac b/configure.ac
index a715e771832a..5c04cc0c560e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9619,7 +9619,7 @@ else
         LIBXML_LIBS="${WORKDIR}/UnpackedTarball/libxml2/win32/bin.msvc/libxml2.lib"
     else
         LIBXML_LIBS="-L${WORKDIR}/UnpackedTarball/libxml2/.libs -lxml2"
-        if test "$_os" = Android; then
+        if test "$DISABLE_DYNLOADING" = TRUE; then
             LIBXML_LIBS="$LIBXML_LIBS -lm"
         fi
     fi
diff --git a/desktop/Executable_soffice_bin.mk b/desktop/Executable_soffice_bin.mk
index 9c08a28361df..14a72ab6c055 100644
--- a/desktop/Executable_soffice_bin.mk
+++ b/desktop/Executable_soffice_bin.mk
@@ -14,6 +14,10 @@ $(eval $(call gb_Executable_set_include,soffice_bin,\
     -I$(SRCDIR)/desktop/source/inc \
 ))
 
+$(eval $(call gb_Executable_add_defs,soffice_bin,\
+    $(if $(DISABLE_DYNLOADING),$(if $(SYSTEM_LIBXML),,-DNOTEST_xmlCleanupParser)) \
+))
+
 $(eval $(call gb_Executable_use_libraries,soffice_bin,\
     sal \
     sofficeapp \
diff --git a/desktop/source/app/main.c b/desktop/source/app/main.c
index 6631c3ceb337..fdd2eb3505dc 100644
--- a/desktop/source/app/main.c
+++ b/desktop/source/app/main.c
@@ -21,6 +21,7 @@
 
 #include "sofficemain.h"
 
+#ifndef NOTEST_xmlCleanupParser
 #ifdef DBG_UTIL
 #ifdef __gnu_linux__
 #include <stdio.h>
@@ -43,14 +44,17 @@ __attribute__((visibility("default"))) void xmlCleanupParser(void)
 }
 #endif
 #endif
+#endif // NOTEST_xmlCleanupParser
 
 SAL_IMPLEMENT_MAIN()
 {
     int ret = soffice_main();
+#ifndef NOTEST_xmlCleanupParser
 #ifdef DBG_UTIL
 #ifdef __gnu_linux__
     g_Exiting = 1;
 #endif
+#endif
 #endif
     return ret;
 }
diff --git a/external/libxml2/UnpackedTarball_libxml2.mk b/external/libxml2/UnpackedTarball_libxml2.mk
index 83df02849cb3..8c81c3d26e4c 100644
--- a/external/libxml2/UnpackedTarball_libxml2.mk
+++ b/external/libxml2/UnpackedTarball_libxml2.mk
@@ -14,7 +14,6 @@ $(eval $(call gb_UnpackedTarball_set_tarball,libxml2,$(LIBXML_TARBALL),,libxml2)
 $(eval $(call gb_UnpackedTarball_update_autoconf_configs,libxml2))
 
 $(eval $(call gb_UnpackedTarball_add_patches,libxml2,\
-	external/libxml2/libxml2-config.patch.1 \
 	external/libxml2/libxml2-global-symbols.patch \
 	external/libxml2/libxml2-vc10.patch \
 	$(if $(filter ANDROID,$(OS)),external/libxml2/libxml2-android.patch) \
@@ -23,4 +22,6 @@ $(eval $(call gb_UnpackedTarball_add_patches,libxml2,\
 		external/libxml2/libxml2-icu.patch.0) \
 ))
 
+$(eval $(call gb_UnpackedTarball_add_file,libxml2,xml2-config.in,external/libxml2/xml2-config.in))
+
 # vim: set noet sw=4 ts=4:
diff --git a/external/libxml2/libxml2-config.patch.1 b/external/libxml2/libxml2-config.patch.1
deleted file mode 100644
index 5a2ef1485e92..000000000000
--- a/external/libxml2/libxml2-config.patch.1
+++ /dev/null
@@ -1,43 +0,0 @@
-Hack the xml2-config to return paths into WORKDIR.
-
---- a/xml2-config.in	2009-12-17 11:45:20.000000000 +0000
-+++ b/xml2-config.in	2009-12-17 11:45:36.000000000 +0000
-@@ -1,9 +1,14 @@
- #! /bin/sh
- 
--prefix=@prefix@
--exec_prefix=@exec_prefix@
--includedir=@includedir@
--libdir=@libdir@
-+#prefix=@prefix@
-+#exec_prefix=@exec_prefix@
-+#includedir=@includedir@
-+#libdir=@libdir@
-+
-+prefix=${WORKDIR}/UnpackedTarball/libxml2
-+exec_prefix=${WORKDIR}/UnpackedTarball/libxml2
-+includedir=${WORKDIR}/UnpackedTarball/libxml2/include
-+libdir=${WORKDIR}/UnpackedTarball/libxml2/.libs
- cflags=
- libs=
- 
-@@ -67,7 +72,8 @@
- 	;;
- 
-     --cflags)
--        cflags="@XML_INCLUDEDIR@ @XML_CFLAGS@"
-+        #cflags="@XML_INCLUDEDIR@ @XML_CFLAGS@"
-+        cflags="-I${includedir}"
-        	;;
- 
-     --libtool-libs)
-@@ -91,7 +96,8 @@
-             libs="@XML_LIBDIR@ $libs"
-         fi
- 
--        libs="$libs @WIN32_EXTRA_LIBADD@"
-+        #libs="$libs @WIN32_EXTRA_LIBADD@"
-+        libs="-L${libdir} -lxml2 -lm"
-         ;;
- 
-     *)
diff --git a/external/libxml2/xml2-config.in b/external/libxml2/xml2-config.in
new file mode 100644
index 000000000000..164508e47e67
--- /dev/null
+++ b/external/libxml2/xml2-config.in
@@ -0,0 +1,28 @@
+#! /bin/sh
+
+while test $# -gt 0; do
+    case "$1" in
+    -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+    *) optarg= ;;
+    esac
+
+    case "$1" in
+    --version)
+	echo @VERSION@
+	exit 0
+        ;;
+    --cflags)
+        cflags="$LIBXML_CFLAGS"
+        ;;
+    --libs)
+        libs="$LIBXML_LIBS"
+        ;;
+    esac
+    shift
+done
+
+if test -n "$cflags$libs"; then
+    echo $cflags $libs
+fi
+
+exit 0
diff --git a/external/redland/UnpackedTarball_raptor.mk b/external/redland/UnpackedTarball_raptor.mk
index c5ff226168d8..fbdc8b6f5510 100644
--- a/external/redland/UnpackedTarball_raptor.mk
+++ b/external/redland/UnpackedTarball_raptor.mk
@@ -30,7 +30,6 @@ $(eval $(call gb_UnpackedTarball_add_patches,raptor,\
 	external/redland/raptor/0001-Calcualte-max-nspace-declarations-correctly-for-XML-.patch.1 \
 	external/redland/raptor/0001-CVE-2020-25713-raptor2-malformed-input-file-can-lead.patch.1 \
 	external/redland/raptor/libtool.patch \
-	external/redland/raptor/libxml-override.patch \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/redland/raptor/libxml-override.patch b/external/redland/raptor/libxml-override.patch
deleted file mode 100644
index edc2d0d497a4..000000000000
--- a/external/redland/raptor/libxml-override.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- configure
-+++ configure
-@@ -14387,8 +14387,8 @@
- 
- libxml_source=no
- if test "X$XML_CONFIG" != "X"; then
--  LIBXML_CFLAGS=`$XML_CONFIG --cflags`
--  LIBXML_LIBS=`$XML_CONFIG --libs`
-+  : ${LIBXML_CFLAGS=`$XML_CONFIG --cflags`}
-+  : ${LIBXML_LIBS=`$XML_CONFIG --libs`}
- 
-   CPPFLAGS="$LIBXML_CFLAGS $CPPFLAGS"
-   LIBS="$LIBS $LIBXML_LIBS"
commit 536c74de23f7e4ad5db81aa014a84d5c60ba9e7c
Author:     Thorsten Behrens <thorsten.behrens at allotropia.de>
AuthorDate: Sat May 22 14:20:59 2021 +0200
Commit:     Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Fri Jul 23 07:07:40 2021 +0200

    wasm: Fix linking for clang build
    
    Change-Id: I593ab41a4602cedb6586e428773ed41d7e21f1f4

diff --git a/solenv/gbuild/platform/linux.mk b/solenv/gbuild/platform/linux.mk
index 823190490589..3238ce7a47ba 100644
--- a/solenv/gbuild/platform/linux.mk
+++ b/solenv/gbuild/platform/linux.mk
@@ -20,7 +20,7 @@ include $(GBUILDDIR)/platform/unxgcc.mk
 gb_STDLIBS :=
 
 ifeq ($(DISABLE_DYNLOADING),TRUE)
-gb_STDLIBS += -ldl -lm
+gb_STDLIBS += -ldl -lm -pthread -lpthread
 endif
 
 gb_STDLIBS_CXX :=
commit 4c5175a3824da7c3597264ef062bfd6318273264
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Thu May 27 12:15:53 2021 +0200
Commit:     Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Fri Jul 23 07:07:40 2021 +0200

    wasm: catchall of small fixes and updated README
    
    A bunch of smalll fixes to make the WASM build work.
    
    * Enable the Qt5 WASM mandelbrot example
    * Use non-multiuser DESKTOP build
    * Remove leftover artifacts from configure
    * Disable UNO bridge code
    * Fix numbertext CXXFLAGS
    * Adapt link flags to prevent WASM rewriting
      and use DWARF debug info
    * Include the correct poll.h
    
    Change-Id: If8dcf7646ee57669fec3ab0c222d09782a79ca2c

diff --git a/README.wasm b/README.wasm
index 926f6565452c..21a81d6684a4 100644
--- a/README.wasm
+++ b/README.wasm
@@ -5,31 +5,27 @@ $ emrun --serve_after_close instdir/program/ui-previewer.html
 
 The ui-previewer "binary" will "crash" with memory alignment problems.
 
-You can run the WASM mandelbrot Qt example, if you copy its HTML
-and the qtloader.js from the Qt's example folder after build with:
+You can run the WASM mandelbrot Qt example:
 
-$ emrun --serve_after_close workdir/LinkTarget/Executable/mandelbrot.html
+$ emrun --serve_after_close workdir/LinkTarget/Executable/qt_mandelbrot.html
 
 REMINDER: always start new tabs in the browser, reload might fail / cache!
 
 
 = Setup for the LO WASM build (with Qt) =
 
-We're using Qt 5.15 with the officially supported emscripten v1.39.8.
-But there are several potential problems with threads and exceptions, so this will likely
-change later to a newer emscripten.
+We're using Qt 5.15 with current upstream emscripten, currently 2.0.23.
 
-Qt WASM is not yet used with LO, just if you're wondering!
+++ See below under Docker build for another build option ++
 
- ++ See below under Docker build for another build option ++
 
 == Setup emscripten ==
 
 https://emscripten.org/docs/getting_started/index.html
 
 git clone https://github.com/emscripten-core/emsdk.git
-./emsdk install 1.39.8
-./emsdk activate --embedded 1.39.8
+./emsdk install 2.0.23
+./emsdk activate --embedded 2.0.23
 
 Example bashrc scriptlet:
 
@@ -49,10 +45,21 @@ git clone https://github.com/qt/qt5.git
 cd qt5
 git checkout v5.15.2
 ./init-repository
-./configure -xplatform wasm-emscripten -feature-thread -compile-examples -prefix $PWD/qtbase
-make -j<CORES> module-qtbase module-qtdeclarative
 
-Building with examples will break with some of them, but at that point Qt already works.
+./configure -xplatform wasm-emscripten -feature-thread -prefix $PWD/qtbase
+
+Optionally you can add the configure flag "-compile-examples". But then you also have to
+patch at least mkspecs/wasm-emscripten/qmake.conf with EXIT_RUNTIME=0, otherwise they will
+fail to run. In addition, building with examples will break with some of them, but at that
+point Qt already works and also most examples.
+
+Linking takes quite a long time, because emscripten-finalize rewrites the whole WASM files
+with some options. This way the LO WASM needs at least 64GB RAM. For faster link times add
+"-s WASM_BIGINT=1", change to ASSERTIONS=1 nd use -g3 to prevent rewriting the WASM file
+and generating source maps (see emscripten.py, finalize_wasm, and avoid modify_wasm = True).
+This is just needed for Qt examples, as LO already uses the correct flags!
+
+make -j<CORES> module-qtbase module-qtdeclarative
 
 At some point Qt configure failed for me with:
 "Checking for target architecture... Project ERROR: target architecture detection binary not found."
@@ -74,10 +81,6 @@ autogen.sh is patched to use emconfigure. That basically sets various environmen
 especially EMMAKEN_JUST_CONFIGURE, which will create the correct output file names, checked by
 configure (a.out).
 
-There's a distro config for WASM (work in progress), that gets your
-defaults right (and currently disables a ton of 3rd party stuff which
-is not essential).
-
 Recommended configure setup is thusly:
 
 # grab defaults
@@ -88,7 +91,27 @@ QT5DIR=/dir/of/git_qt5/qtbase
 
 # if you want to use ccache on both sides of the build
 --with-build-platform-configure-options=--enable-ccache
---enable-ccache
+
+# Include all build components, not just the manual list
+#--enable-services-rdb-from-build
+
+-----------
+
+FWIW: it's also possible to build an almost static Linux LibreOffice by just using
+--disable-dynloading. System externals are still linked dynamically, but everything
+else is static. Then there is --enable-wasm-strip for a smaller feature set.
+
+
+== Debugging setup ==
+
+Since a few months you can use DWARF information embedded by LLVM into the WASM to
+debug WASM in Chrome. You need to enable an experimental feature and install an
+additional extension. The whole setup is described in:
+
+https://developer.chrome.com/blog/wasm-debugging-2020/
+
+This way you don't need source maps (much faster linking!) and can resolve local WASM
+variables to C++ names!
 
 
 == Using Docker to cross-build with emscripten ==
diff --git a/Repository.mk b/Repository.mk
index c2744d8ad206..e384d5fdd32c 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -82,6 +82,7 @@ $(eval $(call gb_Helper_register_executables,NONE, \
     mtfdemo \
     visualbackendtest \
 	$(if $(and $(ENABLE_GTK3), $(filter LINUX %BSD SOLARIS,$(OS))), gtktiledviewer) \
+    $(if $(filter EMSCRIPTEN,$(OS)),wasm-qt5-mandelbrot) \
 ))
 
 $(eval $(call gb_Helper_register_executables_for_install,SDK,sdk, \
diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index 437501f6f1c3..4c0cd660b4b3 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -3088,7 +3088,7 @@ $(call gb_LinkTarget_add_libs,$(1),\
 	$(call gb_UnpackedTarball_get_dir,postgresql)/src/interfaces/libpq/libpq$(gb_StaticLibrary_PLAINEXT) \
 	$(call gb_UnpackedTarball_get_dir,postgresql)/src/common/libpgcommon$(gb_StaticLibrary_PLAINEXT) \
 	$(call gb_UnpackedTarball_get_dir,postgresql)/src/port/libpgport$(gb_StaticLibrary_PLAINEXT) \
-    $(if $(WITH_GSSAPI),$(GSSAPI_LIBS)) \
+    $(if $(and $(DISABLE_DYNLOADING),$(WITH_GSSAPI)),$(GSSAPI_LIBS)) \
 )
 
 endif # !WNT
diff --git a/RepositoryModule_host.mk b/RepositoryModule_host.mk
index 9aaedfd66ee8..b26979a4b225 100644
--- a/RepositoryModule_host.mk
+++ b/RepositoryModule_host.mk
@@ -184,6 +184,7 @@ $(eval $(call gb_Module_add_moduledirs,libreoffice,\
 	uui \
 	vbahelper \
 	vcl \
+    $(if $(filter EMSCRIPTEN,$(OS)),wasm-qt) \
 	wizards \
 	writerfilter \
 	writerperfect \
diff --git a/configure.ac b/configure.ac
index 3cc114b9ae4a..a715e771832a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2955,10 +2955,12 @@ dnl "desktop" one but a "mobile" one, we are always cross-compiling.
 dnl Note the direction of the implication; there is no assumption that
 dnl cross-compiling would imply a non-desktop OS.
 
-if test $_os != iOS -a $_os != Android -a $_os != Emscripten -a "$enable_fuzzers" != "yes"; then
+if test $_os != iOS -a $_os != Android -a "$enable_fuzzers" != "yes"; then
     BUILD_TYPE="$BUILD_TYPE DESKTOP"
     AC_DEFINE(HAVE_FEATURE_DESKTOP)
-    AC_DEFINE(HAVE_FEATURE_MULTIUSER_ENVIRONMENT)
+    if test "$_os" != Emscripten; then
+        AC_DEFINE(HAVE_FEATURE_MULTIUSER_ENVIRONMENT)
+    fi
 fi
 
 # explicitly doesn't include enable_gtk3=no and enable_qt5=yes, so it should
@@ -2993,6 +2995,7 @@ if test "$enable_wasm_strip" = "yes"; then
     enable_xmlhelp=no
     enable_zxing=no
     test_libepubgen=no
+#    with_system_libxml=no
     with_galleries=no
     with_webdav=no
     with_x=no
@@ -14592,4 +14595,7 @@ if test -f "$WARNINGS_FILE"; then
     cat "$WARNINGS_FILE"
 fi
 
+# Remove unneeded emconfigure artifacts
+rm -f a.out a.wasm a.out.js a.out.wasm
+
 dnl vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/cppu/source/uno/lbenv.cxx b/cppu/source/uno/lbenv.cxx
index 03dbc99eafcc..b24a81bf5ac9 100644
--- a/cppu/source/uno/lbenv.cxx
+++ b/cppu/source/uno/lbenv.cxx
@@ -1012,6 +1012,7 @@ void EnvironmentsData::getRegisteredEnvironments(
 bool loadEnv(OUString const  & cLibStem,
                     uno_Environment * pEnv)
 {
+#ifndef __EMSCRIPTEN__
 #ifdef DISABLE_DYNLOADING
     uno_initEnvironmentFunc fpInit;
 
@@ -1051,6 +1052,11 @@ bool loadEnv(OUString const  & cLibStem,
 
     (*fpInit)( pEnv ); // init of environment
     return true;
+#else
+    (void)cLibStem;
+    (void)pEnv;
+    return false;
+#endif
 }
 
 }
diff --git a/cppu/source/uno/lbmap.cxx b/cppu/source/uno/lbmap.cxx
index a39eb409a765..a92c018dbd74 100644
--- a/cppu/source/uno/lbmap.cxx
+++ b/cppu/source/uno/lbmap.cxx
@@ -329,8 +329,10 @@ static void setNegativeBridge( const OUString & rBridgeName )
 
 static uno_ext_getMappingFunc selectMapFunc( const OUString & rBridgeName )
 {
+#ifndef EMSCRIPTEN
     if (rBridgeName.equalsAscii( CPPU_CURRENT_LANGUAGE_BINDING_NAME "_uno" ))
         return CPPU_ENV_uno_ext_getMapping;
+#endif
 #if HAVE_FEATURE_JAVA
     if (rBridgeName.equalsAscii( "java" "_uno" ))
         return java_uno_ext_getMapping;
diff --git a/external/libnumbertext/ExternalProject_libnumbertext.mk b/external/libnumbertext/ExternalProject_libnumbertext.mk
index 3094351aebf2..eae3f34dc412 100644
--- a/external/libnumbertext/ExternalProject_libnumbertext.mk
+++ b/external/libnumbertext/ExternalProject_libnumbertext.mk
@@ -16,7 +16,7 @@ $(eval $(call gb_ExternalProject_register_targets,libnumbertext,\
 	build \
 ))
 
-libnumbertext_CXXFLAGS=$(CXXFLAGS) $(CXXFLAGS_CXX11)
+libnumbertext_CXXFLAGS=$(CXXFLAGS) $(CXXFLAGS_CXX11) $(gb_EMSCRIPTEN_CPPFLAGS)
 
 ifneq (,$(filter ANDROID DRAGONFLY FREEBSD iOS LINUX NETBSD OPENBSD,$(OS)))
 ifneq (,$(gb_ENABLE_DBGUTIL))
diff --git a/shell/Module_shell.mk b/shell/Module_shell.mk
index 193c46f3d75d..cb373f99982a 100644
--- a/shell/Module_shell.mk
+++ b/shell/Module_shell.mk
@@ -104,6 +104,7 @@ $(eval $(call gb_Module_add_targets,shell,\
 ))
 endif
 
+ifeq (,$(filter EMSCRIPTEN,$(OS)))
 ifeq ($(filter DESKTOP,$(BUILD_TYPE)),DESKTOP)
 
 $(eval $(call gb_Module_add_targets,shell,\
@@ -111,17 +112,16 @@ $(eval $(call gb_Module_add_targets,shell,\
 ))
 
 ifneq ($(OS),WNT)
-
 $(eval $(call gb_Module_add_targets,shell,\
 	StaticLibrary_xmlparser \
 	Executable_uri_encode \
 	Library_cmdmail \
 	$(if $(ENABLE_MACOSX_SANDBOX),,Package_senddoc) \
 ))
-
 endif
 
-endif
+endif # DESKTOP
+endif # !EMSCRIPTEN
 
 $(eval $(call gb_Module_add_l10n_targets,shell,\
     AllLangMoTarget_shell \
diff --git a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
index 3a7441454f0d..0c4c33bd6241 100644
--- a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
+++ b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
@@ -14,7 +14,10 @@ include $(GBUILDDIR)/platform/unxgcc.mk
 gb_RUN_CONFIGURE := $(SRCDIR)/solenv/bin/run-configure
 # avoid -s SAFE_HEAP=1 - c.f. gh#8584 this breaks source maps
 gb_EMSCRIPTEN_CPPFLAGS := -pthread -s TOTAL_MEMORY=1GB -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=4
-gb_EMSCRIPTEN_LDFLAGS := $(gb_EMSCRIPTEN_CPPFLAGS) --bind -s ERROR_ON_UNDEFINED_SYMBOLS=1 -s FETCH=1 -s ASSERTIONS=2 -s EXIT_RUNTIME=1 -s EXTRA_EXPORTED_RUNTIME_METHODS=["UTF16ToString","stringToUTF16"]
+# To keep the link time (and memory) down, prevent all rewriting options from wasm-emscripten-finalize
+# See emscrypten.py, finalize_wasm, modify_wasm = True
+# So we need WASM_BIGINT=1 and ASSERTIONS=1 (2 implies STACK_OVERFLOW_CHECK)
+gb_EMSCRIPTEN_LDFLAGS := $(gb_EMSCRIPTEN_CPPFLAGS) --bind -s WASM_BIGINT=1 -s ERROR_ON_UNDEFINED_SYMBOLS=1 -s FETCH=1 -s ASSERTIONS=1 -s EXIT_RUNTIME=0 -s EXTRA_EXPORTED_RUNTIME_METHODS=["UTF16ToString","stringToUTF16"]
 gb_EMSCRIPTEN_QTDEFS := -DQT_NO_LINKED_LIST -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB
 
 gb_Executable_EXT := .html
@@ -27,8 +30,10 @@ gb_LinkTarget_LDFLAGS += $(gb_EMSCRIPTEN_LDFLAGS) $(gb_EMSCRIPTEN_CPPFLAGS) $(gb
 # Linker and compiler optimize + debug flags are handled in LinkTarget.mk
 gb_LINKEROPTFLAGS :=
 gb_LINKERSTRIPDEBUGFLAGS :=
-# This maps to g4, AKA source maps. The LO default would otherwise be g2!
-gb_DEBUGINFO_FLAGS = -g
+# This maps to g3, no source maps, but DWARF with current emscripten!
+# https://developer.chrome.com/blog/wasm-debugging-2020/
+gb_DEBUGINFO_FLAGS = -g3
+#gb_DEBUGINFO_FLAGS = -gsource-map --source-map-base=file://$(WORKDIR)/LinkTarget/Executable
 # We need at least code elimination, otherwise linking OOMs even with 64GB.
 # So we "fake" -Og support to mean -O1 for Emscripten and always enable it for debug in configure.
 gb_COMPILERDEBUGOPTFLAGS := -O1
diff --git a/vcl/headless/svpinst.cxx b/vcl/headless/svpinst.cxx
index b488d54d7527..98d3e67c7444 100644
--- a/vcl/headless/svpinst.cxx
+++ b/vcl/headless/svpinst.cxx
@@ -27,7 +27,11 @@
 #include <fcntl.h>
 #include <pthread.h>
 #include <sys/time.h>
+#ifdef EMSCRIPTEN
+#include <poll.h>
+#else
 #include <sys/poll.h>
+#endif
 
 #include <sal/types.h>
 #include <sal/log.hxx>
diff --git a/vcl/source/gdi/impglyphitem.cxx b/vcl/source/gdi/impglyphitem.cxx
index 06dbaf6c5f32..5464754bab56 100644
--- a/vcl/source/gdi/impglyphitem.cxx
+++ b/vcl/source/gdi/impglyphitem.cxx
@@ -19,10 +19,6 @@
 
 #include <impglyphitem.hxx>
 
-#if (defined UNX && !defined MACOSX && !defined IOS)
-#include <unx/freetype_glyphcache.hxx>
-#endif
-
 SalLayoutGlyphs::SalLayoutGlyphs() {}
 
 SalLayoutGlyphs::~SalLayoutGlyphs() {}
diff --git a/wasm-qt/Module_wasm-qt.mk b/wasm-qt/Module_wasm-qt.mk
index 8e86df4e8baa..72da667363aa 100644
--- a/wasm-qt/Module_wasm-qt.mk
+++ b/wasm-qt/Module_wasm-qt.mk
@@ -8,13 +8,9 @@
 
 $(eval $(call gb_Module_Module,wasm-qt))
 
-ifeq ($(OS),EMSCRIPTEN)
-
 $(eval $(call gb_Module_add_targets,wasm-qt,\
     CustomTarget_wasm-qt5-mandelbrot_moc \
     Executable_wasm-qt5-mandelbrot \
 ))
 
-endif
-
 # vim: set noet sw=4 ts=4:
commit f36d98f53b839ad3c6eed9ba5a5558d6b91543a4
Author:     Armin Le Grand (Allotropia) <Armin.Le.Grand at me.com>
AuthorDate: Fri Apr 30 17:26:41 2021 +0200
Commit:     Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Fri Jul 23 07:07:39 2021 +0200

    wasm strip: squashed patches from Armin + fixes
    
    In addition to the squashed patches, this patch
    
    * drops the global compiler defines in favour of a config header
      file, for better ccache usage
    * revers almost all header changes in favour for empty function
      calls (just keeüs the premultiply table drop)
    * some additional changes for unused function calls
    * adapts more component files, so building the services.db and
      the component_mao.cxx from the build still works
    
    Currently crashs with anything different then soffice --writer.
    Closing the document also crashes.
    
    bfee2970a79e Wasm strip some SW exports & corrections
    fac2aeca4010 Wasm optional premultiply table replace
    ec9e2c81b4ec Wasm remove hunspell/hyphen optionally
    302a6f6f777a Wasm LanguageGuess optional removal
    55404a55984c Wasm oprtional autorecovery remove additions
    640d53e1e7c1 Wasm optional EPUB removal
    4a09f57c132c Wasm strip: remove UcpHelp
    eeebc1383df7 Wasm optional accessibility removal
    b95eaa630273 Additions/corrections to dbaccess wasm removal
    d8c11d72aa5a Wasm: Removed dbaccess optional
    f7d462b61c08 WASM Removal of clucene
    a1c508fc1c41 Stripped canvas/cppcanvas and related
    ebfb45f46319 Use more expressive ENABLE_WASM_STRIP markers
    a3519b1a41c8 Disable wpftcalc for wasm reduction
    fa86c5bc36f7 Chart wasm optional removal
    90d9a8dee35a BackingWindow (RecentDocsView) optional removal
    68e5f972b1a6 Deeper TipOfTheDay optional removal
    4ed18d09ce07 Optional removal of more startup-modules
    ab8d809b6ab7 Remove RecoveryCore
    f82517838840 Remove RecoveryUI, correct spl stuff
    f38dca150d58 SplashScreen and Startup
    
    Not included:
    34243e3acfe8 Wasm correct unresolved CreateMediaTempFile
    10963e79ac7d Wasm optional reduce created locales
    
    Change-Id: Ib9c0f9452815910c0a2aceaf142ba1ad4a9cb0d7

diff --git a/Repository.mk b/Repository.mk
index 608abbf91001..c2744d8ad206 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -17,13 +17,18 @@
 #   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 #
 
+ifneq ($(ENABLE_WASM_STRIP_CANVAS),TRUE)
+$(eval $(call gb_Helper_register_executables,NONE, \
+	canvasdemo \
+))
+endif
+
 $(eval $(call gb_Helper_register_executables,NONE, \
     $(call gb_Helper_optional,HELPTOOLS, \
 	HelpIndexer \
 	HelpLinker \
     ) \
 	bestreversemap \
-	canvasdemo \
 	cfgex \
 	concat-deps \
 	cpp \
@@ -90,6 +95,12 @@ $(eval $(call gb_Helper_register_executables_for_install,SDK,sdk, \
 	$(if $(filter ODK,$(BUILD_TYPE)),uno-skeletonmaker) \
 ))
 
+ifneq ($(ENABLE_WASM_STRIP_ACCESSIBILITY),TRUE)
+$(eval $(call gb_Helper_register_executables_for_install,OOO,brand, \
+	$(if $(filter-out ANDROID HAIKU iOS MACOSX WNT,$(OS)),oosplash) \
+))
+endif
+
 $(eval $(call gb_Helper_register_executables_for_install,OOO,brand, \
 	$(if $(ENABLE_ONLINE_UPDATE_MAR),\
 		mar \
@@ -143,7 +154,6 @@ $(eval $(call gb_Helper_register_executables_for_install,OOO,brand, \
 	$(call gb_Helper_optional,FUZZERS,mtpfuzzer) \
 	$(call gb_Helper_optional,FUZZERS,htmlfuzzer) \
 	$(call gb_Helper_optional,FUZZERS,sftfuzzer) \
-	$(if $(filter-out ANDROID HAIKU iOS MACOSX WNT,$(OS)),oosplash) \
 	soffice_bin \
 	$(if $(filter DESKTOP,$(BUILD_TYPE)),unopkg_bin) \
 	$(if $(filter WNT,$(OS)), \
@@ -329,6 +339,43 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ogltrans, \
 	OGLTrans \
 ))
 
+ifneq ($(ENABLE_WASM_STRIP_CANVAS),TRUE)
+$(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
+	canvastools \
+	$(if $(ENABLE_CAIRO_CANVAS),cairocanvas) \
+	canvasfactory \
+	cppcanvas \
+	$(if $(filter WNT,$(OS)),directx9canvas) \
+	$(if $(ENABLE_OPENGL_CANVAS),oglcanvas) \
+	$(if $(filter WNT,$(OS)),gdipluscanvas) \
+	simplecanvas \
+	vclcanvas \
+))
+endif
+
+ifneq ($(ENABLE_WASM_STRIP_CLUCENE),TRUE)
+$(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
+    $(call gb_Helper_optionals_or,HELPTOOLS XMLHELP,helplinker) \
+))
+endif
+
+ifneq ($(ENABLE_WASM_STRIP_GUESSLANG),TRUE)
+$(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
+	guesslang \
+))
+endif
+
+ifneq ($(ENABLE_WASM_STRIP_HUNSPELL),TRUE)
+$(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
+	hyphen \
+	lnth \
+	spell \
+	$(if $(filter iOS MACOSX,$(OS)), \
+		MacOSXSpell \
+	) \
+))
+endif
+
 $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
     avmedia \
     $(call gb_Helper_optional,AVMEDIA, \
@@ -342,14 +389,10 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
 	) \
 	basegfx \
 	bib \
-	$(if $(ENABLE_CAIRO_CANVAS),cairocanvas) \
-	canvasfactory \
-	canvastools \
 	chartcore \
 	chartcontroller \
 	$(call gb_Helper_optional,OPENCL,clew) \
 	$(if $(filter $(OS),WNT),,cmdmail) \
-	cppcanvas \
 	configmgr \
 	ctl \
 	dba \
@@ -362,8 +405,6 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
 	$(if $(filter-out MACOSX WNT,$(OS)),desktopbe1) \
 	$(if $(USING_X11),desktop_detector) \
 	$(call gb_Helper_optional,SCRIPTING,dlgprov) \
-	$(if $(filter WNT,$(OS)),directx9canvas) \
-	$(if $(ENABLE_OPENGL_CANVAS),oglcanvas) \
 	drawinglayer \
 	editeng \
 	$(if $(filter WNT,$(OS)),emser) \
@@ -379,19 +420,14 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
 	frm \
 	fsstorage \
 	fwk \
-	$(if $(filter WNT,$(OS)),gdipluscanvas) \
-	guesslang \
-    $(call gb_Helper_optionals_or,HELPTOOLS XMLHELP,helplinker) \
 	i18npool \
 	i18nsearch \
-	hyphen \
 	$(if $(ENABLE_JAVA),jdbc) \
 	$(if $(ENABLE_LDAP),ldapbe2) \
 	$(if $(filter WNT,$(OS)),WinUserInfoBe) \
 	localebe1 \
 	log \
 	lng \
-	lnth \
 	$(if $(filter $(OS),MACOSX),macbe1) \
 	$(if $(MERGELIBS),merged) \
 	migrationoo2 \
@@ -420,11 +456,9 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
 	sdd \
 	sdfilt \
 	sfx \
-	simplecanvas \
 	slideshow \
 	sot \
-	spell \
-	$(if $(DISABLE_GUI),,spl) \
+	$(if $(or $(DISABLE_GUI),$(ENABLE_WASM_STRIP_SPLASH)),,spl) \
 	storagefd \
 	$(call gb_Helper_optional,SCRIPTING,stringresource) \
 	svgio \
@@ -454,7 +488,6 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
 		vbahelper \
 	) \
 	vcl \
-	vclcanvas \
 	writerperfect \
 	xmlscript \
 	xmlfa \
@@ -475,9 +508,6 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
 		) \
 		fps_aqua \
 	) \
-	$(if $(filter iOS MACOSX,$(OS)), \
-		MacOSXSpell \
-	) \
 ))
 
 $(eval $(call gb_Helper_register_plugins_for_install,OOOLIBS,ooo, \
@@ -614,6 +644,14 @@ $(eval $(call gb_Helper_register_plugins_for_install,PRIVATELIBS_URE,ure, \
     sal_textenc \
 ))
 
+ifneq ($(ENABLE_WASM_STRIP_ACCESSIBILITY),TRUE)
+$(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooo, \
+	$(if $(filter WNT,$(OS)), \
+		winaccessibility \
+	) \
+))
+endif
+
 $(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooo, \
     $(call gb_Helper_optional,AVMEDIA, \
         $(if $(ENABLE_GSTREAMER_1_0),avmediagst) \
@@ -658,7 +696,6 @@ $(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooo, \
 		fps \
 		inprocserv \
 		UAccCOM \
-		winaccessibility \
 	) \
 ))
 
@@ -891,6 +928,18 @@ $(eval $(call gb_Helper_register_packages_for_install,sdk,\
 	) \
 ))
 
+ifneq ($(ENABLE_WASM_STRIP_PINGUSER),TRUE)
+$(eval $(call gb_Helper_register_packages_for_install,ooo,\
+	tipoftheday_images \
+))
+endif
+
+ifneq ($(ENABLE_WASM_STRIP_CANVAS),TRUE)
+$(eval $(call gb_Helper_register_packages_for_install,ooo,\
+	$(if $(ENABLE_OPENGL_CANVAS),canvas_opengl_shader) \
+))
+endif
+
 $(eval $(call gb_Helper_register_packages_for_install,ooo,\
 	$(if $(SYSTEM_LIBEXTTEXTCAT),,libexttextcat_fingerprint) \
 	officecfg_misc \
@@ -974,13 +1023,11 @@ $(eval $(call gb_Helper_register_packages_for_install,ooo,\
 	wizards_basicusr \
 	wizards_properties \
 	wizards_wizardshare \
-	tipoftheday_images \
 	toolbarmode_images \
 	vcl_theme_definitions \
 	$(if $(filter WNT,$(OS)), \
 		vcl_opengl_denylist \
 	) \
-	$(if $(ENABLE_OPENGL_CANVAS),canvas_opengl_shader) \
 	$(if $(filter SKIA,$(BUILD_TYPE)), \
 		vcl_skia_denylist ) \
 	$(if $(DISABLE_PYTHON),,$(if $(filter-out AIX,$(OS)), \
@@ -1170,9 +1217,14 @@ $(eval $(call gb_Helper_register_mos,\
 ))
 
 # UI configuration
+ifneq ($(ENABLE_WASM_STRIP_DBACCESS),TRUE)
 $(eval $(call gb_Helper_register_uiconfigs,\
-	cui \
 	$(call gb_Helper_optional,DBCONNECTIVITY,dbaccess) \
+))
+endif
+
+$(eval $(call gb_Helper_register_uiconfigs,\
+	cui \
 	desktop \
 	editeng \
 	filter \
diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index 6aa21286df1e..437501f6f1c3 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -551,6 +551,7 @@ endef
 gb_ExternalProject__use_hunspell :=
 
 else # !SYSTEM_HUNSPELL
+ifneq ($(ENABLE_WASM_STRIP_HUNSPELL),TRUE)
 
 define gb_LinkTarget__use_hunspell
 $(call gb_LinkTarget_add_defs,$(1),\
@@ -578,6 +579,7 @@ $(call gb_ExternalProject_use_external_project,$(1),hunspell)
 
 endef
 
+endif # ENABLE_WASM_STRIP_HUNSPELL
 endif # SYSTEM_HUNSPELL
 
 
@@ -1884,6 +1886,7 @@ endef
 gb_ExternalProject__use_epubgen :=
 
 else # !SYSTEM_EPUBGEN
+ifneq ($(ENABLE_WASM_STRIP_EPUB),TRUE)
 
 define gb_LinkTarget__use_epubgen
 $(call gb_LinkTarget_set_include,$(1),\
@@ -1901,6 +1904,7 @@ $(call gb_ExternalProject_use_external_project,$(1),libepubgen)
 
 endef
 
+endif # ENABLE_WASM_STRIP_EPUB
 endif # SYSTEM_EPUBGEN
 
 ifneq ($(SYSTEM_REVENGE),)
@@ -2842,7 +2846,6 @@ endif # SYSTEM_POPPLER
 
 endif # ENABLE_POPPLER
 
-
 ifneq ($(SYSTEM_CLUCENE),)
 
 define gb_LinkTarget__use_clucene
diff --git a/RepositoryModule_host.mk b/RepositoryModule_host.mk
index 64d9788b59e4..9aaedfd66ee8 100644
--- a/RepositoryModule_host.mk
+++ b/RepositoryModule_host.mk
@@ -20,8 +20,35 @@ $(eval $(call gb_Module_add_targets,libreoffice,\
 ))
 endif
 
+# WASM_CHART change
+ifneq ($(ENABLE_WASM_STRIP_CHART),TRUE)
+$(eval $(call gb_Module_add_moduledirs,libreoffice,\
+	chart2 \
+))
+endif
+
+# WASM_CANVAS change
+ifneq ($(ENABLE_WASM_STRIP_CANVAS),TRUE)
+$(eval $(call gb_Module_add_moduledirs,libreoffice,\
+	canvas \
+	cppcanvas \
+))
+endif
+
+ifneq ($(ENABLE_WASM_STRIP_DBACCESS),TRUE)
+$(eval $(call gb_Module_add_moduledirs,libreoffice,\
+	dbaccess \
+))
+endif
+
+ifneq ($(ENABLE_WASM_STRIP_ACCESSIBILITY),TRUE)
 $(eval $(call gb_Module_add_moduledirs,libreoffice,\
 	accessibility \
+	winaccessibility \
+))
+endif
+
+$(eval $(call gb_Module_add_moduledirs,libreoffice,\
 	android \
     $(if $(ENABLE_WASM_STRIP_BASIC_CALC_DRAW_MATH_IMPRESS),, \
 	animations \
@@ -36,19 +63,15 @@ $(eval $(call gb_Module_add_moduledirs,libreoffice,\
 	bean \
 	binaryurp \
 	bridges \
-	canvas \
-	chart2 \
 	cli_ure \
 	$(call gb_Helper_optional,DESKTOP,codemaker) \
 	comphelper \
 	configmgr \
 	connectivity \
-	cppcanvas \
 	cppu \
 	cppuhelper \
 	cpputools \
 	cui \
-	dbaccess \
 	desktop \
 	$(call gb_Helper_optional,DICTIONARIES,dictionaries) \
 	drawinglayer \
@@ -121,7 +144,9 @@ $(eval $(call gb_Module_add_moduledirs,libreoffice,\
 	$(call gb_Helper_optional,DESKTOP,setup_native) \
 	sfx2 \
 	shell \
+    $(if $(ENABLE_WASM_STRIP_BASIC_CALC_DRAW_MATH_IMPRESS),, \
 	slideshow \
+    ) \
 	smoketest \
 	solenv \
 	soltools \
@@ -159,7 +184,6 @@ $(eval $(call gb_Module_add_moduledirs,libreoffice,\
 	uui \
 	vbahelper \
 	vcl \
-	winaccessibility \
 	wizards \
 	writerfilter \
 	writerperfect \
diff --git a/basctl/Library_basctl.mk b/basctl/Library_basctl.mk
index f874dfe9cc54..122ae4a909a3 100644
--- a/basctl/Library_basctl.mk
+++ b/basctl/Library_basctl.mk
@@ -62,9 +62,14 @@ $(eval $(call gb_Library_use_libraries,basctl,\
 	xmlscript \
 ))
 
+ifneq ($(ENABLE_WASM_STRIP_ACCESSIBILITY),TRUE)
 $(eval $(call gb_Library_add_exception_objects,basctl,\
 	basctl/source/accessibility/accessibledialogcontrolshape \
 	basctl/source/accessibility/accessibledialogwindow \
+))
+endif
+
+$(eval $(call gb_Library_add_exception_objects,basctl,\
 	basctl/source/basicide/basdoc \
 	basctl/source/basicide/IDEComboBox \
 	basctl/source/basicide/basicrenderable \
diff --git a/chart2/Library_chartcontroller.mk b/chart2/Library_chartcontroller.mk
index 05f031415213..7eddba17f348 100644
--- a/chart2/Library_chartcontroller.mk
+++ b/chart2/Library_chartcontroller.mk
@@ -52,6 +52,7 @@ $(eval $(call gb_Library_use_libraries,chartcontroller,\
 
 $(eval $(call gb_Library_set_componentfile,chartcontroller,chart2/source/controller/chartcontroller))
 
+ifneq ($(ENABLE_WASM_STRIP_ACCESSIBILITY),TRUE)
 $(eval $(call gb_Library_add_exception_objects,chartcontroller,\
     chart2/source/controller/accessibility/AccessibleBase \
     chart2/source/controller/accessibility/AccessibleChartElement \
@@ -60,6 +61,10 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\
     chart2/source/controller/accessibility/AccessibleTextHelper \
     chart2/source/controller/accessibility/AccessibleViewForwarder \
     chart2/source/controller/accessibility/ChartElementFactory \
+))
+endif
+
+$(eval $(call gb_Library_add_exception_objects,chartcontroller,\
     chart2/source/controller/chartapiwrapper/AreaWrapper \
     chart2/source/controller/chartapiwrapper/AxisWrapper \
     chart2/source/controller/chartapiwrapper/Chart2ModelContact \
diff --git a/config_host.mk.in b/config_host.mk.in
index 487e1d08b311..4f56771cc8af 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -206,7 +206,23 @@ export ENABLE_SKIA_DEBUG=@ENABLE_SKIA_DEBUG@
 export ENABLE_SYMBOLS_FOR=@ENABLE_SYMBOLS_FOR@
 export ENABLE_VALGRIND=@ENABLE_VALGRIND@
 export ENABLE_WASM_STRIP=@ENABLE_WASM_STRIP@
+export ENABLE_WASM_STRIP_ACCESSIBILITY=@ENABLE_WASM_STRIP@
 export ENABLE_WASM_STRIP_BASIC_CALC_DRAW_MATH_IMPRESS=@ENABLE_WASM_STRIP@
+export ENABLE_WASM_STRIP_CANVAS=@ENABLE_WASM_STRIP@
+export ENABLE_WASM_STRIP_CHART=@ENABLE_WASM_STRIP@
+export ENABLE_WASM_STRIP_CLUCENE=@ENABLE_WASM_STRIP@
+export ENABLE_WASM_STRIP_DBACCESS=@ENABLE_WASM_STRIP@
+export ENABLE_WASM_STRIP_EPUB=@ENABLE_WASM_STRIP@
+export ENABLE_WASM_STRIP_EXTRA=@ENABLE_WASM_STRIP@
+export ENABLE_WASM_STRIP_GUESSLANG=@ENABLE_WASM_STRIP@
+export ENABLE_WASM_STRIP_HUNSPELL=@ENABLE_WASM_STRIP@
+export ENABLE_WASM_STRIP_LOCALES=@ENABLE_WASM_STRIP@
+export ENABLE_WASM_STRIP_PINGUSER=@ENABLE_WASM_STRIP@
+export ENABLE_WASM_STRIP_PREMULTIPLY=@ENABLE_WASM_STRIP@
+export ENABLE_WASM_STRIP_RECENT=@ENABLE_WASM_STRIP@
+export ENABLE_WASM_STRIP_RECOVERYUI=@ENABLE_WASM_STRIP@
+export ENABLE_WASM_STRIP_SPLASH=@ENABLE_WASM_STRIP@
+export ENABLE_WASM_STRIP_SWEXPORTS=@ENABLE_WASM_STRIP@
 export ENABLE_WERROR=@ENABLE_WERROR@
 export ENDIANNESS=@ENDIANNESS@
 export EPM=@EPM@
diff --git a/config_host/config_wasm_strip.h.in b/config_host/config_wasm_strip.h.in
new file mode 100644
index 000000000000..864fa4dc29ea
--- /dev/null
+++ b/config_host/config_wasm_strip.h.in
@@ -0,0 +1,24 @@
+#ifndef CONFIG_FEATURE_WASM_STRIP_H
+#define CONFIG_FEATURE_WASM_STRIP_H
+
+#define HAVE_FEATURE_WASM_STRIP 0
+
+#if HAVE_FEATURE_WASM_STRIP
+#define ENABLE_WASM_STRIP_ACCESSIBILITY
+#define ENABLE_WASM_STRIP_CANVAS
+#define ENABLE_WASM_STRIP_CHART
+#define ENABLE_WASM_STRIP_CLUCENE
+#define ENABLE_WASM_STRIP_DBACCESS
+#define ENABLE_WASM_STRIP_EPUB
+#define ENABLE_WASM_STRIP_EXTRA
+#define ENABLE_WASM_STRIP_GUESSLANG
+#define ENABLE_WASM_STRIP_HUNSPELL
+#define ENABLE_WASM_STRIP_PINGUSER
+#define ENABLE_WASM_STRIP_PREMULTIPLY
+#define ENABLE_WASM_STRIP_RECENT
+#define ENABLE_WASM_STRIP_RECOVERYUI
+#define ENABLE_WASM_STRIP_SPLASH
+#define ENABLE_WASM_STRIP_SWEXPORTS
+#endif
+
+#endif
diff --git a/configure.ac b/configure.ac
index a13e3e84c711..3cc114b9ae4a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2999,6 +2999,8 @@ if test "$enable_wasm_strip" = "yes"; then
 
     test "${with_fonts+set}" = set || with_fonts=yes
     test "${with_locales+set}" = set || with_locales=en
+
+    AC_DEFINE(HAVE_FEATURE_WASM_STRIP)
 fi
 
 ENABLE_SERVICES_RDB_FROM_BUILD=
@@ -14480,6 +14482,7 @@ AC_CONFIG_HEADERS([config_host/config_oauth2.h])
 AC_CONFIG_HEADERS([config_host/config_poppler.h])
 AC_CONFIG_HEADERS([config_host/config_python.h])
 AC_CONFIG_HEADERS([config_host/config_writerperfect.h])
+AC_CONFIG_HEADERS([config_host/config_wasm_strip.h])
 AC_CONFIG_HEADERS([solenv/lockfile/autoconf.h])
 AC_OUTPUT
 
diff --git a/cui/Library_cui.mk b/cui/Library_cui.mk
index 686bd039f251..5813ebe10ba3 100644
--- a/cui/Library_cui.mk
+++ b/cui/Library_cui.mk
@@ -93,6 +93,18 @@ $(eval $(call gb_Library_add_exception_objects,cui,\
 ))
 endif
 
+ifneq ($(ENABLE_WASM_STRIP_PINGUSER),TRUE)
+$(eval $(call gb_Library_add_exception_objects,cui,\
+    cui/source/dialogs/tipofthedaydlg \
+))
+endif
+
+ifneq ($(ENABLE_WASM_STRIP_HUNSPELL),TRUE)
+$(eval $(call gb_Library_add_exception_objects,cui,\
+    cui/source/dialogs/hyphen \
+))
+endif
+
 $(eval $(call gb_Library_add_exception_objects,cui,\
     cui/source/customize/acccfg \
     cui/source/customize/cfg \
@@ -126,9 +138,7 @@ $(eval $(call gb_Library_add_exception_objects,cui,\
     cui/source/dialogs/hlmailtp \
     cui/source/dialogs/hlmarkwn \
     cui/source/dialogs/hltpbase \
-    cui/source/dialogs/hyphen \
     cui/source/dialogs/iconcdlg \
-    cui/source/dialogs/tipofthedaydlg \
     cui/source/dialogs/insdlg \
     cui/source/dialogs/insrc \
     cui/source/dialogs/linkdlg \
diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk
index daa8a1e3d55d..301d29303981 100644
--- a/cui/UIConfig_cui.mk
+++ b/cui/UIConfig_cui.mk
@@ -15,6 +15,12 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
 ))
 endif
 
+ifneq ($(ENABLE_WASM_STRIP_PINGUSER),TRUE)
+$(eval $(call gb_UIConfig_add_uifiles,cui,\
+	cui/uiconfig/ui/tipofthedaydialog \
+))
+endif
+
 $(eval $(call gb_UIConfig_add_uifiles,cui,\
 	cui/uiconfig/ui/aboutdialog \
 	cui/uiconfig/ui/aboutconfigdialog\
@@ -99,7 +105,6 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
 	cui/uiconfig/ui/hyphenate \
 	cui/uiconfig/ui/iconchangedialog \
 	cui/uiconfig/ui/iconselectordialog \
-	cui/uiconfig/ui/tipofthedaydialog \
 	cui/uiconfig/ui/insertfloatingframe \
 	cui/uiconfig/ui/insertoleobject \
 	cui/uiconfig/ui/insertrowcolumn \
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index 943bf5c84023..a3041e72b248 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -18,6 +18,7 @@
  */
 
 #include <config_extensions.h>
+#include <config_wasm_strip.h>
 
 #include <align.hxx>
 #include "dlgfact.hxx"
@@ -135,7 +136,11 @@ short AbstractFmShowColsDialog_Impl::Execute()
 
 short AbstractHyphenWordDialog_Impl::Execute()
 {
+#ifndef ENABLE_WASM_STRIP_HUNSPELL
     return m_xDlg->run();
+#else
+    return 0;
+#endif
 }
 
 short AbstractThesaurusDialog_Impl::Execute()
@@ -1096,7 +1101,16 @@ VclPtr<AbstractHyphenWordDialog> AbstractDialogFactory_Impl::CreateHyphenWordDia
                                                 css::uno::Reference< css::linguistic2::XHyphenator >  &xHyphen,
                                                 SvxSpellWrapper* pWrapper)
 {
+#ifndef ENABLE_WASM_STRIP_EXTRA
     return VclPtr<AbstractHyphenWordDialog_Impl>::Create(std::make_unique<SvxHyphenWordDialog>(rWord, nLang, pParent, xHyphen, pWrapper));
+#else
+    (void) pParent;
+    (void) rWord;
+    (void) nLang;
+    (void) xHyphen;
+    (void) pWrapper;
+    return nullptr;
+#endif
 }
 
 VclPtr<AbstractFmShowColsDialog> AbstractDialogFactory_Impl::CreateFmShowColsDialog(weld::Window* pParent)
@@ -1684,7 +1698,7 @@ VclPtr<AbstractAdditionsDialog> AbstractDialogFactory_Impl::CreateAdditionsDialo
 #else
     (void) pParent;
     (void) sAdditionsTag;
-    return VclPtr<AbstractAdditionsDialog>(nullptr);
+    return nullptr;
 #endif
 }
 
@@ -1705,8 +1719,13 @@ AbstractDialogFactory_Impl::CreateGraphicTestsDialog(weld::Window* pParent)
 VclPtr<VclAbstractDialog>
 AbstractDialogFactory_Impl::CreateTipOfTheDayDialog(weld::Window* pParent)
 {
+#ifndef ENABLE_WASM_STRIP_PINGUSER
     return VclPtr<CuiAbstractTipController_Impl>::Create(
         std::make_shared<TipOfTheDayDialog>(pParent));
+#else
+    (void) pParent;
+    return nullptr;
+#endif
 }
 
 VclPtr<VclAbstractDialog>
diff --git a/desktop/Library_deployment.mk b/desktop/Library_deployment.mk
index 57fe1c55a0b6..dc36691b63b1 100644
--- a/desktop/Library_deployment.mk
+++ b/desktop/Library_deployment.mk
@@ -39,6 +39,15 @@ $(eval $(call gb_Library_use_libraries,deployment,\
 
 $(eval $(call gb_Library_set_componentfile,deployment,desktop/source/deployment/deployment))
 
+ifneq ($(ENABLE_WASM_STRIP_CLUCENE),TRUE)
+$(eval $(call gb_Library_set_componentfile,deployment,desktop/source/deployment/deployment.extended))
+
+$(eval $(call gb_Library_add_exception_objects,deployment,\
+    desktop/source/deployment/registry/help/dp_help \
+    desktop/source/deployment/registry/component/dp_component \
+))
+endif
+
 $(eval $(call gb_Library_add_exception_objects,deployment,\
     desktop/source/deployment/dp_log \
     desktop/source/deployment/dp_persmap \
@@ -51,7 +60,6 @@ $(eval $(call gb_Library_add_exception_objects,deployment,\
     desktop/source/deployment/manager/dp_managerfac \
     desktop/source/deployment/manager/dp_properties \
     desktop/source/deployment/registry/component/dp_compbackenddb \
-    desktop/source/deployment/registry/component/dp_component \
     desktop/source/deployment/registry/configuration/dp_configuration \
     desktop/source/deployment/registry/configuration/dp_configurationbackenddb \
     desktop/source/deployment/registry/dp_backend \
@@ -59,7 +67,6 @@ $(eval $(call gb_Library_add_exception_objects,deployment,\
     desktop/source/deployment/registry/dp_registry \
     desktop/source/deployment/registry/executable/dp_executable \
     desktop/source/deployment/registry/executable/dp_executablebackenddb \
-    desktop/source/deployment/registry/help/dp_help \
     desktop/source/deployment/registry/help/dp_helpbackenddb \
     desktop/source/deployment/registry/package/dp_extbackenddb \
     desktop/source/deployment/registry/package/dp_package \
@@ -71,11 +78,9 @@ $(eval $(call gb_Library_add_exception_objects,deployment,\
 ))
 
 ifneq (,$(filter XMLHELP,$(BUILD_TYPE)))
-
 $(eval $(call gb_Library_use_libraries,deployment,\
     helplinker \
 ))
-
 endif
 
 # vim: set ts=4 sw=4 et:
diff --git a/desktop/Module_desktop.mk b/desktop/Module_desktop.mk
index 3be81056aad9..265f0248534e 100644
--- a/desktop/Module_desktop.mk
+++ b/desktop/Module_desktop.mk
@@ -20,7 +20,7 @@ $(eval $(call gb_Module_add_targets,desktop,\
     $(if $(ENABLE_BREAKPAD), \
         Library_crashreport \
         ) \
-    $(if $(DISABLE_GUI),,Library_spl) \
+    $(if $(or $(DISABLE_GUI),$(ENABLE_WASM_STRIP_SPLASH)),,Library_spl) \
     Package_branding \
     $(if $(CUSTOM_BRAND_DIR),Package_branding_custom) \
     UIConfig_deployment \
@@ -107,9 +107,11 @@ $(eval $(call gb_Module_add_targets,desktop,\
 
 else ifeq (,$(filter MACOSX ANDROID iOS HAIKU,$(OS)))
 
+ifneq ($(ENABLE_WASM_STRIP_ACCESSIBILITY),TRUE)
 $(eval $(call gb_Module_add_targets,desktop,\
     $(if $(DISABLE_DYNLOADING),,Executable_oosplash) \
 ))
+endif # ENABLE_WASM_STRIP_ACCESSIBILITY
 
 endif
 
diff --git a/desktop/Pagein_common.mk b/desktop/Pagein_common.mk
index d0a0e689c2d2..96d5fe49f919 100644
--- a/desktop/Pagein_common.mk
+++ b/desktop/Pagein_common.mk
@@ -9,6 +9,12 @@
 
 $(eval $(call gb_Pagein_Pagein,common))
 
+ifneq ($(ENABLE_WASM_STRIP_CLUCENE),TRUE)
+$(eval $(call gb_Pagein_add_objects,common,\
+    helplinker \
+))
+endif
+
 # sorted in approx. reverse load order (ld.so.1)
 $(eval $(call gb_Pagein_add_objects,common,\
     $(if $(MERGELIBS),merged) \
@@ -56,7 +62,6 @@ $(eval $(call gb_Pagein_add_objects,common,\
     svt \
     spl \
     avmedia \
-    helplinker \
     sax \
     fsstorage \
     desktopbe1 \
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 86bec9a11c51..3addf07e5a42 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -24,6 +24,7 @@
 #include <config_java.h>
 #include <config_folders.h>
 #include <config_extensions.h>
+#include <config_wasm_strip.h>
 
 #include <sal/config.h>
 
@@ -969,6 +970,7 @@ struct RefClearGuard
     @param  bEmergencySave
             differs between EMERGENCY_SAVE and RECOVERY
 */
+#ifndef ENABLE_WASM_STRIP_RECOVERYUI
 bool impl_callRecoveryUI(bool bEmergencySave     ,
                          bool bExistsRecoveryData)
 {
@@ -1000,6 +1002,7 @@ bool impl_callRecoveryUI(bool bEmergencySave     ,
     aRet >>= bRet;
     return bRet;
 }
+#endif
 
 bool impl_bringToFrontRecoveryUI()
 {
@@ -1149,9 +1152,11 @@ void Desktop::Exception(ExceptionCategory nCategory)
         // Save all open documents so they will be reopened
         // the next time the application is started
         // returns true if at least one document could be saved...
+#ifndef ENABLE_WASM_STRIP_RECOVERYUI
         bRestart = impl_callRecoveryUI(
                         true , // force emergency save
                         false);
+#endif
     }
 
     FlushConfiguration();
@@ -1165,8 +1170,10 @@ void Desktop::Exception(ExceptionCategory nCategory)
             osl_removeSignalHandler( pSignalHandler );
 
         restartOnMac(false);
+#ifndef ENABLE_WASM_STRIP_SPLASH
         if ( m_rSplashScreen.is() )
             m_rSplashScreen->reset();
+#endif
 
         _exit( EXITHELPER_CRASH_WITH_RESTART );
     }
@@ -1269,7 +1276,9 @@ int Desktop::Main()
     Translate::SetReadStringHook(ReplaceStringHookProc);
 
     // Startup screen
+#ifndef ENABLE_WASM_STRIP_SPLASH
     OpenSplashScreen();
+#endif
 
     SetSplashScreenProgress(10);
 
@@ -1712,8 +1721,10 @@ int Desktop::doShutdown()
     if ( bRR )
     {
         restartOnMac(true);
+#ifndef ENABLE_WASM_STRIP_SPLASH
         if ( m_rSplashScreen.is() )
             m_rSplashScreen->reset();
+#endif
 
         return EXITHELPER_NORMAL_RESTART;
     }
@@ -2007,8 +2018,9 @@ void Desktop::OpenClients()
     }
     else
     {
-        bool bCrashed            = false;
         bool bExistsRecoveryData = false;
+#ifndef ENABLE_WASM_STRIP_RECOVERYUI
+        bool bCrashed            = false;
         bool bExistsSessionData  = false;
         bool const bDisableRecovery
             = getenv("OOO_DISABLE_RECOVERY") != nullptr
@@ -2034,6 +2046,7 @@ void Desktop::OpenClients()
                 TOOLS_WARN_EXCEPTION( "desktop.app", "Error during recovery");
             }
         }
+#endif
 
         Reference< XSessionManagerListener2 > xSessionListener;
         try
@@ -2392,6 +2405,7 @@ void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent )
     }
 }
 
+#ifndef ENABLE_WASM_STRIP_SPLASH
 void Desktop::OpenSplashScreen()
 {
     const CommandLineArgs &rCmdLine = GetCommandLineArgs();
@@ -2441,33 +2455,43 @@ void Desktop::OpenSplashScreen()
 
     if(m_rSplashScreen.is())
             m_rSplashScreen->start("SplashScreen", 100);
-
 }
+#endif
 
 void Desktop::SetSplashScreenProgress(sal_Int32 iProgress)
 {
+#ifdef ENABLE_WASM_STRIP_SPLASH
+    (void) iProgress;
+#else
     if(m_rSplashScreen.is())
     {
         m_rSplashScreen->setValue(iProgress);
     }
+#endif
 }
 
 void Desktop::SetSplashScreenText( const OUString& rText )
 {
+#ifdef ENABLE_WASM_STRIP_SPLASH
+    (void) rText;
+#else
     if( m_rSplashScreen.is() )
     {
         m_rSplashScreen->setText( rText );
     }
+#endif
 }
 
 void Desktop::CloseSplashScreen()
 {
+#ifndef ENABLE_WASM_STRIP_SPLASH
     if(m_rSplashScreen.is())
     {
         SolarMutexGuard ensureSolarMutex;
         m_rSplashScreen->end();
         m_rSplashScreen = nullptr;
     }
+#endif
 }
 
 
diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx
index 4d5a3bb78396..6c64502e9d38 100644
--- a/desktop/source/app/cmdlineargs.cxx
+++ b/desktop/source/app/cmdlineargs.cxx
@@ -275,6 +275,26 @@ CommandLineArgs::CommandLineArgs( Supplier& supplier )
 
 void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
 {
+#ifdef ENABLE_WASM_STRIP
+    // use hard-coded init-params for wasm '-nolockcheck -norestore -nologo -writer'
+    // no restore tries
+    m_norestore = true;
+    // no logo needed
+    m_nologo = true;
+#if HAVE_FEATURE_MULTIUSER_ENVIRONMENT
+    // no lock-checks needed
+    m_nolockcheck = true;
+#endif
+    // start with writer only
+    m_writer = true;
+    m_bDocumentArgs = true;
+
+    m_bEmpty = false;
+
+    // return to avoid #elif
+    return;
+#endif
+
     m_cwdUrl = supplier.getCwdUrl();
     CommandLineEvent eCurrentEvent = CommandLineEvent::Open;
 
diff --git a/desktop/source/deployment/deployment.component b/desktop/source/deployment/deployment.component
index f7a481bf43c9..79c966deadc0 100644
--- a/desktop/source/deployment/deployment.component
+++ b/desktop/source/deployment/deployment.component
@@ -38,10 +38,6 @@
     constructor="com_sun_star_comp_deployment_ProgressLog_get_implementation">
     <service name="com.sun.star.comp.deployment.ProgressLog"/>
   </implementation>
-  <implementation name="com.sun.star.comp.deployment.component.PackageRegistryBackend"
-    constructor="com_sun_star_comp_deployment_component_PackageRegistryBackend_get_implementation">
-    <service name="com.sun.star.deployment.PackageRegistryBackend"/>
-  </implementation>
   <implementation name="com.sun.star.comp.deployment.configuration.PackageRegistryBackend"
     constructor="com_sun_star_comp_deployment_configuration_PackageRegistryBackend_get_implementation">
     <service name="com.sun.star.deployment.PackageRegistryBackend"/>
@@ -50,10 +46,6 @@
     constructor="com_sun_star_comp_deployment_executable_PackageRegistryBackend_get_implementation">
     <service name="com.sun.star.deployment.PackageRegistryBackend"/>
   </implementation>
-  <implementation name="com.sun.star.comp.deployment.help.PackageRegistryBackend"
-    constructor="com_sun_star_comp_deployment_help_PackageRegistryBackend_get_implementation">
-    <service name="com.sun.star.deployment.PackageRegistryBackend"/>
-  </implementation>
   <implementation name="com.sun.star.comp.deployment.script.PackageRegistryBackend"
     constructor="com_sun_star_comp_deployment_script_PackageRegistryBackend_get_implementation">
     <service name="com.sun.star.deployment.PackageRegistryBackend"/>
diff --git a/desktop/source/deployment/deployment.extended.component b/desktop/source/deployment/deployment.extended.component
new file mode 100644
index 000000000000..8d0b70a9c028
--- /dev/null
+++ b/desktop/source/deployment/deployment.extended.component
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ -->
+
+<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
+    xmlns="http://openoffice.org/2010/uno-components">
+  <implementation name="com.sun.star.comp.deployment.component.PackageRegistryBackend"
+    constructor="com_sun_star_comp_deployment_component_PackageRegistryBackend_get_implementation">
+    <service name="com.sun.star.deployment.PackageRegistryBackend"/>
+  </implementation>
+  <implementation name="com.sun.star.comp.deployment.help.PackageRegistryBackend"
+    constructor="com_sun_star_comp_deployment_help_PackageRegistryBackend_get_implementation">
+    <service name="com.sun.star.deployment.PackageRegistryBackend"/>
+  </implementation>
+</component>
diff --git a/drawinglayer/Library_drawinglayer.mk b/drawinglayer/Library_drawinglayer.mk
index 158ea62be0ac..703d1960a618 100644
--- a/drawinglayer/Library_drawinglayer.mk
+++ b/drawinglayer/Library_drawinglayer.mk
@@ -29,11 +29,16 @@ $(eval $(call gb_Library_use_externals,drawinglayer,\
 	libxml2 \
 ))
 
+ifneq ($(ENABLE_WASM_STRIP_CANVAS),TRUE)
 $(eval $(call gb_Library_use_libraries,drawinglayer,\
-    basegfx \
     canvastools \
-    comphelper \
     cppcanvas \
+))
+endif
+
+$(eval $(call gb_Library_use_libraries,drawinglayer,\
+    basegfx \
+    comphelper \
     cppu \
     cppuhelper \
     i18nlangtag \
diff --git a/editeng/Library_editeng.mk b/editeng/Library_editeng.mk
index 1237954ad6e9..6602793e3e02 100644
--- a/editeng/Library_editeng.mk
+++ b/editeng/Library_editeng.mk
@@ -35,6 +35,7 @@ $(eval $(call gb_Library_add_defs,editeng,\
 
 $(eval $(call gb_Library_use_sdk_api,editeng))
 
+ifneq ($(ENABLE_WASM_STRIP_ACCESSIBILITY),TRUE)
 $(eval $(call gb_Library_add_exception_objects,editeng,\
     editeng/source/accessibility/AccessibleComponentBase \
     editeng/source/accessibility/AccessibleContextBase \
@@ -45,6 +46,10 @@ $(eval $(call gb_Library_add_exception_objects,editeng,\
     editeng/source/accessibility/AccessibleSelectionBase \
     editeng/source/accessibility/AccessibleStaticTextBase \
     editeng/source/accessibility/AccessibleStringWrap \
+))
+endif
+
+$(eval $(call gb_Library_add_exception_objects,editeng,\
     editeng/source/editeng/editattr \
     editeng/source/editeng/editdata \
     editeng/source/editeng/editdbg \
diff --git a/editeng/source/misc/splwrap.cxx b/editeng/source/misc/splwrap.cxx
index b51c9c97b613..ef3d7bb89ac0 100644
--- a/editeng/source/misc/splwrap.cxx
+++ b/editeng/source/misc/splwrap.cxx
@@ -17,6 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <config_wasm_strip.h>
+
 #include <rtl/ustring.hxx>
 #include <i18nlangtag/languagetag.hxx>
 #include <vcl/svapp.hxx>
@@ -249,6 +251,9 @@ void SvxSpellWrapper::InsertHyphen( const sal_Int32 )
 // Testing of the document areas in the order specified by the flags
 void SvxSpellWrapper::SpellDocument( )
 {
+#ifdef ENABLE_WASM_STRIP_HUNSPELL
+    return;
+#else
     if ( bOtherCntnt )
     {
         bReverse = false;
@@ -275,6 +280,7 @@ void SvxSpellWrapper::SpellDocument( )
                         xHyph, this ));
         pDlg->Execute();
     }
+#endif
 }
 
 
diff --git a/external/Module_external.mk b/external/Module_external.mk
index 4566d825301c..6d015590587e 100644
--- a/external/Module_external.mk
+++ b/external/Module_external.mk
@@ -13,6 +13,18 @@ ifeq ($(COM),MSC)
 $(eval $(call gb_Module_add_moduledir,external,msc-externals))
 endif
 
+ifneq ($(ENABLE_WASM_STRIP_CLUCENE),TRUE)
+$(eval $(call gb_Module_add_moduledirs,external,\
+	$(call gb_Helper_optional,CLUCENE,clucene) \
+))
+endif
+
+ifneq ($(ENABLE_WASM_STRIP_EPUB),TRUE)
+$(eval $(call gb_Module_add_moduledirs,external,\
+	$(call gb_Helper_optional,EPUBGEN,libepubgen) \
+))
+endif
+
 $(eval $(call gb_Module_add_moduledirs,external,\
 	$(call gb_Helper_optional,XMLSEC,xmlsec) \
 	$(call gb_Helper_optional,ABW,libabw) \
@@ -25,7 +37,6 @@ $(eval $(call gb_Module_add_moduledirs,external,\
 	$(call gb_Helper_optional,CAIRO,cairo) \
 	$(call gb_Helper_optional,CDR,libcdr) \
 	$(call gb_Helper_optional,OPENCL,clew) \
-	$(call gb_Helper_optional,CLUCENE,clucene) \
 	$(call gb_Helper_optional,LIBCMIS,libcmis) \
 	$(call gb_Helper_optional,COINMP,coinmp) \
 	$(call gb_Helper_optional,CPPUNIT,cppunit) \
@@ -35,7 +46,6 @@ $(eval $(call gb_Module_add_moduledirs,external,\
 	$(call gb_Helper_optional,EBOOK,libebook) \
 	$(call gb_Helper_optional,EPM,epm) \
 	$(call gb_Helper_optional,EPOXY,epoxy) \
-	$(call gb_Helper_optional,EPUBGEN,libepubgen) \
 	$(call gb_Helper_optional,ETONYEK,libetonyek) \
 	$(call gb_Helper_optional,EXPAT,expat) \
 	$(call gb_Helper_optional,FIREBIRD,firebird) \
diff --git a/external/hunspell/StaticLibrary_hunspell.mk b/external/hunspell/StaticLibrary_hunspell.mk
index 02d534f69169..3a2eccafb0aa 100644
--- a/external/hunspell/StaticLibrary_hunspell.mk
+++ b/external/hunspell/StaticLibrary_hunspell.mk
@@ -20,6 +20,12 @@ $(eval $(call gb_StaticLibrary_add_defs,hunspell,\
 	-DOPENOFFICEORG \
 ))
 
+ifneq ($(ENABLE_WASM_STRIP_HUNSPELL),TRUE)
+$(eval $(call gb_StaticLibrary_add_generated_exception_objects,hunspell,\
+	UnpackedTarball/hunspell/src/hunspell/hunspell \
+))
+endif
+
 $(eval $(call gb_StaticLibrary_add_generated_exception_objects,hunspell,\
 	UnpackedTarball/hunspell/src/hunspell/affentry \
 	UnpackedTarball/hunspell/src/hunspell/affixmgr \
@@ -30,7 +36,6 @@ $(eval $(call gb_StaticLibrary_add_generated_exception_objects,hunspell,\
 	UnpackedTarball/hunspell/src/hunspell/hunzip \
 	UnpackedTarball/hunspell/src/hunspell/filemgr \
 	UnpackedTarball/hunspell/src/hunspell/replist \
-	UnpackedTarball/hunspell/src/hunspell/hunspell \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/hyphen/ExternalProject_hyphen.mk b/external/hyphen/ExternalProject_hyphen.mk
index 63d167f7804b..1419c9b02890 100644
--- a/external/hyphen/ExternalProject_hyphen.mk
+++ b/external/hyphen/ExternalProject_hyphen.mk
@@ -9,7 +9,9 @@
 
 $(eval $(call gb_ExternalProject_ExternalProject,hyphen))
 
+ifneq ($(ENABLE_WASM_STRIP_HUNSPELL),TRUE)
 $(eval $(call gb_ExternalProject_use_external,hyphen,hunspell))
+endif
 
 $(eval $(call gb_ExternalProject_register_targets,hyphen,\
 	build \
diff --git a/external/mythes/ExternalProject_mythes.mk b/external/mythes/ExternalProject_mythes.mk
index 298607f0aa73..6a1e9b14e882 100644
--- a/external/mythes/ExternalProject_mythes.mk
+++ b/external/mythes/ExternalProject_mythes.mk
@@ -9,7 +9,9 @@
 
 $(eval $(call gb_ExternalProject_ExternalProject,mythes))
 
+ifneq ($(ENABLE_WASM_STRIP_HUNSPELL),TRUE)
 $(eval $(call gb_ExternalProject_use_external,mythes,hunspell))
+endif
 
 $(eval $(call gb_ExternalProject_register_targets,mythes,\
 	build \
diff --git a/extras/Module_extras.mk b/extras/Module_extras.mk
index cf7177c21180..516209c5df49 100644
--- a/extras/Module_extras.mk
+++ b/extras/Module_extras.mk
@@ -61,7 +61,7 @@ $(eval $(call gb_Module_add_l10n_targets,extras,\
 ifneq ($(WITH_GALLERY_BUILD),)
 $(eval $(call gb_Module_add_targets,extras,\
 	Gallery_backgrounds \
-	Gallery_sound \
+    $(call gb_Helper_optional,AVMEDIA,Gallery_sound) \
 ))
 endif
 
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index a1a8978e04ff..6e28a4da9a33 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -17,6 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <config_wasm_strip.h>
+
 #include "impdialog.hxx"
 #include <strings.hrc>
 #include <officecfg/Office/Common.hxx>
@@ -349,7 +351,7 @@ short ImpPDFTabDialog::Ok( )
 {
     // here the whole mechanism of the base class is not used
     // when Ok is hit, the user means 'convert to PDF', so simply close with ok
-
+#ifndef ENABLE_WASM_STRIP_ACCESSIBILITY
     if (getGeneralPage()->IsPdfUaSelected())
     {
         SfxObjectShell* pShell = SfxObjectShell::GetShellFromComponent(mrDoc);
@@ -363,6 +365,8 @@ short ImpPDFTabDialog::Ok( )
             }
         }
     }
+#endif
+
     return RET_OK;
 }
 
diff --git a/framework/Library_fwk.mk b/framework/Library_fwk.mk
index c8ffb1f1b36b..90cba1d7652f 100644
--- a/framework/Library_fwk.mk
+++ b/framework/Library_fwk.mk
@@ -61,6 +61,12 @@ $(eval $(call gb_Library_use_libraries,fwk,\
     vcl \
 ))
 
+ifneq ($(ENABLE_WASM_STRIP_RECOVERYUI),TRUE)
+$(eval $(call gb_Library_add_exception_objects,fwk,\
+    framework/source/services/autorecovery \
+))
+endif
+
 $(eval $(call gb_Library_add_exception_objects,fwk,\
     framework/source/accelerators/acceleratorcache \
     framework/source/accelerators/acceleratorconfiguration \
@@ -150,7 +156,6 @@ $(eval $(call gb_Library_add_exception_objects,fwk,\
     framework/source/recording/dispatchrecorder \
     framework/source/recording/dispatchrecordersupplier \
     framework/source/services/ContextChangeEventMultiplexer \
-    framework/source/services/autorecovery \
     framework/source/services/desktop \
     framework/source/services/dispatchhelper \
     framework/source/services/frame \
diff --git a/framework/util/autorecovery.component b/framework/util/autorecovery.component
new file mode 100644
index 000000000000..d3e457cb1ce0
--- /dev/null
+++ b/framework/util/autorecovery.component
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ -->
+
+<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
+    xmlns="http://openoffice.org/2010/uno-components">
+  <implementation name="com.sun.star.comp.framework.AutoRecovery"
+      constructor="com_sun_star_comp_framework_AutoRecovery_get_implementation"
+      single-instance="true">
+    <service name="com.sun.star.frame.AutoRecovery"/>
+    <singleton name="com.sun.star.frame.theAutoRecovery"/>
+  </implementation>
+</component>
diff --git a/framework/util/fwk.component b/framework/util/fwk.component
index 2b9eb7807fee..019549f29de7 100644
--- a/framework/util/fwk.component
+++ b/framework/util/fwk.component
@@ -27,12 +27,6 @@
       constructor="com_sun_star_comp_framework_AddonsToolBarFactory_get_implementation">
     <service name="com.sun.star.ui.ToolBarFactory"/>
   </implementation>
-  <implementation name="com.sun.star.comp.framework.AutoRecovery"
-      constructor="com_sun_star_comp_framework_AutoRecovery_get_implementation"
-      single-instance="true">
-    <service name="com.sun.star.frame.AutoRecovery"/>
-    <singleton name="com.sun.star.frame.theAutoRecovery"/>
-  </implementation>
   <implementation name="com.sun.star.comp.framework.ControlMenuController"
       constructor="com_sun_star_comp_framework_ControlMenuController_get_implementation">
     <service name="com.sun.star.frame.PopupMenuController"/>
diff --git a/i18npool/source/breakiterator/breakiteratorImpl.cxx b/i18npool/source/breakiterator/breakiteratorImpl.cxx
index a449be4d17fe..71f371a7eddc 100644
--- a/i18npool/source/breakiterator/breakiteratorImpl.cxx
+++ b/i18npool/source/breakiterator/breakiteratorImpl.cxx
@@ -16,6 +16,7 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
+
 #include <config_locales.h>
 
 #include <breakiteratorImpl.hxx>
diff --git a/include/vcl/BitmapTools.hxx b/include/vcl/BitmapTools.hxx
index 8b1a81413d01..8a79e5a7040a 100644
--- a/include/vcl/BitmapTools.hxx
+++ b/include/vcl/BitmapTools.hxx
@@ -11,6 +11,8 @@
 #define INCLUDED_VCL_BITMAP_TOOLS_HXX
 
 #include <config_cairo_canvas.h>
+#include <config_wasm_strip.h>
+
 #include <vcl/bitmapex.hxx>
 #include <vcl/ImageTree.hxx>
 #if ENABLE_CAIRO_CANVAS
@@ -26,10 +28,12 @@ namespace com::sun::star::geometry { struct IntegerRectangle2D; }
 
 namespace vcl::bitmap {
 
+#ifndef ENABLE_WASM_STRIP_PREMULTIPLY
 typedef std::array<std::array<sal_uInt8, 256>, 256> lookup_table;
 
 VCL_DLLPUBLIC lookup_table const & get_premultiply_table();
 VCL_DLLPUBLIC lookup_table const & get_unpremultiply_table();
+#endif
 
 sal_uInt8 unpremultiply(sal_uInt8 c, sal_uInt8 a);
 sal_uInt8 premultiply(sal_uInt8 c, sal_uInt8 a);
diff --git a/lingucomponent/Library_guesslang.mk b/lingucomponent/Library_guesslang.mk
index 55f9225722a5..3363e6aa1831 100644
--- a/lingucomponent/Library_guesslang.mk
+++ b/lingucomponent/Library_guesslang.mk
@@ -12,10 +12,15 @@ $(eval $(call gb_Library_Library,guesslang))
 
 $(eval $(call gb_Library_set_componentfile,guesslang,lingucomponent/source/languageguessing/guesslang))
 
+ifneq ($(ENABLE_WASM_STRIP_GUESSLANG),TRUE)
 $(eval $(call gb_Library_use_externals,guesslang,\
-	boost_headers \
 	libexttextcat \
 ))
+endif
+
+$(eval $(call gb_Library_use_externals,guesslang,\
+	boost_headers \
+))
 
 $(eval $(call gb_Library_use_sdk_api,guesslang))
 
diff --git a/lingucomponent/Module_lingucomponent.mk b/lingucomponent/Module_lingucomponent.mk
index 2bde5d5391e5..9f19dcedbc67 100644
--- a/lingucomponent/Module_lingucomponent.mk
+++ b/lingucomponent/Module_lingucomponent.mk
@@ -10,13 +10,23 @@
 
 $(eval $(call gb_Module_Module,lingucomponent))
 
+ifneq ($(ENABLE_WASM_STRIP_GUESSLANG),TRUE)
 $(eval $(call gb_Module_add_targets,lingucomponent,\
 	Library_guesslang \
+))
+endif
+
+ifneq ($(ENABLE_WASM_STRIP_HUNSPELL),TRUE)
+$(eval $(call gb_Module_add_targets,lingucomponent,\
 	Library_hyphen \
 	Library_lnth \
-	$(if $(filter iOS MACOSX,$(OS)),Library_MacOSXSpell) \
 	Library_spell \
 	StaticLibrary_ulingu \
+))
+endif
+
+$(eval $(call gb_Module_add_targets,lingucomponent,\
+	$(if $(filter iOS MACOSX,$(OS)),Library_MacOSXSpell) \
 	Library_numbertext \
 ))
 
diff --git a/oox/Library_oox.mk b/oox/Library_oox.mk
index 6550a3942c88..113d160b644b 100644
--- a/oox/Library_oox.mk
+++ b/oox/Library_oox.mk
@@ -83,28 +83,10 @@ endif
 
 $(eval $(call gb_Library_set_componentfile,oox,oox/util/oox))
 
+# WASM_CHART change
+ifeq (,$(ENABLE_WASM_STRIP_CHART))
 $(eval $(call gb_Library_add_exception_objects,oox,\
-    oox/source/core/binarycodec \
-    oox/source/core/contexthandler2 \
-    oox/source/core/contexthandler \
-    oox/source/core/fastparser \
-    oox/source/core/fasttokenhandler \
-    oox/source/core/filterbase \
-    oox/source/core/filterdetect \
-    oox/source/core/fragmenthandler2 \
-    oox/source/core/fragmenthandler \
-    oox/source/core/recordparser \
-    oox/source/core/relations \
-    oox/source/core/relationshandler \
-    oox/source/core/xmlfilterbase \
-    oox/source/crypto/AgileEngine \
-    oox/source/crypto/CryptTools \
-    oox/source/crypto/DocumentEncryption \
-    oox/source/crypto/DocumentDecryption \
-    oox/source/crypto/Standard2007Engine \

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list