[Libreoffice-commits] core.git: Branch 'feature/wasm' - 543 commits - accessibility/inc accessibility/Library_acc.mk accessibility/source avmedia/Library_avmedia.mk avmedia/Module_avmedia.mk avmedia/source basctl/inc basctl/Library_basctl.mk basctl/source basegfx/source basic/inc basic/Library_sb.mk basic/qa basic/source bin/check-missing-export-asserts.py bin/check-missing-unittests.py bin/compare-crashreport-stats.py bin/oss-fuzz-build.sh bin/oss-fuzz-setup.sh bin/run bin/ui-rules-enforcer.py bridges/Library_cpp_uno.mk bridges/Module_bridges.mk bridges/source canvas/Module_canvas.mk canvas/source chart2/inc chart2/Library_chartcontroller.mk chart2/qa chart2/source comphelper/source compilerplugins/clang compilerplugins/README.md config_host/config_vclplug.h.in config_host/config_wasm_strip.h.in config_host.mk.in configure.ac connectivity/Library_dbase.mk connectivity/Library_dbtools.mk connectivity/Library_postgresql-sdbc-impl.mk connectivity/source cppcanvas/source cppuhelper/Library_cppuhelpe r.mk cppuhelper/source cppu/Library_cppu.mk cppu/Library_purpenvhelper.mk cppu/source cpputools/Module_cpputools.mk cpputools/source cui/inc cui/Library_cui.mk cui/source cui/uiconfig cui/UIConfig_cui.mk dbaccess/CppunitTest_dbaccess_dialog_save.mk dbaccess/CppunitTest_dbaccess_empty_stdlib_save.mk dbaccess/CppunitTest_dbaccess_hsqlbinary_import.mk dbaccess/CppunitTest_dbaccess_hsqlschema_import.mk dbaccess/CppunitTest_dbaccess_macros_test.mk dbaccess/CppunitTest_dbaccess_nolib_save.mk dbaccess/CppunitTest_dbaccess_RowSetClones.mk dbaccess/CppunitTest_dbaccess_tdf119625.mk dbaccess/CppunitTest_dbaccess_tdf126268.mk dbaccess/inc dbaccess/Module_dbaccess.mk dbaccess/source dbaccess/uiconfig desktop/CustomTarget_soffice.mk desktop/Executable_soffice_bin.mk desktop/inc desktop/Library_deployment.mk desktop/Module_desktop.mk desktop/Package_scripts.mk desktop/Pagein_common.mk desktop/qa desktop/scripts desktop/source dictionaries distro-configs/LibreOfficeOssFuzz.conf distro-configs/Libr eOfficeWASM32.conf download.lst drawinglayer/inc drawinglayer/Library_drawinglayer.mk drawinglayer/source editeng/inc editeng/Library_editeng.mk editeng/source embeddedobj/source embedserv/source emfio/inc emfio/qa emfio/source extensions/Module_extensions.mk extensions/source external/clew external/hunspell external/hyphen external/libnumbertext external/libxml2 external/Module_external.mk external/pdfium external/redland external/skia extras/Module_extras.mk extras/source filter/Library_icg.mk filter/source forms/source fpicker/source framework/inc framework/Library_fwk.mk framework/source framework/util .gitignore helpcompiler/Module_helpcompiler.mk helpcontent2 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 icon-themes/colibre icon-themes/colibre_svg idlc/inc idlc/source include/basegfx include/comphelper include/connectivity include/drawinglayer include/editeng include/filter include/linguistic include/o3tl include/oox include/package include/sal include/sfx2 include/svl include/svtools include/svx include/toolkit include/tools include/unotools include/vcl include/xmloff l10ntools/inc l10ntools/source librelogo/Package_librelogo_properties.mk lingucomponent/Library_guesslang.mk lingucomponent/Module_lingucomponent.mk linguistic/source logerrit lotuswordpro/inc lotuswordpro/source m4/libo_externals.m4 Makefile.gbuild Makefile.in o3tl/CppunitTest_o3tl_tests.mk o3tl/qa odk/docs odk/examples offapi/com officecfg/registry oox/CppunitTest_oox_tokenmap.mk oox/inc oox/Library_oox.mk oox/qa oox/source package/source postprocess/CustomTarget_components.mk postprocess/Module_postprocess.mk postprocess/Rdb_servic es.mk qadevOOo/tests README.wasm registry/Module_registry.mk reportdesign/inc reportdesign/source RepositoryExternal.mk RepositoryFixes.mk Repository.mk RepositoryModule_host.mk sal/cppunittester salhelper/Library_salhelper.mk sal/Library_cppunitmain.mk sal/Library_sal.mk sal/Library_sal_textenc.mk sal/Module_sal.mk sal/osl sal/qa sal/rtl scaddins/source sccomp/Module_sccomp.mk schema/libreoffice sc/inc sc/Library_sc.mk sc/Library_scui.mk sc/Module_sc.mk sc/qa scripting/Module_scripting.mk scripting/source sc/source sc/uiconfig sd/inc sd/Library_sd.mk sd/Library_sdui.mk sd/qa sd/source sd/uiconfig sfx2/Library_sfx.mk sfx2/source sfx2/util shell/Module_shell.mk shell/source slideshow/inc 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/vs starmath/inc starmath/source static/CustomTarget_components.mk static/Custom Target_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 svgio/inc svgio/source svl/qa svl/source svtools/source svtools/uiconfig svx/CppunitTest_svx_unit.mk svx/inc svx/Library_svxcore.mk svx/Library_svx.mk svx/Module_svx.mk svx/qa svx/source svx/util sw/CppunitTest_sw_uwriter.mk sw/inc sw/Library_sw.mk sw/Library_swui.mk sw/qa sw/source sw/uiconfig sw/util test/source toolkit/source tools/qa tools/source translations ucb/source unodevtools/inc unodevtools/source unoidl/source unotest/source unotools/Library_utl.mk unotools/source ure/Package_install.mk vbahelper/inc vbahelper/source vcl/backendtest vcl/commonfuzzer.mk vcl/CppunitTest_vcl_font.mk vcl/CustomTarget_qt5_moc.mk vcl/CustomTarget_qt6_moc.mk vcl/Executable_dbffuzzer.mk vcl/Executable_lo_kde5filepicker.mk vcl/headless vcl/inc vcl/ios vcl/Library_vcl.mk vcl/Library_vclplug_gen.mk vcl/Library_vclplug_gtk3_kde5.mk vcl/Libra ry_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_qt6.mk vcl/Library_vclplug_win.mk vcl/Module_vcl.mk vcl/osx vcl/qa vcl/qt5 vcl/qt6 vcl/quartz vcl/skia vcl/source vcl/unx vcl/win vcl/workben wasm-qt/Module_wasm-qt.mk winaccessibility/inc winaccessibility/source wizards/Package_wizards_properties.mk wizards/source writerfilter/Library_writerfilter.mk writerfilter/source writerperfect/Library_wpftwriter.mk writerperfect/Module_writerperfect.mk writerperfect/source xmloff/Library_xof.mk xmloff/Library_xo.mk xmloff/source xmloff/util xmlsecurity/Library_xsec_xmlsec.mk xmlsecurity/Module_xmlsecurity.mk xmlsecurity/source xmlsecurity/util

Sat, 02 Oct 2021 15:37:33 -0700

Rebased ref, commits from common ancestor:
commit fde51fd8ee3ef74a02c8718a2a8891a5ed88fe36
Author:     Jan-Marek Glogowski <glo...@fbihome.de>
AuthorDate: Sun Oct 3 00:07:07 2021 +0200
Commit:     Jan-Marek Glogowski <glo...@fbihome.de>
CommitDate: Sun Oct 3 00:09:33 2021 +0200

    catchall - ignore missing pipe
    
    Need to review HAVE_FEATURE_DESKTOP <> HAVE_FEATURE_MULTIUSER_ENVIRONMENT
    We use DESKTOP but won't need MULTIUSER_ENVIRONMENT
    
    Change-Id: I0f60b7fcc10a567c48cb9ba0ac113e212e4544be

diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 46b4db76dcb8..0f6c1c41afc8 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -506,7 +506,7 @@ void Desktop::Init()
     RequestHandler::Status aStatus = RequestHandler::Enable(true);
     if ( aStatus == RequestHandler::IPC_STATUS_PIPE_ERROR )
     {
-#if defined ANDROID
+#if defined(ANDROID) || defined(EMSCRIPTEN)
         // Ignore crack pipe errors on Android
 #else
         // Keep using this oddly named BE_PATHINFO_MISSING value
@@ -1313,7 +1313,7 @@ int Desktop::Main()
 
     SetSplashScreenProgress(25);
 
-#if HAVE_FEATURE_DESKTOP
+#if HAVE_FEATURE_DESKTOP && !defined(EMSCRIPTEN)
     // check user installation directory for lockfile so we can be sure
     // there is no other instance using our data files from a remote host
 
commit 1b5733ffc5cc6acd06fad48c71c57608d39bf1fe
Author:     Jan-Marek Glogowski <glo...@fbihome.de>
AuthorDate: Sat Oct 2 23:57:44 2021 +0200
Commit:     Jan-Marek Glogowski <glo...@fbihome.de>
CommitDate: Sun Oct 3 00:09:33 2021 +0200

    WASM add --pre-js dependencies
    
    Change-Id: I1166c5a9ae53c56a69b9223c865b4df525d07450

diff --git a/solenv/gbuild/Executable.mk b/solenv/gbuild/Executable.mk
index d9be2f5c3b5c..ef393cb33949 100644
--- a/solenv/gbuild/Executable.mk
+++ b/solenv/gbuild/Executable.mk
@@ -75,9 +75,6 @@ $(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 ac6fed5175c3..1ad437ef2f55 100644
--- a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
+++ b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
@@ -11,13 +11,19 @@ gb_UnoApiHeadersTarget_select_variant = $(if $(filter 
udkapi,$(1)),comprehensive
 
 include $(GBUILDDIR)/platform/unxgcc.mk
 
+# don't sort; later can override previous settings!
+gb_EMSCRIPTEN_PRE_JS_FILES = \
+    $(call 
gb_CustomTarget_get_workdir,static/wasm_fs_image)/soffice.data.js.link \
+    $(SRCDIR)/static/environment.js
+
 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 USE_PTHREADS=1
+
 # 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 TOTAL_MEMORY=1GB 
-s PTHREAD_POOL_SIZE=4 -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 
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_LDFLAGS := $(gb_EMSCRIPTEN_CPPFLAGS) --bind -s TOTAL_MEMORY=1GB 
-s PTHREAD_POOL_SIZE=4 -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 
EXPORTED_RUNTIME_METHODS=["UTF16ToString","stringToUTF16"] $(foreach 
pre_js,$(gb_EMSCRIPTEN_PRE_JS_FILES), --pre-js $(pre_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
@@ -57,6 +63,8 @@ $(call gb_LinkTarget_add_auxtargets,$(2),\
         $(patsubst %.lib,%.worker.js,$(3)) \
 )
 
+$(call gb_Executable_get_linktarget,$(2)) : $(gb_EMSCRIPTEN_PRE_JS)
+
 endef
 
 define gb_CppunitTest_CppunitTest_platform
@@ -66,6 +74,8 @@ $(call gb_LinkTarget_add_auxtargets,$(2),\
         $(patsubst %.lib,%.worker.js,$(3)) \
 )
 
+$(call gb_CppunitTest_get_linktarget,$(2)) : $(gb_EMSCRIPTEN_PRE_JS)
+
 endef
 
 gb_SUPPRESS_TESTS := $(true)
commit 3ee90cba7976d6e740065c438c0617d081e15f2c
Author:     Jan-Marek Glogowski <glo...@fbihome.de>
AuthorDate: Sat Oct 2 23:16:16 2021 +0200
Commit:     Jan-Marek Glogowski <glo...@fbihome.de>
CommitDate: Sun Oct 3 00:09:33 2021 +0200

    catchall
    
    Change-Id: I204c893fe7499f88fb5d5aac88cea629d1716565

diff --git a/configure.ac b/configure.ac
index afb398881c23..57d79486fc83 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1354,7 +1354,7 @@ if test "$_os" = "Emscripten"; then
     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
+        EMSCRIPTEN_ERROR=1
     fi
     if test $EMSCRIPTEN_ERROR -ne 0; then
         AC_MSG_ERROR(["Please fix your EMSDK setup to build with Emscripten!"])
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 0c21702a7125..46b4db76dcb8 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -102,7 +102,9 @@
 #include <osl/process.h>
 #include <rtl/byteseq.hxx>
 #include <unotools/pathoptions.hxx>
+#ifndef ENABLE_WASM_STRIP_PINGUSER
 #include <unotools/VersionConfig.hxx>
+#endif
 #include <rtl/bootstrap.hxx>
 #include <vcl/test/GraphicsRenderTests.hxx>
 #include <vcl/glxtestprocess.hxx>
@@ -342,10 +344,12 @@ namespace {
 
 void runGraphicsRenderTests()
 {
+#ifndef ENABLE_WASM_STRIP_PINGUSER
     if (!utl::isProductVersionUpgraded(false))
     {
         return;
     }
+#endif
     GraphicsRenderTests TestObject;
     TestObject.run();
 }
diff --git a/desktop/source/app/cmdlineargs.cxx 
b/desktop/source/app/cmdlineargs.cxx
index c9f878feee6f..e5f354ac7935 100644
--- a/desktop/source/app/cmdlineargs.cxx
+++ b/desktop/source/app/cmdlineargs.cxx
@@ -112,6 +112,7 @@ enum class CommandLineEvent {
 // If no event argument is explicitly set in command line,
 // then it returns updated command line event,
 // according to Office URI command.
+#ifndef ENABLE_WASM_STRIP
 CommandLineEvent CheckOfficeURI(/* in,out */ OUString& arg, CommandLineEvent 
curEvt)
 {
     // 1. Strip the scheme name
@@ -245,6 +246,7 @@ CommandLineEvent CheckWebQuery(/* in,out */ OUString& arg, 
CommandLineEvent curE
 
     return curEvt;
 }
+#endif
 
 } // namespace
 
@@ -277,6 +279,8 @@ CommandLineArgs::CommandLineArgs( Supplier& supplier )
 void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
 {
 #ifdef ENABLE_WASM_STRIP
+    (void) supplier;
+
     // use hard-coded init-params for wasm '-nolockcheck -norestore -nologo 
-writer'
     // no restore tries
     m_norestore = true;
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index 370fecc9b182..3770c6e8dd69 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -351,7 +351,6 @@ 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);
@@ -365,7 +364,6 @@ short ImpPDFTabDialog::Ok( )
             }
         }
     }
-#endif
 
     return RET_OK;
 }
diff --git a/sal/cppunittester/cppunittester.cxx 
b/sal/cppunittester/cppunittester.cxx
index 5b886ea2189d..e1fcf84c255f 100644
--- a/sal/cppunittester/cppunittester.cxx
+++ b/sal/cppunittester/cppunittester.cxx
@@ -230,13 +230,17 @@ class CPPUNIT_API ProtectedFixtureFunctor
 {
 private:
     const std::string &testlib;
+#ifndef DISABLE_DYNLOADING
     const std::string &args;
+#endif
     std::vector<CppUnit::Protector *> &protectors;
     CppUnit::TestResult &result;
 public:
     ProtectedFixtureFunctor(const std::string& testlib_, const std::string 
&args_, std::vector<CppUnit::Protector*> &protectors_, CppUnit::TestResult 
&result_)
         : testlib(testlib_)
+#ifndef DISABLE_DYNLOADING
         , args(args_)
+#endif
         , protectors(protectors_)
         , result(result_)
     {
diff --git a/sal/osl/unx/security.cxx b/sal/osl/unx/security.cxx
index f6fc52ce5398..6000c020dbef 100644
--- a/sal/osl/unx/security.cxx
+++ b/sal/osl/unx/security.cxx
@@ -127,7 +127,7 @@ oslSecurity SAL_CALL osl_getCurrentSecurity()
         if (p == nullptr) {
             return nullptr;
         }
-#if defined(IOS) && defined(X86_64)
+#if (defined(IOS) && defined(X86_64)) || defined(EMSCRIPTEN)
         // getpwuid_r() does not work in the iOS simulator
         (void) found;
         char * buffer = p->m_buffer;
@@ -140,10 +140,6 @@ oslSecurity SAL_CALL osl_getCurrentSecurity()
         buffer += strlen(buffer) + 1;
         p->m_pPasswd.pw_uid = geteuid();
         p->m_pPasswd.pw_gid = getegid();
-        p->m_pPasswd.pw_change = 0;
-        strcpy(buffer, "");
-        p->m_pPasswd.pw_class = buffer;
-        buffer += strlen(buffer) + 1;
         strcpy(buffer, "Mobile User");
         p->m_pPasswd.pw_gecos = buffer;
         buffer += strlen(buffer) + 1;
@@ -153,7 +149,13 @@ oslSecurity SAL_CALL osl_getCurrentSecurity()
         strcpy(buffer, "");
         p->m_pPasswd.pw_shell = buffer;
         buffer += strlen(buffer) + 1;
+#ifndef EMSCRIPTEN
+        p->m_pPasswd.pw_change = 0;
+        strcpy(buffer, "");
+        p->m_pPasswd.pw_class = buffer;
+        buffer += strlen(buffer) + 1;
         p->m_pPasswd.pw_expire = 0;
+#endif
         return p;
 #else
         switch (getpwuid_r(getuid(), &p->m_pPasswd, p->m_buffer, n, &found)) {
diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk
index ffa0755ae0f9..25d9b29b4961 100644
--- a/sfx2/Library_sfx.mk
+++ b/sfx2/Library_sfx.mk
@@ -93,12 +93,10 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\
 ))
 endif
 
-ifneq ($(ENABLE_WASM_STRIP_ACCESSIBILITY),TRUE)
 $(eval $(call gb_Library_add_exception_objects,sfx,\
     sfx2/source/accessibility/AccessibilityCheck \
     sfx2/source/accessibility/AccessibilityIssue \
 ))
-endif
 
 $(eval $(call gb_Library_add_exception_objects,sfx,\
     sfx2/source/appl/app \
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index e7c9001e5b49..18c4da9febd7 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -2718,9 +2718,11 @@ bool SfxObjectShell::CommonSaveAs_Impl(const 
INetURLObject& aURL, const OUString
     if (SfxItemState::SET != rItemSet.GetItemState(SID_UNPACK) && 
officecfg::Office::Common::Save::Document::Unpacked::get())
         rItemSet.Put(SfxBoolItem(SID_UNPACK, false));
 
+#if HAVE_FEATURE_MULTIUSER_ENVIRONMENT
     OUString aTempFileURL;
     if ( IsDocShared() )
         aTempFileURL = pMedium->GetURLObject().GetMainURL( 
INetURLObject::DecodeMechanism::NONE );
+#endif
 
     if 
(PreDoSaveAs_Impl(aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE), 
aFilterName,
                          rItemSet, rArgs))
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index d80c97c614fa..b9affb1c59e8 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -49,7 +49,9 @@
 #include <vcl/stdtext.hxx>
 #include <vcl/weld.hxx>
 #include <vcl/weldutils.hxx>
+#ifndef ENABLE_WASM_STRIP_PINGUSER
 #include <unotools/VersionConfig.hxx>
+#endif
 #include <svtools/miscopt.hxx>
 #include <tools/diagnose_ex.h>
 #include <com/sun/star/container/XIndexAccess.hpp>
diff --git a/static/CustomTarget_wasm_fs_image.mk 
b/static/CustomTarget_wasm_fs_image.mk
index a10c244ae4e0..cf8a6d94c8d6 100644
--- a/static/CustomTarget_wasm_fs_image.mk
+++ b/static/CustomTarget_wasm_fs_image.mk
@@ -26,6 +26,17 @@ gb_wasm_image_filelist := \
     $(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 \
+    $(INSTROOT)/share/registry/cjk.xcd \
+    $(INSTROOT)/share/registry/ctlseqcheck.xcd \
+    $(INSTROOT)/share/registry/ctl.xcd \
+    $(INSTROOT)/share/registry/graphicfilter.xcd \
+    $(INSTROOT)/share/registry/Langpack-en-US.xcd \
+    $(INSTROOT)/share/registry/lingucomponent.xcd \
+    $(INSTROOT)/share/registry/main.xcd \
+    $(INSTROOT)/share/registry/writer.xcd \
+    $(INSTROOT)/share/registry/xsltfilter.xcd \
+    $(INSTROOT)/program/intro-highres.png \
+    $(INSTROOT)/program/intro.png \
 
 wasm_fs_image_WORKDIR := $(call 
gb_CustomTarget_get_workdir,static/wasm_fs_image)
 
diff --git a/svx/Library_svx.mk b/svx/Library_svx.mk
index d94fb30774f0..7e55a7aacbe6 100644
--- a/svx/Library_svx.mk
+++ b/svx/Library_svx.mk
@@ -111,7 +111,6 @@ $(eval $(call gb_Library_add_exception_objects,svx,\
     svx/source/accessibility/ShapeTypeHandler \
     svx/source/accessibility/SvxShapeTypes \
     svx/source/accessibility/lookupcolorname \
-    svx/source/dialog/AccessibilityCheckDialog \
 ))
 endif
 
@@ -124,6 +123,7 @@ $(eval $(call gb_Library_add_exception_objects,svx,\
     svx/source/customshapes/EnhancedCustomShapeEngine \
     svx/source/customshapes/EnhancedCustomShapeFontWork \
     svx/source/customshapes/EnhancedCustomShapeHandle \
+    svx/source/dialog/AccessibilityCheckDialog \
     svx/source/dialog/_bmpmask \
     svx/source/dialog/charmap \
     svx/source/dialog/searchcharmap \
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 034409f60c39..de0ed73651cf 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -4586,7 +4586,9 @@ void SwRowFrame::AdjustCells( const SwTwips nHeight, 
const bool bHeight )
     if ( bHeight )
     {
         SwRectFnSet aRectFnSet(this);
+#ifndef ENABLE_WASM_STRIP_ACCESSIBILITY
         SwRect aOldFrame;
+#endif
 
         while ( pFrame )
         {
@@ -4653,7 +4655,9 @@ void SwRowFrame::AdjustCells( const SwTwips nHeight, 
const bool bHeight )
             const tools::Long nDiff = nSumRowHeight - 
aRectFnSet.GetHeight(pToAdjust->getFrameArea());
             if ( nDiff )
             {
+#ifndef ENABLE_WASM_STRIP_ACCESSIBILITY
                 aOldFrame = pToAdjust->getFrameArea();
+#endif
                 SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*pToAdjust);
                 aRectFnSet.AddBottom( aFrm, nDiff );
                 pNotify = pToAdjust;
diff --git a/sw/source/filter/html/htmlform.cxx 
b/sw/source/filter/html/htmlform.cxx
index 94af6b26f7a1..9910146be47a 100644
--- a/sw/source/filter/html/htmlform.cxx
+++ b/sw/source/filter/html/htmlform.cxx
@@ -1224,8 +1224,10 @@ void SwHTMLParser::NewForm( bool bAppend )
     if( !m_pFormImpl )
         m_pFormImpl = new SwHTMLForm_Impl( m_xDoc->GetDocShell() );
 
+#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS
     OUString aAction( m_sBaseURL );
     OUString sName, sTarget;
+#endif
     FormSubmitEncoding nEncType = FormSubmitEncoding_URL;
     FormSubmitMethod nMethod = FormSubmitMethod_GET;
     SvxMacroTableDtor aMacroTable;
@@ -1245,21 +1247,23 @@ void SwHTMLParser::NewForm( bool bAppend )
 
         switch( rOption.GetToken() )
         {
+#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS
         case HtmlOptionId::ACTION:
             aAction = rOption.GetString();
             break;
-        case HtmlOptionId::METHOD:
-            nMethod = rOption.GetEnum( aHTMLFormMethodTable, nMethod );
-            break;
-        case HtmlOptionId::ENCTYPE:
-            nEncType = rOption.GetEnum( aHTMLFormEncTypeTable, nEncType );
-            break;
         case HtmlOptionId::TARGET:
             sTarget = rOption.GetString();
             break;
         case HtmlOptionId::NAME:
             sName = rOption.GetString();
             break;
+#endif
+        case HtmlOptionId::METHOD:
+            nMethod = rOption.GetEnum( aHTMLFormMethodTable, nMethod );
+            break;
+        case HtmlOptionId::ENCTYPE:
+            nEncType = rOption.GetEnum( aHTMLFormEncTypeTable, nEncType );
+            break;
 
         case HtmlOptionId::SDONSUBMIT:
             eScriptType2 = STARBASIC;
commit 7108bacb2349feb366125a72516910412a27b913
Author:     Jan-Marek Glogowski <glo...@fbihome.de>
AuthorDate: Sat Oct 2 12:50:05 2021 +0200
Commit:     Jan-Marek Glogowski <glo...@fbihome.de>
CommitDate: Sun Oct 3 00:09:33 2021 +0200

    WASM run vcldemo via system main loop
    
    Hack to run LO via system event loop instead of calling
    out to it. Needed, so the browser won't block. Alternative to
    running LO in a WebWorker.
    
    Change-Id: I24955638827f3b8c04240845ffc781cd28f2aa29

diff --git a/vcl/inc/qt5/QtInstance.hxx b/vcl/inc/qt5/QtInstance.hxx
index 6891b32f2f3c..b217fac8bb7b 100644
--- a/vcl/inc/qt5/QtInstance.hxx
+++ b/vcl/inc/qt5/QtInstance.hxx
@@ -164,6 +164,8 @@ public:
     void UpdateStyle(bool bFontsChanged);
 
     void* CreateGStreamerSink(const SystemChildWindow*) override;
+
+    bool DoExecute(int& nExitCode) override;
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/salinst.hxx b/vcl/inc/salinst.hxx
index 9694d30f4939..342fa86877c6 100644
--- a/vcl/inc/salinst.hxx
+++ b/vcl/inc/salinst.hxx
@@ -208,6 +208,7 @@ public:
     virtual void* CreateGStreamerSink(const SystemChildWindow*) { return 
nullptr; }
 
     virtual void BeforeAbort(const OUString& /* rErrorText */, bool /* 
bDumpCore */) {}
+    virtual bool DoExecute(int &nExitCode) { (void)nExitCode; return false; }
 };
 
 // called from SVMain
diff --git a/vcl/qt5/QtInstance.cxx b/vcl/qt5/QtInstance.cxx
index 42b7a8ed8a48..7b9716870d1b 100644
--- a/vcl/qt5/QtInstance.cxx
+++ b/vcl/qt5/QtInstance.cxx
@@ -685,6 +685,12 @@ std::unique_ptr<QApplication> 
QtInstance::CreateQApplication(int& nArgc, char**
     return pQApp;
 }
 
+bool QtInstance::DoExecute(int& nExitCode)
+{
+    nExitCode = m_pQApplication->exec();
+    return true;
+}
+
 extern "C" {
 VCLPLUG_QT_PUBLIC SalInstance* create_SalInstance()
 {
diff --git a/vcl/qt5/QtTimer.cxx b/vcl/qt5/QtTimer.cxx
index 751937b44931..b23e5b429f73 100644
--- a/vcl/qt5/QtTimer.cxx
+++ b/vcl/qt5/QtTimer.cxx
@@ -20,12 +20,16 @@
 #include <QtTimer.hxx>
 #include <QtTimer.moc>
 
+#include <QtInstance.hxx>
+
 #include <QtWidgets/QApplication>
 #include <QtCore/QThread>
 
 #include <vcl/svapp.hxx>
 #include <sal/log.hxx>
 
+#include <svdata.hxx>
+
 QtTimer::QtTimer()
 {
     m_aTimer.setSingleShot(true);
@@ -38,6 +42,11 @@ QtTimer::QtTimer()
 void QtTimer::timeoutActivated()
 {
     SolarMutexGuard aGuard;
+#ifdef EMSCRIPTEN
+    const ImplSVData* pSVData = ImplGetSVData();
+    assert(pSVData->mpDefInst);
+    bool ts = 
static_cast<QtInstance*>(pSVData->mpDefInst)->DispatchUserEvents(true);
+#endif
     CallCallback();
 }
 
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 66c030dd5501..51ad29a4c9c0 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -440,8 +440,12 @@ void Application::Execute()
         pSVData->maAppData.mpEventTestingIdle->Start();
     }
 
-    while ( !pSVData->maAppData.mbAppQuit )
-        Application::Yield();
+    int nExitCode = 0;
+    if (!pSVData->mpDefInst->DoExecute(nExitCode))
+    {
+        while ( !pSVData->maAppData.mbAppQuit )
+            Application::Yield();
+    }
 
     pSVData->maAppData.mbInAppExecute = false;
 
commit 9d36510f3b378d2bc00baa0a56166d0eaa7af47b
Author:     Jan-Marek Glogowski <glo...@fbihome.de>
AuthorDate: Sat Oct 2 12:43:07 2021 +0200
Commit:     Jan-Marek Glogowski <glo...@fbihome.de>
CommitDate: Sun Oct 3 00:09:32 2021 +0200

    WASM add option to build with native exceptions
    
    Currently disabled, as literally no runtime has a working
    implementation and it also current conflicts with setjmp /
    longjump (often referenced as SjLj) with LLVM WASM.
    
    Change-Id: I2b338f3529e7350d54a7950772c6e7aae2282fe7

diff --git a/bridges/Library_cpp_uno.mk b/bridges/Library_cpp_uno.mk
index 58a8bef7c3c9..fe1d1a2e45c3 100644
--- a/bridges/Library_cpp_uno.mk
+++ b/bridges/Library_cpp_uno.mk
@@ -88,7 +88,6 @@ bridge_noopt_objects := except
 else ifeq ($(OS),EMSCRIPTEN)
 bridges_SELECTED_BRIDGE := gcc3_wasm
 bridge_noopt_objects := cpp2uno except uno2cpp
-#bridge_asm_objects := wasm_helper
 endif
 
 else ifeq ($(CPUNAME),M68K)
diff --git a/bridges/source/cpp_uno/gcc3_wasm/except.cxx 
b/bridges/source/cpp_uno/gcc3_wasm/except.cxx
index aebe016052ab..fd5637617d56 100644
--- a/bridges/source/cpp_uno/gcc3_wasm/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_wasm/except.cxx
@@ -39,6 +39,8 @@
 #include <unordered_map>
 #include "share.hxx"
 
+#include <config_wasm_strip.h>
+
 using namespace ::osl;
 using namespace ::com::sun::star::uno;
 
@@ -293,6 +295,7 @@ static void deleteException( void * pExc )
 
 void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp )
 {
+#if ENABLE_WASM_EXCEPTIONS
 #if OSL_DEBUG_LEVEL > 1
     OString cstr(
         OUStringToOString(
@@ -337,10 +340,14 @@ void raiseException( uno_Any * pUnoExc, uno_Mapping * 
pUno2Cpp )
     //                  struct std::type_info * tinfo,
     //                  void (*dest)(void*));
     __cxxabiv1::__cxa_throw( pCppExc, rtti, deleteException );
+#else
+    std::abort();
+#endif
 }
 
 void fillUnoException(uno_Any * pUnoExc, uno_Mapping * pCpp2Uno)
 {
+#if ENABLE_WASM_EXCEPTIONS
     __cxa_exception * header = 
__cxxabiv1::__cxa_get_globals()->caughtExceptions;
     if (! header)
     {
@@ -399,6 +406,9 @@ void fillUnoException(uno_Any * pUnoExc, uno_Mapping * 
pCpp2Uno)
         uno_any_constructAndConvert( pUnoExc, header->adjustedPtr, 
pExcTypeDescr, pCpp2Uno );
         typelib_typedescription_release( pExcTypeDescr );
     }
+#else
+    std::abort();
+#endif
 }
 
 }
diff --git a/bridges/source/cpp_uno/gcc3_wasm/wasm_helper.s 
b/bridges/source/cpp_uno/gcc3_wasm/wasm_helper.s
deleted file mode 100644
index 12308f1a9855..000000000000
--- a/bridges/source/cpp_uno/gcc3_wasm/wasm_helper.s
+++ /dev/null
@@ -1,233 +0,0 @@
-// -*- Mode: Asm; tab-width: 4; tab-stop-list: (4 12 32); comment-column: 30; 
comment-start: "// "; indent-tabs-mode: nil -*-
-//
-// 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 .
-//
-    .section        __TEXT,__text,regular,pure_instructions
-
-    .p2align        2
-codeSnippet_0_0:
-    mov x14, 0
-    mov x15, 0
-    b _privateSnippetExecutor
-codeSnippet_0_1:
-    mov x14, 0
-    mov x15, 1
-    b _privateSnippetExecutor
-codeSnippet_0_2:
-    mov x14, 0
-    mov x15, 2
-    b _privateSnippetExecutor
-codeSnippet_0_3:
-    mov x14, 0
-    mov x15, 3
-    b _privateSnippetExecutor
-codeSnippet_1_0:
-    mov x14, 1
-    mov x15, 0
-    b _privateSnippetExecutor
-    .long 0x000001
-    .long 0
-codeSnippet_1_1:
-    mov x14, 1
-    mov x15, 1
-    b _privateSnippetExecutor
-codeSnippet_1_2:
-    mov x14, 1
-    mov x15, 2
-    b _privateSnippetExecutor
-codeSnippet_1_3:
-    mov x14, 1
-    mov x15, 3
-    b _privateSnippetExecutor
-codeSnippet_2_0:
-    mov x14, 2
-    mov x15, 0
-    b _privateSnippetExecutor
-codeSnippet_2_1:
-    mov x14, 2
-    mov x15, 1
-    b _privateSnippetExecutor
-codeSnippet_2_2:
-    mov x14, 2
-    mov x15, 2
-    b _privateSnippetExecutor
-codeSnippet_2_3:
-    mov x14, 2
-    mov x15, 3
-    b _privateSnippetExecutor
-    .long 0x000002
-    .long 3
-codeSnippet_3_0:
-    mov x14, 3
-    mov x15, 0
-    b _privateSnippetExecutor
-codeSnippet_3_1:
-    mov x14, 3
-    mov x15, 1
-    b _privateSnippetExecutor
-codeSnippet_3_2:
-    mov x14, 3
-    mov x15, 2
-    b _privateSnippetExecutor
-codeSnippet_3_3:
-    mov x14, 3
-    mov x15, 3
-    b _privateSnippetExecutor
-codeSnippet_4_0:
-    mov x14, 4
-    mov x15, 0
-    b _privateSnippetExecutor
-codeSnippet_4_1:
-    mov x14, 4
-    mov x15, 1
-    b _privateSnippetExecutor
-codeSnippet_4_2:
-    mov x14, 4
-    mov x15, 2
-    b _privateSnippetExecutor
-codeSnippet_4_3:
-    mov x14, 4
-    mov x15, 3
-    b _privateSnippetExecutor
-codeSnippet_5_0:
-    mov x14, 5
-    mov x15, 0
-    b _privateSnippetExecutor
-codeSnippet_5_1:
-    mov x14, 5
-    mov x15, 1
-    b _privateSnippetExecutor
-codeSnippet_5_2:
-    mov x14, 5
-    mov x15, 2
-    b _privateSnippetExecutor
-codeSnippet_5_3:
-    mov x14, 5
-    mov x15, 3
-    b _privateSnippetExecutor
-codeSnippet_6_0:
-    mov x14, 6
-    mov x15, 0
-    b _privateSnippetExecutor
-codeSnippet_6_1:
-    mov x14, 6
-    mov x15, 1
-    b _privateSnippetExecutor
-codeSnippet_6_2:
-    mov x14, 6
-    mov x15, 2
-    b _privateSnippetExecutor
-codeSnippet_6_3:
-    mov x14, 6
-    mov x15, 3
-    b _privateSnippetExecutor
-codeSnippet_7_0:
-    mov x14, 7
-    mov x15, 0
-    b _privateSnippetExecutor
-codeSnippet_7_1:
-    mov x14, 7
-    mov x15, 1
-    b _privateSnippetExecutor
-codeSnippet_7_2:
-    mov x14, 7
-    mov x15, 2
-    b _privateSnippetExecutor
-codeSnippet_7_3:
-    mov x14, 7
-    mov x15, 3
-    b _privateSnippetExecutor
-
-    .globl _codeSnippets
-_codeSnippets:
-    .long codeSnippet_0_0 - _codeSnippets
-    .long codeSnippet_0_1 - _codeSnippets
-    .long codeSnippet_0_2 - _codeSnippets
-    .long codeSnippet_0_3 - _codeSnippets
-    .long codeSnippet_1_0 - _codeSnippets
-    .long codeSnippet_1_1 - _codeSnippets
-    .long codeSnippet_1_2 - _codeSnippets
-    .long codeSnippet_1_3 - _codeSnippets
-    .long codeSnippet_2_0 - _codeSnippets
-    .long codeSnippet_2_1 - _codeSnippets
-    .long codeSnippet_2_2 - _codeSnippets
-    .long codeSnippet_2_3 - _codeSnippets
-    .long codeSnippet_3_0 - _codeSnippets
-    .long codeSnippet_3_1 - _codeSnippets
-    .long codeSnippet_3_2 - _codeSnippets
-    .long codeSnippet_3_3 - _codeSnippets
-    .long codeSnippet_4_0 - _codeSnippets
-    .long codeSnippet_4_1 - _codeSnippets
-    .long codeSnippet_4_2 - _codeSnippets
-    .long codeSnippet_4_3 - _codeSnippets
-    .long codeSnippet_5_0 - _codeSnippets
-    .long codeSnippet_5_1 - _codeSnippets
-    .long codeSnippet_5_2 - _codeSnippets
-    .long codeSnippet_5_3 - _codeSnippets
-    .long codeSnippet_6_0 - _codeSnippets
-    .long codeSnippet_6_1 - _codeSnippets
-    .long codeSnippet_6_2 - _codeSnippets
-    .long codeSnippet_6_3 - _codeSnippets
-    .long codeSnippet_7_0 - _codeSnippets
-    .long codeSnippet_7_1 - _codeSnippets
-    .long codeSnippet_7_2 - _codeSnippets
-    .long codeSnippet_7_3 - _codeSnippets
-
-
-
-    .private_extern _privateSnippetExecutor
-    .globl  _privateSnippetExecutor
-    .p2align        2
-_privateSnippetExecutor:
-    .cfi_startproc
-    .cfi_def_cfa w29, 16
-    .cfi_offset w30, -8
-    .cfi_offset w29, -16
-
-    // _privateSnippetExecutor is jumped to from codeSnippet_*
-
-    // push all GP, FP/SIMD registers to the stack
-    stp x6, x7, [sp, #-16]!
-    stp x4, x5, [sp, #-16]!
-    stp x2, x3, [sp, #-16]!
-    stp x0, x1, [sp, #-16]!
-    stp d6, d7, [sp, #-16]!
-    stp d4, d5, [sp, #-16]!
-    stp d2, d3, [sp, #-16]!
-    stp d0, d1, [sp, #-16]!
-
-    // push x8 (RC pointer) and lr to stack
-    stp     x8, lr, [sp, #-16]!
-
-    // First argument (x15 set up in the codeSnippet instance)
-    // Second argument: The pointer to all the above
-    mov x0, x14
-    mov x1, x15
-    mov x2, sp
-    bl  _cpp_vtable_call
-
-    // restore x8 (RC pointer) and lr (skip RC from cpp_vtable_call)
-    ldp x8, lr, [sp, #0]
-
-    // restore stack
-    add sp, sp, #144
-
-    // continue with throw/catch
-    ret lr
-    .cfi_endproc
-
-// vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/config_host.mk.in b/config_host.mk.in
index 683db3206935..5c5e8f8d5b52 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -208,6 +208,7 @@ export ENABLE_SKIA=@ENABLE_SKIA@
 export ENABLE_SKIA_DEBUG=@ENABLE_SKIA_DEBUG@
 export ENABLE_SYMBOLS_FOR=@ENABLE_SYMBOLS_FOR@
 export ENABLE_VALGRIND=@ENABLE_VALGRIND@
+export ENABLE_WASM_EXCEPTIONS=@ENABLE_WASM_EXCEPTIONS@
 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@
diff --git a/config_host/config_wasm_strip.h.in 
b/config_host/config_wasm_strip.h.in
index c64afad98033..3f09f6652e15 100644
--- a/config_host/config_wasm_strip.h.in
+++ b/config_host/config_wasm_strip.h.in
@@ -22,4 +22,6 @@
 #define ENABLE_WASM_STRIP_SWEXPORTS
 #endif
 
+#define ENABLE_WASM_EXCEPTIONS 0
+
 #endif
diff --git a/configure.ac b/configure.ac
index 183a268d0579..afb398881c23 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1967,6 +1967,13 @@ AC_ARG_ENABLE(wasm-strip,
         [Strip the static build like for WASM/emscripten platform.]),
 ,)
 
+AC_ARG_ENABLE(wasm-exceptions,
+    AS_HELP_STRING([--enable-wasm-exceptions],
+        [Build with native WASM exceptions (AKA -fwasm-exceptions),
+        matter of fact, this is currently not finished by any implementation)
+        (see https://webassembly.org/roadmap/ for the current state]),
+,)
+
 AC_ARG_ENABLE(xmlhelp,
     AS_HELP_STRING([--disable-xmlhelp],
         [Disable XML help support]),
@@ -3039,6 +3046,13 @@ if test "$enable_wasm_strip" = "yes"; then
     AC_DEFINE(HAVE_FEATURE_WASM_STRIP)
 fi
 
+ENABLE_WASM_EXCEPTIONS=
+if test "$enable_wasm_exceptions" = "yes"; then
+    ENABLE_WASM_EXCEPTIONS=TRUE
+    AC_DEFINE(ENABLE_WASM_EXCEPTIONS)
+fi
+AC_SUBST(ENABLE_WASM_EXCEPTIONS)
+
 ENABLE_SERVICES_RDB_FROM_BUILD=
 if test "$enable_services_rdb_from_build" = yes; then
     ENABLE_SERVICES_RDB_FROM_BUILD=TRUE
diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist
index a1ecad267e2d..31ed6c964e46 100644
--- a/solenv/clang-format/excludelist
+++ b/solenv/clang-format/excludelist
@@ -539,6 +539,12 @@ bridges/source/cpp_uno/gcc3_solaris_sparc/cpp2uno.cxx
 bridges/source/cpp_uno/gcc3_solaris_sparc/except.cxx
 bridges/source/cpp_uno/gcc3_solaris_sparc/share.hxx
 bridges/source/cpp_uno/gcc3_solaris_sparc/uno2cpp.cxx
+bridges/source/cpp_uno/gcc3_wasm/cpp2uno.cxx
+bridges/source/cpp_uno/gcc3_wasm/except.cxx
+bridges/source/cpp_uno/gcc3_wasm/rtti.h
+bridges/source/cpp_uno/gcc3_wasm/share.hxx
+bridges/source/cpp_uno/gcc3_wasm/uno2cpp.cxx
+bridges/source/cpp_uno/gcc3_wasm/unwind-cxx.h
 bridges/source/cpp_uno/msvc_win32_intel/cpp2uno.cxx
 bridges/source/cpp_uno/msvc_win32_intel/except.cxx
 bridges/source/cpp_uno/msvc_win32_intel/uno2cpp.cxx
diff --git a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk 
b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
index 38bb16f39080..ac6fed5175c3 100644
--- a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
+++ b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
@@ -21,10 +21,15 @@ gb_EMSCRIPTEN_LDFLAGS := $(gb_EMSCRIPTEN_CPPFLAGS) --bind 
-s TOTAL_MEMORY=1GB -s
 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
-gb_EMSCRIPTEN_EXCEPT := -s DISABLE_EXCEPTION_CATCHING=0
+ifeq ($(ENABLE_WASM_EXCEPTIONS),TRUE)
+gb_EMSCRIPTEN_EXCEPT = -fwasm-exceptions
+else
+gb_EMSCRIPTEN_EXCEPT = -s DISABLE_EXCEPTION_CATCHING=0
+endif
 
+gb_LinkTarget_EXCEPTIONFLAGS += $(gb_EMSCRIPTEN_EXCEPT)
 gb_LinkTarget_CFLAGS += $(gb_EMSCRIPTEN_CPPFLAGS) $(gb_EMSCRIPTEN_QTDEFS)
-gb_LinkTarget_CXXFLAGS += $(gb_EMSCRIPTEN_CPPFLAGS) $(gb_EMSCRIPTEN_QTDEFS) 
$(gb_EMSCRIPTEN_EXCEPT)
+gb_LinkTarget_CXXFLAGS += $(gb_EMSCRIPTEN_CPPFLAGS) $(gb_EMSCRIPTEN_QTDEFS)
 gb_LinkTarget_LDFLAGS += $(gb_EMSCRIPTEN_LDFLAGS) $(gb_EMSCRIPTEN_CPPFLAGS) 
$(gb_EMSCRIPTEN_EXCEPT)
 
 # Linker and compiler optimize + debug flags are handled in LinkTarget.mk
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 70eaa5858ec0..2f248ae9491b 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -92,6 +92,12 @@ $(eval $(call gb_Library_use_externals,vcl,\
     mdds_headers \
 ))
 
+# WASM LLVM doesn't support EH + SjLj (setjump / longjump) used by libjpeg / 
libpng
+$(eval $(call gb_Library_add_cxxobjects,vcl,\
+    vcl/source/filter/jpeg/jpegc \
+    vcl/source/filter/png/PngImageReader \
+))
+
 $(eval $(call gb_Library_add_exception_objects,vcl,\
     vcl/source/rendercontext/drawmode \
     vcl/skia/SkiaHelper \
@@ -456,7 +462,6 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
     vcl/source/filter/ixpm/xpmread \
     vcl/source/filter/jpeg/Exif \
     vcl/source/filter/jpeg/jpeg \
-    vcl/source/filter/jpeg/jpegc \
     vcl/source/filter/jpeg/JpegReader \
     vcl/source/filter/jpeg/JpegWriter \
     vcl/source/filter/jpeg/JpegTransform \
@@ -467,7 +472,6 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
     vcl/source/filter/wmf/wmf \
     vcl/source/filter/wmf/wmfexternal \
     vcl/source/filter/wmf/wmfwr \
-    vcl/source/filter/png/PngImageReader \
     vcl/source/filter/png/pngwrite \
     vcl/source/font/Feature \
     vcl/source/font/FeatureCollector \
commit 9aa900b06a7ed9cc8ddd4cc24f7ad57e6952bc75
Author:     Jan-Marek Glogowski <glo...@fbihome.de>
AuthorDate: Sat Oct 2 12:40:03 2021 +0200
Commit:     Jan-Marek Glogowski <glo...@fbihome.de>
CommitDate: Sun Oct 3 00:09:32 2021 +0200

    WASM support external DWARF info
    
    merged into the --enable-split-debug tests.
    
    Change-Id: Id0f25bec08bd45daebb0ccd30d17a4feeb08d02c

diff --git a/config_host.mk.in b/config_host.mk.in
index 429e543d0669..683db3206935 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -287,13 +287,13 @@ export 
HAVE_BROKEN_GCC_WMAYBE_UNINITIALIZED=@HAVE_BROKEN_GCC_WMAYBE_UNINITIALIZE
 export HAVE_BROKEN_GCC_WSTRINGOP_OVERFLOW=@HAVE_BROKEN_GCC_WSTRINGOP_OVERFLOW@
 export 
HAVE_CLANG_DEBUG_INFO_KIND_CONSTRUCTOR=@HAVE_CLANG_DEBUG_INFO_KIND_CONSTRUCTOR@
 export HAVE_DLLEXPORTINLINES=@HAVE_DLLEXPORTINLINES@
+export HAVE_EXTERNAL_DWARF=@HAVE_EXTERNAL_DWARF@
 export HAVE_LO_CLANG_DLLEXPORTINLINES=@HAVE_LO_CLANG_DLLEXPORTINLINES@
 export HAVE_GCC_AVX=@HAVE_GCC_AVX@
 export HAVE_GCC_BUILTIN_ATOMIC=@HAVE_GCC_BUILTIN_ATOMIC@
 export HAVE_GCC_FNO_ENFORCE_EH_SPECS=@HAVE_GCC_FNO_ENFORCE_EH_SPECS@
 export HAVE_GCC_FNO_SIZED_DEALLOCATION=@HAVE_GCC_FNO_SIZED_DEALLOCATION@
 export HAVE_GCC_GGDB2=@HAVE_GCC_GGDB2@
-export HAVE_GCC_SPLIT_DWARF=@HAVE_GCC_SPLIT_DWARF@
 export HAVE_GCC_STACK_CLASH_PROTECTION=@HAVE_GCC_STACK_CLASH_PROTECTION@
 export HAVE_GNUMAKE_FILE_FUNC=@HAVE_GNUMAKE_FILE_FUNC@
 export HAVE_LD_BSYMBOLIC_FUNCTIONS=@HAVE_LD_BSYMBOLIC_FUNCTIONS@
diff --git a/configure.ac b/configure.ac
index 318bb14414ca..183a268d0579 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1109,6 +1109,7 @@ emscripten)
     test_qt5=yes
     test_system_freetype=no
     enable_compiler_plugins=no
+    enable_split_debug=yes
     enable_qt5=yes
     enable_wasm_strip=yes
     with_system_zlib=no
@@ -4609,7 +4610,7 @@ printf ("hello world\n");
 }
 USE_LD=
 if test "$enable_ld" != "no"; then
-    if test "$GCC" = "yes"; then
+    if test "$GCC" = "yes" -a "$_os" != "Emscripten"; then
         if test -n "$enable_ld"; then
             check_use_ld "$enable_ld" fail_if_error
         elif test -z "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
@@ -4692,16 +4693,21 @@ printf ("hello world\n");
 fi
 AC_SUBST(LD_GC_SECTIONS)
 
-HAVE_GSPLIT_DWARF=
+HAVE_EXTERNAL_DWARF=
 if test "$enable_split_debug" != no; then
     dnl Currently by default enabled only on Linux, feel free to set 
test_split_debug above also for other platforms.
-    if test "$enable_split_debug" = yes -o \( "$test_split_debug" = "yes" -a 
-n "$ENABLE_DEBUG$ENABLE_DBGUTIL" \); then
-        AC_MSG_CHECKING([whether $CC_BASE supports -gsplit-dwarf])
+    if test "$enable_split_debug" = yes -o \( "$test_split_debug" = "yes" -a 
-n "$ENABLE_DEBUG$ENABLE_DBGUTIL" \) -o "$_os" = "Emscripten"; then
+        if test "$_os" = "Emscripten"; then
+            TEST_CC_FLAG=-gseparate-dwarf
+        else
+            TEST_CC_FLAG=-gsplit-dwarf
+        fi
+        AC_MSG_CHECKING([whether $CC_BASE supports $TEST_CC_FLAG])
         save_CFLAGS=$CFLAGS
-        CFLAGS="$CFLAGS -Werror -gsplit-dwarf"
-        AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ 
HAVE_GCC_SPLIT_DWARF=TRUE ],[])
+        CFLAGS="$CFLAGS -Werror $TEST_CC_FLAG"
+        AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ 
HAVE_EXTERNAL_DWARF=TRUE ],[])
         CFLAGS=$save_CFLAGS
-        if test "$HAVE_GCC_SPLIT_DWARF" = "TRUE"; then
+        if test "$HAVE_EXTERNAL_DWARF" = "TRUE"; then
             AC_MSG_RESULT([yes])
         else
             if test "$enable_split_debug" = yes; then
@@ -4711,12 +4717,8 @@ if test "$enable_split_debug" != no; then
             fi
         fi
     fi
-    if test -z "$HAVE_GCC_SPLIT_DWARF" -a "$test_split_debug" = "yes" -a -n 
"$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
-        AC_MSG_WARN([Compiler is not capable of creating split debug info, 
linking will require more time and disk space.])
-        add_warning "Compiler is not capable of creating split debug info, 
linking will require more time and disk space."
-    fi
 fi
-AC_SUBST(HAVE_GCC_SPLIT_DWARF)
+AC_SUBST(HAVE_EXTERNAL_DWARF)
 
 HAVE_CLANG_DEBUG_INFO_KIND_CONSTRUCTOR=
 AC_MSG_CHECKING([whether $CC_BASE supports -Xclang 
-debug-info-kind=constructor])
diff --git a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk 
b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
index bdb615d0dee9..38bb16f39080 100644
--- a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
+++ b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
@@ -34,6 +34,11 @@ gb_LINKERSTRIPDEBUGFLAGS :=
 # https://developer.chrome.com/blog/wasm-debugging-2020/
 gb_DEBUGINFO_FLAGS = -g
 #gb_DEBUGINFO_FLAGS = -gsource-map 
--source-map-base=file://$(WORKDIR)/LinkTarget/Executable
+
+ifeq ($(HAVE_EXTERNAL_DWARF),TRUE)
+gb_DEBUGINFO_FLAGS += -gseparate-dwarf
+endif
+
 # 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/solenv/gbuild/platform/com_GCC_defs.mk 
b/solenv/gbuild/platform/com_GCC_defs.mk
index da00c5a8ed9e..fe3a88aaad4c 100644
--- a/solenv/gbuild/platform/com_GCC_defs.mk
+++ b/solenv/gbuild/platform/com_GCC_defs.mk
@@ -221,7 +221,7 @@ endif
 gb_LINKER_DEBUGINFO_FLAGS=
 
 # GCC 11 defaults to -gdwarf-5, which GDB 10 doesn't support in split debug 
info
-ifeq ($(HAVE_GCC_SPLIT_DWARF),TRUE)
+ifeq ($(HAVE_EXTERNAL_DWARF),TRUE)
 gb_DEBUGINFO_FLAGS+=-gsplit-dwarf
 ifeq ($(COM_IS_CLANG),)
 gb_DEBUGINFO_FLAGS+=-gdwarf-4
commit a285a1ff07c1378414214d93895d0645e787af6d
Author:     Thorsten Behrens <thorsten.behr...@allotropia.de>
AuthorDate: Sat Sep 25 18:04:18 2021 +0200
Commit:     Jan-Marek Glogowski <glo...@fbihome.de>
CommitDate: Sun Oct 3 00:09:32 2021 +0200

    Also log DEBUG traces while we're developing this
    
    Change-Id: I076f98826a5fec5278041c5a098473e06a0034e5

diff --git a/static/environment.js b/static/environment.js
index 9e4e263f3c73..61663cb148e6 100644
--- a/static/environment.js
+++ b/static/environment.js
@@ -1,3 +1,3 @@
 Module.preRun.push(function() {
-    ENV.SAL_LOG = "+INFO+WARN"
+    ENV.SAL_LOG = "+INFO+WARN+DEBUG"
 });
commit abed1af19cdee6b77d80d9dabb50e30beab17969
Author:     Thorsten Behrens <thorsten.behr...@allotropia.de>
AuthorDate: Sat Sep 25 18:03:31 2021 +0200
Commit:     Jan-Marek Glogowski <glo...@fbihome.de>
CommitDate: Sun Oct 3 00:09:32 2021 +0200

    Add dummy bridge for WASM

diff --git a/Repository.mk b/Repository.mk
index 30f97df2865a..685356339543 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -613,13 +613,11 @@ $(eval $(call 
gb_Helper_register_libraries_for_install,PLAINLIBS_URE,ure, \
 ))
 
 $(eval $(call gb_Helper_register_plugins_for_install,PLAINLIBS_URE,ure, \
-       $(if $(filter EMSCRIPTEN,$(OS)),, \
                $(if $(filter MSC,$(COM)), \
                        $(if $(filter INTEL,$(CPUNAME)),msci_uno) \
                        $(if $(filter X86_64,$(CPUNAME)),mscx_uno) \
                        $(if $(filter AARCH64,$(CPUNAME)),msca_uno) \
                , gcc3_uno) \
-       ) \
 ))
 
 $(eval $(call gb_Helper_register_libraries_for_install,PRIVATELIBS_URE,ure, \
diff --git a/bridges/Library_cpp_uno.mk b/bridges/Library_cpp_uno.mk
index 8a4ec4c10f48..58a8bef7c3c9 100644
--- a/bridges/Library_cpp_uno.mk
+++ b/bridges/Library_cpp_uno.mk
@@ -85,6 +85,10 @@ else ifeq ($(COM),MSC)
 bridges_SELECTED_BRIDGE := msvc_win32_intel
 bridge_exception_objects := cpp2uno uno2cpp
 bridge_noopt_objects := except
+else ifeq ($(OS),EMSCRIPTEN)
+bridges_SELECTED_BRIDGE := gcc3_wasm
+bridge_noopt_objects := cpp2uno except uno2cpp
+#bridge_asm_objects := wasm_helper
 endif
 
 else ifeq ($(CPUNAME),M68K)
diff --git a/bridges/Module_bridges.mk b/bridges/Module_bridges.mk
index 1c7fb1789b8e..3016bf2c404f 100644
--- a/bridges/Module_bridges.mk
+++ b/bridges/Module_bridges.mk
@@ -9,7 +9,6 @@
 
 $(eval $(call gb_Module_Module,bridges))
 
-ifneq ($(OS),EMSCRIPTEN)
 $(eval $(call gb_Module_add_targets,bridges,\
        Library_cpp_uno \
        $(if $(ENABLE_JAVA),\
@@ -30,6 +29,5 @@ else ifneq ($(words $(bridges_SELECTED_BRIDGE)),1)
 $(call gb_Output_error,multiple bridges selected for build: 
$(bridges_SELECTED_BRIDGE))
 endif
 endif
-endif
 
 # vim: set noet sw=4 ts=4:
diff --git a/bridges/source/cpp_uno/gcc3_wasm/cpp2uno.cxx 
b/bridges/source/cpp_uno/gcc3_wasm/cpp2uno.cxx
new file mode 100644
index 000000000000..90e1d372da03
--- /dev/null
+++ b/bridges/source/cpp_uno/gcc3_wasm/cpp2uno.cxx
@@ -0,0 +1,540 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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 .
+ */
+#include <com/sun/star/uno/RuntimeException.hpp>
+#include <sal/log.hxx>
+#include <uno/data.h>
+#include <typelib/typedescription.hxx>
+#include "bridge.hxx"
+#include "cppinterfaceproxy.hxx"
+#include "types.hxx"
+#include "vtablefactory.hxx"
+#include "share.hxx"
+
+
+
+extern "C" int codeSnippets[];
+const int nFunIndexes = 8;
+const int nVtableOffsets = 4;
+
+
+
+using namespace ::com::sun::star::uno;
+
+namespace
+{
+    static typelib_TypeClass cpp2uno_call(
+        bridges::cpp_uno::shared::CppInterfaceProxy* pThis,
+        const typelib_TypeDescription * pMemberTypeDescr,
+        typelib_TypeDescriptionReference * pReturnTypeRef,
+        sal_Int32 nParams,
+        typelib_MethodParameter * pParams,
+        void ** pCallStack,
+        sal_Int64 * pRegisterReturn /* space for register return */ )
+    {
+        // pCallStack: x8, lr, d0..d7, x0..x7, rest of params originally on 
stack
+        char *pTopStack = (char *)pCallStack;
+        char *pFloatRegs = pTopStack + 2;
+        char *pGPRegs =  pTopStack + (2+8)*8;
+        char *pStackedArgs = pTopStack + (2+8+8)*8;
+
+        int nGPR = 0;
+        int nFPR = 0;
+
+        // return
+        typelib_TypeDescription * pReturnTypeDescr = 0;
+        if (pReturnTypeRef)
+            TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef );
+
+        void * pUnoReturn = 0;
+        // complex return ptr: if != 0 && != pUnoReturn, reconversion need
+        void * pCppReturn = 0;
+
+        if (pReturnTypeDescr)
+        {
+            if (!arm::return_in_x8(pReturnTypeRef))
+                pUnoReturn = pRegisterReturn; // direct way for simple types
+            else // complex return via x8
+            {
+                pCppReturn = pCallStack[0];
+
+                pUnoReturn = (bridges::cpp_uno::shared::relatesToInterfaceType(
+                    pReturnTypeDescr )
+                        ? alloca( pReturnTypeDescr->nSize )
+                        : pCppReturn); // direct way
+            }
+        }
+
+        // Skip 'this'
+        pGPRegs += 8;
+        nGPR++;
+
+        // Parameters
+        void ** pUnoArgs = (void **)alloca( sizeof(void *) * nParams );
+        void ** pCppArgs = (void **)alloca( sizeof(void *) * nParams );
+
+        // Indices of values this have to be converted (interface conversion
+        // cpp<=>uno)
+        int * pTempIndices = (int *)alloca( sizeof(int) * nParams);
+
+        // Type descriptions for reconversions
+        typelib_TypeDescription ** ppTempParamTypeDescr = 
(typelib_TypeDescription **)alloca( sizeof(typelib_TypeDescription *) * 
nParams);
+
+        int nTempIndices = 0;
+
+        for ( int nPos = 0; nPos < nParams; ++nPos )
+        {
+            const typelib_MethodParameter & rParam = pParams[nPos];
+            typelib_TypeDescription * pParamTypeDescr = 0;
+            TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef );
+
+            if (!rParam.bOut &&
+                bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr ))
+            {
+                if (nFPR < 8 && (pParamTypeDescr->eTypeClass == 
typelib_TypeClass_FLOAT ||
+                                 pParamTypeDescr->eTypeClass == 
typelib_TypeClass_DOUBLE))
+                {
+                    pCppArgs[nPos] = pUnoArgs[nPos] = pFloatRegs;
+                    pFloatRegs += 8;
+                    nFPR++;
+                }
+                else if (pParamTypeDescr->eTypeClass == 
typelib_TypeClass_FLOAT)
+                {
+                    if ((pStackedArgs - pTopStack) % 4)
+                        pStackedArgs += 4 - ((pStackedArgs - pTopStack) % 4);
+                    pCppArgs[nPos] = pUnoArgs[nPos] = pStackedArgs;
+                    pStackedArgs += 4;
+                }
+                else if (pParamTypeDescr->eTypeClass == 
typelib_TypeClass_DOUBLE)
+                {
+                    if ((pStackedArgs - pTopStack) % 8)
+                        pStackedArgs += 8 - ((pStackedArgs - pTopStack) % 8);
+                    pCppArgs[nPos] = pUnoArgs[nPos] = pStackedArgs;
+                    pStackedArgs += 8;
+                }
+                else if (nGPR < 8)
+                {
+                    pCppArgs[nPos] = pUnoArgs[nPos] = pGPRegs;
+                    pGPRegs += 8;
+                    nGPR++;
+                }
+                else
+                switch (pParamTypeDescr->eTypeClass)
+                {
+                    case typelib_TypeClass_HYPER:
+                    case typelib_TypeClass_UNSIGNED_HYPER:
+                        if ((pStackedArgs - pTopStack) % 8)
+                            pStackedArgs += 8 - ((pStackedArgs - pTopStack) % 
8);
+                        pCppArgs[nPos] = pUnoArgs[nPos] = pStackedArgs;
+                        pStackedArgs += 8;
+                        break;
+                    case typelib_TypeClass_ENUM:
+                    case typelib_TypeClass_LONG:
+                    case typelib_TypeClass_UNSIGNED_LONG:
+                        if ((pStackedArgs - pTopStack) % 4)
+                            pStackedArgs += 4 - ((pStackedArgs - pTopStack) % 
4);
+                        pCppArgs[nPos] = pUnoArgs[nPos] = pStackedArgs;
+                        pStackedArgs += 4;
+                        break;
+                    case typelib_TypeClass_CHAR:
+                    case typelib_TypeClass_SHORT:
+                    case typelib_TypeClass_UNSIGNED_SHORT:
+                        if ((pStackedArgs - pTopStack) % 2)
+                            pStackedArgs += 1;
+                        pCppArgs[nPos] = pUnoArgs[nPos] = pStackedArgs;
+                        pStackedArgs += 2;
+                        break;
+                    case typelib_TypeClass_BOOLEAN:
+                    case typelib_TypeClass_BYTE:
+                        pCppArgs[nPos] = pUnoArgs[nPos] = pStackedArgs;
+                        pStackedArgs += 1;
+                        break;
+                    default:
+                        assert(!"should not happen");
+                        break;
+                }
+                // no longer needed
+                TYPELIB_DANGER_RELEASE( pParamTypeDescr );
+            }
+            else // ptr to complex value | ref
+            {
+                if (nGPR < 8)
+                {
+                    pCppArgs[nPos] = *(void **)pGPRegs;
+                    pGPRegs += 8;
+                }
+                else
+                {
+                    if ((pStackedArgs - pTopStack) % 8)
+                        pStackedArgs += 8 - ((pStackedArgs - pTopStack) % 8);
+                    pCppArgs[nPos] = pStackedArgs;
+                    pStackedArgs += 8;
+                }
+
+                if (! rParam.bIn) // is pure out
+                {
+                    // uno out is unconstructed mem!
+                    pUnoArgs[nPos] = alloca( pParamTypeDescr->nSize );
+                    pTempIndices[nTempIndices] = nPos;
+                    // will be released at reconversion
+                    ppTempParamTypeDescr[nTempIndices++] = pParamTypeDescr;
+                }
+                // is in/inout
+                else if (bridges::cpp_uno::shared::relatesToInterfaceType( 
pParamTypeDescr ))
+                {
+                    uno_copyAndConvertData( pUnoArgs[nPos] =
+                        alloca( pParamTypeDescr->nSize ),
+                        pCppArgs[nPos], pParamTypeDescr,
+                        pThis->getBridge()->getCpp2Uno() );
+                    pTempIndices[nTempIndices] = nPos; // has to be reconverted
+                    // will be released at reconversion
+                    ppTempParamTypeDescr[nTempIndices++] = pParamTypeDescr;
+                }
+                else // direct way
+                {
+                    pUnoArgs[nPos] = pCppArgs[nPos];
+                    // no longer needed
+                    TYPELIB_DANGER_RELEASE( pParamTypeDescr );
+                }
+            }
+        }
+
+        // ExceptionHolder
+        uno_Any aUnoExc; // Any will be constructed by callee
+        uno_Any * pUnoExc = &aUnoExc;
+
+        // invoke uno dispatch call
+        (*pThis->getUnoI()->pDispatcher)(
+          pThis->getUnoI(), pMemberTypeDescr, pUnoReturn, pUnoArgs, &pUnoExc );
+
+        // in case an exception occurred...
+        if (pUnoExc)
+        {
+            // destruct temporary in/inout params
+            for ( ; nTempIndices--; )
+            {
+                int nIndex = pTempIndices[nTempIndices];
+
+                if (pParams[nIndex].bIn) // is in/inout => was constructed
+                    uno_destructData( pUnoArgs[nIndex],
+                        ppTempParamTypeDescr[nTempIndices], 0 );
+                TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndices] );
+            }
+            if (pReturnTypeDescr)
+                TYPELIB_DANGER_RELEASE( pReturnTypeDescr );
+
+            CPPU_CURRENT_NAMESPACE::raiseException( &aUnoExc,
+                pThis->getBridge()->getUno2Cpp() ); // has to destruct the any
+            // is here for dummy
+            return typelib_TypeClass_VOID;
+        }
+        else // else no exception occurred...
+        {
+            // temporary params
+            for ( ; nTempIndices--; )
+            {
+                int nIndex = pTempIndices[nTempIndices];
+                typelib_TypeDescription * pParamTypeDescr =
+                    ppTempParamTypeDescr[nTempIndices];
+
+                if (pParams[nIndex].bOut) // inout/out
+                {
+                    // convert and assign
+                    uno_destructData( pCppArgs[nIndex], pParamTypeDescr,
+                        cpp_release );
+                    uno_copyAndConvertData( pCppArgs[nIndex], pUnoArgs[nIndex],
+                        pParamTypeDescr, pThis->getBridge()->getUno2Cpp() );
+                }
+                // destroy temp uno param
+                uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 );
+
+                TYPELIB_DANGER_RELEASE( pParamTypeDescr );
+            }
+            // return
+            if (pCppReturn) // has complex return
+            {
+                if (pUnoReturn != pCppReturn) // needs reconversion
+                {
+                    uno_copyAndConvertData( pCppReturn, pUnoReturn,
+                        pReturnTypeDescr, pThis->getBridge()->getUno2Cpp() );
+                    // destroy temp uno return
+                    uno_destructData( pUnoReturn, pReturnTypeDescr, 0 );
+                }
+                *(void **)pRegisterReturn = pCppReturn;
+            }
+            if (pReturnTypeDescr)
+            {
+                typelib_TypeClass eRet =
+                    (typelib_TypeClass)pReturnTypeDescr->eTypeClass;
+                TYPELIB_DANGER_RELEASE( pReturnTypeDescr );
+                return eRet;
+            }
+            else
+                return typelib_TypeClass_VOID;
+        }
+    }
+
+
+    static void cpp_mediate(sal_Int32 nFunctionIndex,
+                            sal_Int32 nVtableOffset,
+                            void ** pCallStack)
+    {
+        sal_Int64 nRegReturn;
+        sal_Int64 *pRegisterReturn = &nRegReturn;
+
+        // pCallStack: x8, lr, d0..d7, x0..x7, rest of params originally on 
stack
+        // _this_ ptr is patched cppu_XInterfaceProxy object
+        void *pThis = pCallStack[2 + 8];
+
+        pThis = static_cast< char * >(pThis) - nVtableOffset;
+        bridges::cpp_uno::shared::CppInterfaceProxy * pCppI =
+            bridges::cpp_uno::shared::CppInterfaceProxy::castInterfaceToProxy(
+                pThis);
+
+        typelib_InterfaceTypeDescription * pTypeDescr = pCppI->getTypeDescr();
+
+        // determine called method
+        assert( nFunctionIndex < pTypeDescr->nMapFunctionIndexToMemberIndex );
+
+        if (nFunctionIndex >= pTypeDescr->nMapFunctionIndexToMemberIndex)
+        {
+            throw RuntimeException( "illegal vtable index!", (XInterface 
*)pCppI );
+        }
+
+        sal_Int32 nMemberPos =
+            pTypeDescr->pMapFunctionIndexToMemberIndex[nFunctionIndex];
+        assert( nMemberPos < pTypeDescr->nAllMembers );
+
+        TypeDescription aMemberDescr( pTypeDescr->ppAllMembers[nMemberPos] );
+
+        typelib_TypeClass eRet;
+        switch (aMemberDescr.get()->eTypeClass)
+        {
+        case typelib_TypeClass_INTERFACE_ATTRIBUTE:
+        {
+            if (pTypeDescr->pMapMemberIndexToFunctionIndex[nMemberPos] ==
+                nFunctionIndex)
+            {
+                // is GET method
+                eRet = cpp2uno_call(
+                    pCppI, aMemberDescr.get(),
+                    ((typelib_InterfaceAttributeTypeDescription 
*)aMemberDescr.get())->pAttributeTypeRef,
+                    0, 0, // no params
+                    pCallStack, pRegisterReturn );
+            }
+            else
+            {
+                // is SET method
+                typelib_MethodParameter aParam;
+                aParam.pTypeRef =
+                    ((typelib_InterfaceAttributeTypeDescription 
*)aMemberDescr.get())->pAttributeTypeRef;
+                aParam.bIn      = sal_True;
+                aParam.bOut     = sal_False;
+
+                eRet = cpp2uno_call(
+                    pCppI, aMemberDescr.get(),
+                    0, // indicates void return
+                    1, &aParam,
+                    pCallStack, pRegisterReturn );
+            }
+            break;
+        }
+        case typelib_TypeClass_INTERFACE_METHOD:
+        {
+            // is METHOD
+            switch (nFunctionIndex)
+            {
+            case 1: // acquire()
+                pCppI->acquireProxy(); // non virtual call!
+                eRet = typelib_TypeClass_VOID;
+                break;
+            case 2: // release()
+                pCppI->releaseProxy(); // non virtual call!
+                eRet = typelib_TypeClass_VOID;
+                break;
+            case 0: // queryInterface() opt
+            {
+                typelib_TypeDescription * pTD = 0;
+                TYPELIB_DANGER_GET(&pTD,
+                    reinterpret_cast<Type *>(pCallStack[2])->getTypeLibType());
+                if (pTD)
+                {
+                    XInterface * pInterface = 0;
+                    (*pCppI->getBridge()->getCppEnv()->getRegisteredInterface)(
+                        pCppI->getBridge()->getCppEnv(),
+                        (void **)&pInterface, pCppI->getOid().pData,
+                        (typelib_InterfaceTypeDescription *)pTD );
+
+                    if (pInterface)
+                    {
+                        ::uno_any_construct(
+                            reinterpret_cast< uno_Any * >( pCallStack[0] ),
+                            &pInterface, pTD, cpp_acquire );
+                        pInterface->release();
+                        TYPELIB_DANGER_RELEASE( pTD );
+                        *(void **)pRegisterReturn = pCallStack[0];
+                        eRet = typelib_TypeClass_ANY;
+                        break;
+                    }
+                    TYPELIB_DANGER_RELEASE( pTD );
+                }
+            } // else perform queryInterface()
+            [[fallthrough]];
+            default:
+                eRet = cpp2uno_call(
+                    pCppI, aMemberDescr.get(),
+                    ((typelib_InterfaceMethodTypeDescription 
*)aMemberDescr.get())->pReturnTypeRef,
+                    ((typelib_InterfaceMethodTypeDescription 
*)aMemberDescr.get())->nParams,
+                    ((typelib_InterfaceMethodTypeDescription 
*)aMemberDescr.get())->pParams,
+                    pCallStack, pRegisterReturn );
+            }
+            break;
+        }
+        default:
+        {
+            throw RuntimeException( "no member description found!", 
(XInterface *)pCppI );
+        }
+        }
+
+        (void)eRet;
+        return;
+    }
+}
+
+/**
+ * is called on incoming vtable calls
+ * (called by asm snippets)
+ */
+
+extern "C" void cpp_vtable_call( sal_Int32 func, sal_Int32 offset,
+                                 void **pStack )
+{
+    cpp_mediate(func, offset, pStack);
+}
+
+namespace
+{
+    unsigned char *codeSnippet(const typelib_InterfaceTypeDescription *type,
+                               const typelib_TypeDescription *member,
+                               sal_Int32 functionIndex,
+                               sal_Int32 vtableOffset)
+    {
+        // For now temporarily assert when we get here. The intent is
+        // that we won't need the code snippets at all on iOS.
+        assert(false);
+
+        assert(functionIndex < nFunIndexes);
+        if (!(functionIndex < nFunIndexes))
+            return NULL;
+
+        assert(vtableOffset < nVtableOffsets);
+        if (!(vtableOffset < nVtableOffsets))
+            return NULL;
+
+        // The codeSnippets table is indexed by functionIndex and vtableOffset
+
+        int index = functionIndex*nVtableOffsets + vtableOffset;
+        unsigned char *result = ((unsigned char *) &codeSnippets) + 
codeSnippets[index];
+
+        SAL_INFO( "bridges", "codeSnippet(" << OUString(type->aBase.pTypeName) 
<< "::" << OUString(member->pTypeName) << "): [" << functionIndex << "," << 
vtableOffset << "]=" << (void *) result << " (" << std::hex << 
((int*)result)[0] << "," << ((int*)result)[1] << "," << ((int*)result)[2] << 
"," << ((int*)result)[3] << ")");
+
+        return result;
+    }
+}
+
+struct bridges::cpp_uno::shared::VtableFactory::Slot { void * fn; };
+
+bridges::cpp_uno::shared::VtableFactory::Slot *
+bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block)
+{
+    return static_cast< Slot * >(block) + 2;
+}
+
+std::size_t bridges::cpp_uno::shared::VtableFactory::getBlockSize(
+    sal_Int32 slotCount)
+{
+    return (slotCount + 2) * sizeof (Slot);
+}
+
+bridges::cpp_uno::shared::VtableFactory::Slot *
+bridges::cpp_uno::shared::VtableFactory::initializeBlock(
+    void * block, sal_Int32 slotCount, sal_Int32,
+    typelib_InterfaceTypeDescription *)
+{
+    Slot * slots = mapBlockToVtable(block);
+    slots[-2].fn = 0;
+    slots[-1].fn = 0;
+    return slots + slotCount;
+}
+
+unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
+    Slot ** slots,
+    unsigned char * code,
+    typelib_InterfaceTypeDescription const * type,
+    sal_Int32 functionOffset,
+    sal_Int32 functionCount,
+    sal_Int32 vtableOffset)
+{
+    (*slots) -= functionCount;
+    Slot * s = *slots;
+    for (sal_Int32 i = 0; i < type->nMembers; ++i)
+    {
+        typelib_TypeDescription * member = 0;
+        TYPELIB_DANGER_GET(&member, type->ppMembers[i]);
+        assert(member != 0);
+        switch (member->eTypeClass)
+        {
+            case typelib_TypeClass_INTERFACE_ATTRIBUTE:
+            {
+                typelib_InterfaceAttributeTypeDescription *pAttrTD =
+                    reinterpret_cast<typelib_InterfaceAttributeTypeDescription 
*>( member );
+
+                // Getter:
+                (s++)->fn = codeSnippet( type, member, functionOffset++, 
vtableOffset );
+
+                // Setter:
+                if (!pAttrTD->bReadOnly)
+                {
+                    (s++)->fn = codeSnippet( type, member, functionOffset++, 
vtableOffset );
+                }
+                break;
+            }
+            case typelib_TypeClass_INTERFACE_METHOD:
+            {
+                (s++)->fn = codeSnippet( type, member, functionOffset++, 
vtableOffset );
+                break;
+            }
+        default:
+            assert(false);
+            break;
+        }
+        TYPELIB_DANGER_RELEASE(member);
+    }
+    return code;
+}
+
+
+
+void bridges::cpp_uno::shared::VtableFactory::flushCode(
+    unsigned char const *, unsigned char const *)
+{
+    // No dynamic code generation so nothing to flush
+}
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/bridges/source/cpp_uno/gcc3_wasm/except.cxx 
b/bridges/source/cpp_uno/gcc3_wasm/except.cxx
new file mode 100644
index 000000000000..aebe016052ab
--- /dev/null
+++ b/bridges/source/cpp_uno/gcc3_wasm/except.cxx
@@ -0,0 +1,406 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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 .
+ */
+
+#include "sal/config.h"
+
+#include <cassert>
+#include <new>
+#include <stdio.h>
+#include <string.h>
+#include <typeinfo>
+
+#include <cxxabi.h>
+#include <dlfcn.h>
+
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/genfunc.hxx"
+#include <sal/log.hxx>
+#include "osl/mutex.hxx"
+#include "rtl/strbuf.hxx"
+#include "rtl/ustrbuf.hxx"
+#include "typelib/typedescription.h"
+#include "uno/any2.h"
+#include <unordered_map>
+#include "share.hxx"
+
+using namespace ::osl;
+using namespace ::com::sun::star::uno;
+
+namespace CPPU_CURRENT_NAMESPACE {
+
+namespace {
+
+struct Fake_type_info {
+    virtual ~Fake_type_info() = delete;
+    char const * name;
+};
+
+struct Fake_class_type_info: Fake_type_info {
+    virtual ~Fake_class_type_info() override = delete;
+};
+
+struct Fake_si_class_type_info: Fake_class_type_info {
+    virtual ~Fake_si_class_type_info() override = delete;
+    void const * base;
+};
+
+struct Base {};
+struct Derived: Base {};
+
+std::type_info * createFake_class_type_info(char const * name) {
+    char * buf = new char[sizeof (Fake_class_type_info)];
+
+    *reinterpret_cast<void **>(buf) = *reinterpret_cast<void * const *>(
+        &typeid(Base));
+        // copy __cxxabiv1::__class_type_info vtable into place
+    Fake_class_type_info * fake = reinterpret_cast<Fake_class_type_info 
*>(buf);
+    fake->name = name;
+    return reinterpret_cast<std::type_info *>(
+        static_cast<Fake_type_info *>(fake));
+}
+
+std::type_info * createFake_si_class_type_info(
+    char const * name, std::type_info const * base)
+{
+    char * buf = new char[sizeof (Fake_si_class_type_info)];
+
+    *reinterpret_cast<void **>(buf) = *reinterpret_cast<void * const *>(
+        &typeid(Derived));
+        // copy __cxxabiv1::__si_class_type_info vtable into place
+    Fake_si_class_type_info * fake
+        = reinterpret_cast<Fake_si_class_type_info *>(buf);
+    fake->name = name;
+    fake->base = base;
+    return reinterpret_cast<std::type_info *>(
+        static_cast<Fake_type_info *>(fake));
+}
+
+}
+
+#ifdef __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused-function"
+#endif
+void dummy_can_throw_anything( char const * )
+{
+}
+#ifdef __GNUC__
+#pragma GCC diagnostic pop
+#endif
+
+static OUString toUNOname( char const * p )
+{
+#if OSL_DEBUG_LEVEL > 1
+    char const * start = p;
+#endif
+
+    // example: N3com3sun4star4lang24IllegalArgumentExceptionE
+
+    OUStringBuffer buf( 64 );
+    assert( 'N' == *p );
+    ++p; // skip N
+
+    while ('E' != *p)
+    {
+        // read chars count
+        long n = (*p++ - '0');
+        while ('0' <= *p && '9' >= *p)
+        {
+            n *= 10;
+            n += (*p++ - '0');
+        }
+        buf.appendAscii( p, n );
+        p += n;
+        if ('E' != *p)
+            buf.append( '.' );
+    }
+
+#if OSL_DEBUG_LEVEL > 1
+    OUString ret( buf.makeStringAndClear() );
+    OString c_ret( OUStringToOString( ret, RTL_TEXTENCODING_ASCII_US ) );
+    fprintf( stderr, "> toUNOname(): %s => %s\n", start, c_ret.getStr() );
+    return ret;
+#else
+    return buf.makeStringAndClear();
+#endif
+}
+
+class RTTI
+{
+    typedef std::unordered_map< OUString, std::type_info *, OUStringHash > 
t_rtti_map;
+
+    Mutex m_mutex;
+    t_rtti_map m_rttis;
+    t_rtti_map m_generatedRttis;
+
+    void * m_hApp;
+
+public:
+    RTTI();
+    ~RTTI();
+
+    std::type_info * getRTTI( typelib_CompoundTypeDescription * );
+};
+
+RTTI::RTTI()
+    : m_hApp( dlopen( nullptr, RTLD_LAZY ) )
+{
+}
+
+RTTI::~RTTI()
+{
+    dlclose( m_hApp );
+}
+
+
+std::type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr )
+{
+    std::type_info * rtti;
+
+    OUString const & unoName = 
OUString::unacquired(&pTypeDescr->aBase.pTypeName);
+
+    MutexGuard guard( m_mutex );
+    t_rtti_map::const_iterator iFind( m_rttis.find( unoName ) );
+    if (iFind == m_rttis.end())
+    {
+        // RTTI symbol
+        OStringBuffer buf( 64 );
+        buf.append( "_ZTIN" );
+        sal_Int32 index = 0;
+        do
+        {
+            OUString token( unoName.getToken( 0, '.', index ) );
+            buf.append( token.getLength() );
+            OString c_token( OUStringToOString( token, 
RTL_TEXTENCODING_ASCII_US ) );
+            buf.append( c_token );
+        }
+        while (index >= 0);
+        buf.append( 'E' );
+
+        OString symName( buf.makeStringAndClear() );
+        rtti = static_cast<std::type_info *>(dlsym( m_hApp, symName.getStr() 
));
+
+        if (rtti)
+        {
+            std::pair< t_rtti_map::iterator, bool > insertion(
+                m_rttis.insert( t_rtti_map::value_type( unoName, rtti ) ) );
+            SAL_WARN_IF( !insertion.second,
+                         "bridges",
+                         "inserting new rtti failed" );
+        }
+        else
+        {
+            // try to lookup the symbol in the generated rtti map
+            t_rtti_map::const_iterator iFind2( m_generatedRttis.find( unoName 
) );
+            if (iFind2 == m_generatedRttis.end())
+            {
+                // we must generate it !
+                // symbol and rtti-name is nearly identical,
+                // the symbol is prefixed with _ZTI
+                char * rttiName = strdup(symName.getStr() + 4);
+                if (rttiName == nullptr) {
+                    throw std::bad_alloc();
+                }
+#if OSL_DEBUG_LEVEL > 1
+                fprintf( stderr,"generated rtti for %s\n", rttiName );
+#endif
+                if (pTypeDescr->pBaseTypeDescription)
+                {
+                    // ensure availability of base
+                    std::type_info * base_rtti = getRTTI(
+                        pTypeDescr->pBaseTypeDescription );
+                    rtti = createFake_si_class_type_info(rttiName, base_rtti);
+                }
+                else
+                {
+                    rtti = createFake_class_type_info(rttiName);
+                }
+
+                std::pair< t_rtti_map::iterator, bool > insertion(
+                    m_generatedRttis.insert( t_rtti_map::value_type( unoName, 
rtti ) ) );
+                SAL_WARN_IF( !insertion.second,
+                             "bridges",
+                             "inserting new generated rtti failed" );
+            }
+            else // taking already generated rtti
+            {
+                rtti = iFind2->second;
+            }
+        }
+    }
+    else
+    {
+        rtti = iFind->second;
+    }
+
+    return rtti;
+}
+
+
+static void deleteException( void * pExc )
+{
+    __cxa_exception const * header = static_cast<__cxa_exception const 
*>(pExc) - 1;
+    // The libcxxabi commit
+    // <http://llvm.org/viewvc/llvm-project?view=revision&revision=303175>
+    // "[libcxxabi] Align unwindHeader on a double-word boundary" towards
+    // LLVM 5.0 changed the size of __cxa_exception by adding
+    //
+    //   __attribute__((aligned))
+    //
+    // to the final member unwindHeader, on x86-64 effectively adding a hole of
+    // size 8 in front of that member (changing its offset from 88 to 96,
+    // sizeof(__cxa_exception) from 120 to 128, and alignof(__cxa_exception)
+    // from 8 to 16); a hack to dynamically determine whether we run against a
+    // LLVM 5 libcxxabi is to look at the exceptionDestructor member, which 
must
+    // point to this function (the use of __cxa_exception in fillUnoException 
is
+    // unaffected, as it only accesses members towards the start of the struct,
+    // through a pointer known to actually point at the start).  The libcxxabi 
commit
+    // 
<https://github.com/llvm/llvm-project/commit/9ef1daa46edb80c47d0486148c0afc4e0d83ddcf>
+    // "Insert padding before the __cxa_exception header to ensure the thrown" 
in LLVM 6
+    // removes the need for this hack, so it can be removed again once we can 
be sure that we only
+    // run against libcxxabi from LLVM >= 6:
+    if (header->exceptionDestructor != &deleteException) {
+        header = reinterpret_cast<__cxa_exception const *>(
+            reinterpret_cast<char const *>(header) - 8);
+        assert(header->exceptionDestructor == &deleteException);
+    }
+    typelib_TypeDescription * pTD = nullptr;
+    OUString unoName( toUNOname( header->exceptionType->name() ) );
+    ::typelib_typedescription_getByName( &pTD, unoName.pData );
+    assert(pTD && "### unknown exception type! leaving out destruction => 
leaking!!!");
+    if (pTD)
+    {
+        ::uno_destructData( pExc, pTD, cpp_release );
+        ::typelib_typedescription_release( pTD );
+    }
+}
+
+void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp )
+{
+#if OSL_DEBUG_LEVEL > 1
+    OString cstr(
+        OUStringToOString(
+            OUString::unacquired( &pUnoExc->pType->pTypeName ),
+            RTL_TEXTENCODING_ASCII_US ) );
+    fprintf( stderr, "> uno exception occurred: %s\n", cstr.getStr() );
+#endif
+    void * pCppExc;
+    std::type_info * rtti;
+
+    {
+    // construct cpp exception object
+    typelib_TypeDescription * pTypeDescr = nullptr;
+    TYPELIB_DANGER_GET( &pTypeDescr, pUnoExc->pType );
+    assert(pTypeDescr);
+    if (! pTypeDescr)
+    {
+        throw RuntimeException(
+            "cannot get typedescription for type " +
+            OUString::unacquired( &pUnoExc->pType->pTypeName ) );
+    }
+
+    pCppExc = __cxxabiv1::__cxa_allocate_exception( pTypeDescr->nSize );
+    ::uno_copyAndConvertData( pCppExc, pUnoExc->pData, pTypeDescr, pUno2Cpp );
+
+    // destruct uno exception
+    ::uno_any_destruct( pUnoExc, nullptr );
+    // avoiding locked counts
+    static RTTI rtti_data;
+    rtti = 
rtti_data.getRTTI(reinterpret_cast<typelib_CompoundTypeDescription*>(pTypeDescr));
+    TYPELIB_DANGER_RELEASE( pTypeDescr );
+    assert(rtti && "### no rtti for throwing exception!");
+    if (! rtti)
+    {
+        throw RuntimeException(
+            "no rtti for type " +
+            OUString::unacquired( &pUnoExc->pType->pTypeName ) );
+    }
+    }
+
+    // void __cxa_throw(void* thrown_exception,
+    //                  struct std::type_info * tinfo,
+    //                  void (*dest)(void*));
+    __cxxabiv1::__cxa_throw( pCppExc, rtti, deleteException );
+}
+
+void fillUnoException(uno_Any * pUnoExc, uno_Mapping * pCpp2Uno)
+{
+    __cxa_exception * header = 
__cxxabiv1::__cxa_get_globals()->caughtExceptions;
+    if (! header)
+    {
+        RuntimeException aRE( "no exception header!" );
+        Type const & rType = cppu::UnoType<decltype(aRE)>::get();
+        uno_type_any_constructAndConvert( pUnoExc, &aRE, 
rType.getTypeLibType(), pCpp2Uno );
+        SAL_WARN("bridges", aRE.Message);
+        return;
+    }
+
+    // Very bad HACK to find out whether we run against a libcxxabi that has a 
new
+    // __cxa_exception::reserved member at the start, introduced with LLVM 10
+    // 
<https://github.com/llvm/llvm-project/commit/674ec1eb16678b8addc02a4b0534ab383d22fa77>
+    // "[libcxxabi] Insert padding in __cxa_exception struct for 
compatibility".  The layout of the
+    // start of __cxa_exception is
+    //
+    //  [8 byte  void *reserve]
+    //   8 byte  size_t referenceCount
+    //
+    // where the (bad, hacky) assumption is that reserve (if present) is null
+    // (__cxa_allocate_exception in at least LLVM 11 zero-fills the object, 
and nothing actively
+    // sets reserve) while referenceCount is non-null (__cxa_throw sets it to 
1, and
+    // __cxa_decrement_exception_refcount destroys the exception as soon as it 
drops to 0; for a
+    // __cxa_dependent_exception, the referenceCount member is rather
+    //
+    //   8 byte  void* primaryException
+    //
+    // but which also will always be set to a non-null value in 
__cxa_rethrow_primary_exception).
+    // As described in the definition of __cxa_exception
+    // (bridges/source/cpp_uno/gcc3_macosx_x86-64/share.hxx), this hack 
(together with the "#if 0"
+    // there) can be dropped once we can be sure that we only run against new 
libcxxabi that has the
+    // reserve member:
+    if (*reinterpret_cast<void **>(header) == nullptr) {
+        header = reinterpret_cast<__cxa_exception *>(reinterpret_cast<void 
**>(header) + 1);
+    }
+
+    std::type_info *exceptionType = nullptr; // TODO: 
__cxxabiv1::__cxa_current_exception_type();
+
+    typelib_TypeDescription * pExcTypeDescr = nullptr;
+    OUString unoName( toUNOname( exceptionType->name() ) );
+#if OSL_DEBUG_LEVEL > 1
+    OString cstr_unoName( OUStringToOString( unoName, 
RTL_TEXTENCODING_ASCII_US ) );
+    fprintf( stderr, "> c++ exception occurred: %s\n", cstr_unoName.getStr() );
+#endif
+    typelib_typedescription_getByName( &pExcTypeDescr, unoName.pData );
+    if (nullptr == pExcTypeDescr)
+    {
+        RuntimeException aRE( "exception type not found: " + unoName );
+        Type const & rType = cppu::UnoType<decltype(aRE)>::get();
+        uno_type_any_constructAndConvert( pUnoExc, &aRE, 
rType.getTypeLibType(), pCpp2Uno );
+        SAL_WARN("bridges", aRE.Message);
+    }
+    else
+    {
+        // construct uno exception any
+        uno_any_constructAndConvert( pUnoExc, header->adjustedPtr, 
pExcTypeDescr, pCpp2Uno );
+        typelib_typedescription_release( pExcTypeDescr );
+    }
+}
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/bridges/source/cpp_uno/gcc3_wasm/rtti.h 
b/bridges/source/cpp_uno/gcc3_wasm/rtti.h
new file mode 100644
index 000000000000..fd8ef3715082
--- /dev/null
+++ b/bridges/source/cpp_uno/gcc3_wasm/rtti.h
@@ -0,0 +1,410 @@
+// Copyright (C) 2000, 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
+//
+// This file is part of GCC.
+//
+// GCC is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+// GCC is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+// You should have received a copy of the GNU General Public License
+// along with GCC; see the file COPYING.  If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02110-1301, USA.
+//
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+//
+// Written by Nathan Sidwell, Codesourcery LLC, <nat...@codesourcery.com>
+#ifndef __RTTI_H
+#define __RTTI_H
+
+#include <typeinfo>
+
+namespace __cxxabiv1
+{
+  // Type information for int, float etc.
+  class __fundamental_type_info : public std::type_info
+  {
+  public:
+    explicit
+    __fundamental_type_info(const char* __n) : std::type_info(__n) { }
+
+    virtual
+    ~__fundamental_type_info();
+  };
+
+  // Type information for array objects.
+  class __array_type_info : public std::type_info
+  {
+  public:
+    explicit
+    __array_type_info(const char* __n) : std::type_info(__n) { }
+
+    virtual
+    ~__array_type_info();
+  };
+
+  // Type information for functions (both member and non-member).
+  class __function_type_info : public std::type_info
+  {
+  public:
+    explicit
+    __function_type_info(const char* __n) : std::type_info(__n) { }
+
+    virtual
+    ~__function_type_info();
+
+  protected:
+    // Implementation defined member function.
+    virtual bool
+    __is_function_p() const;
+  };
+
+  // Type information for enumerations.
+  class __enum_type_info : public std::type_info
+  {
+  public:
+    explicit
+    __enum_type_info(const char* __n) : std::type_info(__n) { }
+
+    virtual
+    ~__enum_type_info();
+  };
+
+  // Common type information for simple pointers and pointers to member.
+  class __pbase_type_info : public std::type_info
+  {
+  public:
+    unsigned int        __flags; // Qualification of the target object.
+    const std::type_info*   __pointee; // Type of pointed to object.
+
+    explicit
+    __pbase_type_info(const char* __n, int __quals,
+              const std::type_info* __type)
+    : std::type_info(__n), __flags(__quals), __pointee(__type)
+    { }
+
+    virtual
+    ~__pbase_type_info();
+
+    // Implementation defined type.
+    enum __masks
+      {
+    __const_mask = 0x1,
+    __volatile_mask = 0x2,
+    __restrict_mask = 0x4,
+    __incomplete_mask = 0x8,
+    __incomplete_class_mask = 0x10
+      };
+
+  protected:
+    __pbase_type_info(const __pbase_type_info&);
+
+    __pbase_type_info&
+    operator=(const __pbase_type_info&);
+
+    // Implementation defined member functions.
+    virtual bool
+    __do_catch(const std::type_info* __thr_type, void** __thr_obj,
+           unsigned int __outer) const;
+
+    inline virtual bool
+    __pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj,
+            unsigned __outer) const;
+  };
+
+  // Type information for simple pointers.
+  class __pointer_type_info : public __pbase_type_info
+  {
+  public:
+    explicit
+    __pointer_type_info(const char* __n, int __quals,
+            const std::type_info* __type)
+    : __pbase_type_info (__n, __quals, __type) { }
+
+
+    virtual
+    ~__pointer_type_info();
+
+  protected:
+    // Implementation defined member functions.
+    virtual bool
+    __is_pointer_p() const;
+
+    virtual bool
+    __pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj,
+            unsigned __outer) const;
+  };
+
+  class __class_type_info;
+
+  // Type information for a pointer to member variable.
+  class __pointer_to_member_type_info : public __pbase_type_info
+  {
+  public:
+    __class_type_info* __context;   // Class of the member.
+
+    explicit
+    __pointer_to_member_type_info(const char* __n, int __quals,
+                  const std::type_info* __type,
+                  __class_type_info* __klass)
+    : __pbase_type_info(__n, __quals, __type), __context(__klass) { }
+
+    virtual
+    ~__pointer_to_member_type_info();
+
+  protected:
+    __pointer_to_member_type_info(const __pointer_to_member_type_info&);
+
+    __pointer_to_member_type_info&
+    operator=(const __pointer_to_member_type_info&);
+
+    // Implementation defined member function.
+    virtual bool
+    __pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj,
+            unsigned __outer) const;
+  };
+
+  // Helper class for __vmi_class_type.
+  class __base_class_type_info
+  {
+  public:
+    const __class_type_info*    __base_type;  // Base class type.
+    long            __offset_flags;  // Offset and info.
+
+    enum __offset_flags_masks
+      {
+    __virtual_mask = 0x1,
+    __public_mask = 0x2,
+    __hwm_bit = 2,
+    __offset_shift = 8          // Bits to shift offset.
+      };
+
+    // Implementation defined member functions.
+    bool
+    __is_virtual_p() const
+    { return __offset_flags & __virtual_mask; }
+
+    bool
+    __is_public_p() const
+    { return __offset_flags & __public_mask; }
+
+    ptrdiff_t
+    __offset() const
+    {
+      // This shift, being of a signed type, is implementation
+      // defined. GCC implements such shifts as arithmetic, which is
+      // what we want.
+      return static_cast<ptrdiff_t>(__offset_flags) >> __offset_shift;
+    }
+  };
+
+  // Type information for a class.
+  class __class_type_info : public std::type_info
+  {
+  public:
+    explicit
+    __class_type_info (const char *__n) : type_info(__n) { }
+
+    virtual
+    ~__class_type_info ();
+
+    // Implementation defined types.
+    // The type sub_kind tells us about how a base object is contained
+    // within a derived object. We often do this lazily, hence the
+    // UNKNOWN value. At other times we may use NOT_CONTAINED to mean
+    // not publicly contained.
+    enum __sub_kind
+      {
+    // We have no idea.
+    __unknown = 0,
+
+    // Not contained within us (in some circumstances this might
+    // mean not contained publicly)
+    __not_contained,
+
+    // Contained ambiguously.
+    __contained_ambig,
+
+    // Via a virtual path.
+    __contained_virtual_mask = __base_class_type_info::__virtual_mask,
+
+    // Via a public path.
+    __contained_public_mask = __base_class_type_info::__public_mask,
+
+    // Contained within us.
+    __contained_mask = 1 << __base_class_type_info::__hwm_bit,
+
+    __contained_private = __contained_mask,
+    __contained_public = __contained_mask | __contained_public_mask
+      };
+
+    struct __upcast_result;
+    struct __dyncast_result;
+
+  protected:
+    // Implementation defined member functions.
+    virtual bool
+    __do_upcast(const __class_type_info* __dst_type, void**__obj_ptr) const;
+
+    virtual bool
+    __do_catch(const type_info* __thr_type, void** __thr_obj,
+           unsigned __outer) const;
+
+  public:
+    // Helper for upcast. See if DST is us, or one of our bases.
+    // Return false if not found, true if found.
+    virtual bool
+    __do_upcast(const __class_type_info* __dst, const void* __obj,
+        __upcast_result& __restrict __result) const;
+
+    // Indicate whether SRC_PTR of type SRC_TYPE is contained publicly
+    // within OBJ_PTR. OBJ_PTR points to a base object of our type,
+    // which is the destination type. SRC2DST indicates how SRC
+    // objects might be contained within this type.  If SRC_PTR is one
+    // of our SRC_TYPE bases, indicate the virtuality. Returns
+    // not_contained for non containment or private containment.
+    inline __sub_kind
+    __find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr,
+              const __class_type_info* __src_type,
+              const void* __src_ptr) const;
+
+    // Helper for dynamic cast. ACCESS_PATH gives the access from the
+    // most derived object to this base. DST_TYPE indicates the
+    // desired type we want. OBJ_PTR points to a base of our type
+    // within the complete object. SRC_TYPE indicates the static type
+    // started from and SRC_PTR points to that base within the most
+    // derived object. Fill in RESULT with what we find. Return true
+    // if we have located an ambiguous match.
+    virtual bool
+    __do_dyncast(ptrdiff_t __src2dst, __sub_kind __access_path,
+         const __class_type_info* __dst_type, const void* __obj_ptr,
+         const __class_type_info* __src_type, const void* __src_ptr,
+         __dyncast_result& __result) const;
+
+    // Helper for find_public_subobj. SRC2DST indicates how SRC_TYPE
+    // bases are inherited by the type started from -- which is not
+    // necessarily the current type. The current type will be a base
+    // of the destination type.  OBJ_PTR points to the current base.
+    virtual __sub_kind
+    __do_find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr,
+             const __class_type_info* __src_type,
+             const void* __src_ptr) const;
+  };
+
+  // Type information for a class with a single non-virtual base.
+  class __si_class_type_info : public __class_type_info
+  {
+  public:
+    const __class_type_info* __base_type;
+
+    explicit
+    __si_class_type_info(const char *__n, const __class_type_info *__base)
+    : __class_type_info(__n), __base_type(__base) { }
+
+    virtual
+    ~__si_class_type_info();
+
+  protected:
+    __si_class_type_info(const __si_class_type_info&);
+
+    __si_class_type_info&
+    operator=(const __si_class_type_info&);
+
+    // Implementation defined member functions.
+    virtual bool
+    __do_dyncast(ptrdiff_t __src2dst, __sub_kind __access_path,
+         const __class_type_info* __dst_type, const void* __obj_ptr,
+         const __class_type_info* __src_type, const void* __src_ptr,
+         __dyncast_result& __result) const;
+
+    virtual __sub_kind
+    __do_find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr,
+             const __class_type_info* __src_type,
+             const void* __sub_ptr) const;
+
+    virtual bool
+    __do_upcast(const __class_type_info*__dst, const void*__obj,
+        __upcast_result& __restrict __result) const;
+  };
+
+  // Type information for a class with multiple and/or virtual bases.
+  class __vmi_class_type_info : public __class_type_info
+  {
+  public:
+    unsigned int        __flags;  // Details about the class hierarchy.
+    unsigned int        __base_count;  // Number of direct bases.
+
+    // The array of bases uses the trailing array struct hack so this
+    // class is not constructable with a normal constructor. It is
+    // internally generated by the compiler.
+    __base_class_type_info  __base_info[1];  // Array of bases.
+
+    explicit
+    __vmi_class_type_info(const char* __n, int ___flags)
+    : __class_type_info(__n), __flags(___flags), __base_count(0) { }
+
+    virtual
+    ~__vmi_class_type_info();
+
+    // Implementation defined types.
+    enum __flags_masks
+      {
+    __non_diamond_repeat_mask = 0x1, // Distinct instance of repeated base.
+    __diamond_shaped_mask = 0x2, // Diamond shaped multiple inheritance.
+    __flags_unknown_mask = 0x10
+      };
+
+  protected:
+    // Implementation defined member functions.
+    virtual bool
+    __do_dyncast(ptrdiff_t __src2dst, __sub_kind __access_path,
+         const __class_type_info* __dst_type, const void* __obj_ptr,
+         const __class_type_info* __src_type, const void* __src_ptr,
+         __dyncast_result& __result) const;
+
+    virtual __sub_kind
+    __do_find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr,
+             const __class_type_info* __src_type,
+             const void* __src_ptr) const;
+
+    virtual bool
+    __do_upcast(const __class_type_info* __dst, const void* __obj,
+        __upcast_result& __restrict __result) const;
+  };
+
+  // Dynamic cast runtime.
+  // src2dst has the following possible values
+  //  >-1: src_type is a unique public non-virtual base of dst_type
+  //       dst_ptr + src2dst == src_ptr
+  //   -1: unspecified relationship
+  //   -2: src_type is not a public base of dst_type
+  //   -3: src_type is a multiple public non-virtual base of dst_type
+  extern "C" void*
+  __dynamic_cast(const void* __src_ptr, // Starting object.
+         const __class_type_info* __src_type, // Static type of object.
+         const __class_type_info* __dst_type, // Desired target type.
+         ptrdiff_t __src2dst); // How src and dst are related.
+
+
+  // Returns the type_info for the currently handled exception [15.3/8], or
+  // null if there is none.
+  extern "C" std::type_info*
+  __cxa_current_exception_type();
+} // namespace __cxxabiv1
+
+// User programs should use the alias `abi'.
+namespace abi = __cxxabiv1;
+
+
+#endif // __RTTI_H
diff --git a/bridges/source/cpp_uno/gcc3_wasm/share.hxx 
b/bridges/source/cpp_uno/gcc3_wasm/share.hxx
new file mode 100644
index 000000000000..65461d7fd37f
--- /dev/null
+++ b/bridges/source/cpp_uno/gcc3_wasm/share.hxx
@@ -0,0 +1,57 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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 .
+ */
+#pragma once
+
+#include "uno/mapping.h"
+
+#include <typeinfo>
+#include <exception>
+#include <cstddef>
+
+// from opensource.apple.com: libcppabi-24.4/include/rtti.h
+#include "rtti.h"
+
+// from opensource.apple.com: libcppabi-24.4/include/unwind-cxx.h
+#include "unwind-cxx.h"
+
+// Import the __cxxabiv1 a.k.a. "abi" namespace
+using namespace abi;
+
+namespace CPPU_CURRENT_NAMESPACE
+{
+    void dummy_can_throw_anything( char const * );
+
+    void raiseException(
+        uno_Any * pUnoExc, uno_Mapping * pUno2Cpp );
+
+    void fillUnoException(uno_Any *, uno_Mapping * pCpp2Uno);
+
+    bool isSimpleReturnType(typelib_TypeDescription * pTD, bool recursive = 
false);
+}
+
+namespace arm
+{
+    enum armlimits {
+        MAX_GPR_REGS = 8,
+        MAX_FPR_REGS = 8
+    };
+    bool return_in_x8( typelib_TypeDescriptionReference *pTypeRef );
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/bridges/source/cpp_uno/gcc3_wasm/uno2cpp.cxx 
b/bridges/source/cpp_uno/gcc3_wasm/uno2cpp.cxx
new file mode 100644
index 000000000000..38ee3c1208b8
--- /dev/null
+++ b/bridges/source/cpp_uno/gcc3_wasm/uno2cpp.cxx
@@ -0,0 +1,537 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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 .
+ */
+
+#include <sal/config.h>
+
+#include <exception>
+#include <typeinfo>
+
+#include <com/sun/star/uno/Exception.hpp>
+#include <com/sun/star/uno/RuntimeException.hpp>
+#include <o3tl/runtimetooustring.hxx>
+
+#include "bridge.hxx"
+#include "types.hxx"
+#include "unointerfaceproxy.hxx"
+#include "vtables.hxx"
+
+#include "share.hxx"
+
+using namespace ::com::sun::star::uno;
+
+namespace arm
+{
+    bool is_hfa_struct(const typelib_TypeDescription * type)
+    {
+        const typelib_CompoundTypeDescription * p
+            = reinterpret_cast< const typelib_CompoundTypeDescription * 
>(type);
+        if (p->nMembers >= 4)
+            return false;
+        for (sal_Int32 i = 0; i < p->nMembers; ++i)
+        {
+            if ((p->ppTypeRefs[i]->eTypeClass != typelib_TypeClass_FLOAT &&
+                 p->ppTypeRefs[i]->eTypeClass != typelib_TypeClass_DOUBLE) ||
+                p->ppTypeRefs[i]->eTypeClass != p->ppTypeRefs[0]->eTypeClass)
+                return false;
+        }
+        return true;
+    }
+
+    bool return_in_x8( typelib_TypeDescriptionReference *pTypeRef )
+    {
+        if (bridges::cpp_uno::shared::isSimpleType(pTypeRef))
+            return false;
+        else if (pTypeRef->eTypeClass == typelib_TypeClass_STRUCT || 
pTypeRef->eTypeClass == typelib_TypeClass_EXCEPTION)
+        {
+            typelib_TypeDescription * pTypeDescr = 0;
+            TYPELIB_DANGER_GET( &pTypeDescr, pTypeRef );
+
+            // A Composite Type not larger than 16 bytes is returned in x0, x1
+            bool bRet = pTypeDescr->nSize > 16;
+
+            if (is_hfa_struct(pTypeDescr))
+                bRet = false;
+
+            TYPELIB_DANGER_RELEASE( pTypeDescr );
+            return bRet;
+        }
+        return true;
+    }
+}
+
+void MapReturn(sal_uInt64 x0, sal_uInt64 x1, double d0, 
typelib_TypeDescriptionReference *pReturnType, sal_uInt64 *pRegisterReturn)
+{
+    switch( pReturnType->eTypeClass )
+    {
+    case typelib_TypeClass_HYPER:
+    case typelib_TypeClass_UNSIGNED_HYPER:
+        pRegisterReturn[1] = x1;
+        [[fallthrough]];
+    case typelib_TypeClass_LONG:
+    case typelib_TypeClass_UNSIGNED_LONG:
+    case typelib_TypeClass_ENUM:
+    case typelib_TypeClass_CHAR:
+    case typelib_TypeClass_SHORT:
+    case typelib_TypeClass_UNSIGNED_SHORT:
+    case typelib_TypeClass_BOOLEAN:
+    case typelib_TypeClass_BYTE:
+        pRegisterReturn[0] = x0;
+        break;
+    case typelib_TypeClass_FLOAT:
+        *(float*)pRegisterReturn = *(float*)&d0;
+        break;
+    case typelib_TypeClass_DOUBLE:
+        *(double*)pRegisterReturn = d0;
+        break;
+    case typelib_TypeClass_STRUCT:
+    case typelib_TypeClass_EXCEPTION:
+        if (!arm::return_in_x8(pReturnType))
+        {
+            pRegisterReturn[0] = x0;
+            pRegisterReturn[1] = x1;
+        }
+        break;
+    default:
+        break;
+    }
+}
+
+namespace
+{
+void callVirtualMethod(
+    void *pThis,
+    sal_Int32 nVtableIndex,
+    void *pRegisterReturn,
+    typelib_TypeDescriptionReference *pReturnType,
+    sal_uInt64 *pStack,
+    int nStack,
+    sal_uInt64 *pGPR,
+    double *pFPR)
+{
+    // never called
+    if (! pThis)
+        CPPU_CURRENT_NAMESPACE::dummy_can_throw_anything("xxx"); // address 
something
+
+    if ( nStack )
+    {
+        // 16-bytes aligned
+        sal_uInt32 nStackBytes = ( ( nStack + 3 ) >> 2 ) * 16;
+        sal_uInt32 *stack = (sal_uInt32 *) alloca( nStackBytes );
+        memcpy( stack, pStack, nStackBytes );
+    }
+
+    sal_uInt64 pMethod = *((sal_uInt64*)pThis);
+    pMethod += 8 * nVtableIndex;
+    pMethod = *((sal_uInt64 *)pMethod);
+
+    // For value returned in registers
+    sal_uInt64 x0;
+    sal_uInt64 x1;
+    double d0;
+
+    // TODO: this is all dummy
+
+    MapReturn(x0, x1, d0, pReturnType, (sal_uInt64 *) pRegisterReturn);
+}
+}
+
+#define INSERT_INT64( pSV, nr, pGPR, pDS ) \
+        if ( nr < arm::MAX_GPR_REGS ) \
+                pGPR[nr++] = *reinterpret_cast<sal_uInt64 *>( pSV ); \
+        else \
+                *pDS++ = *reinterpret_cast<sal_uInt64 *>( pSV );
+
+#define INSERT_INT32( pSV, nr, pGPR, pDS ) \
+        if ( nr < arm::MAX_GPR_REGS ) \
+                pGPR[nr++] = *reinterpret_cast<sal_uInt32 *>( pSV ); \
+        else \
+                *pDS++ = *reinterpret_cast<sal_uInt32 *>( pSV );
+
+#define INSERT_INT16( pSV, nr, pGPR, pDS ) \
+        if ( nr < arm::MAX_GPR_REGS ) \
+                pGPR[nr++] = *reinterpret_cast<sal_uInt16 *>( pSV ); \
+        else \
+                *pDS++ = *reinterpret_cast<sal_uInt16 *>( pSV );
+

... etc. - the rest is truncated

Reply via email to