[Libreoffice-commits] core.git: Branch 'private/jmux/wasm_for_master_catchall' - cppu/source shell/Module_shell.mk solenv/gbuild

Jan-Marek Glogowski (via logerrit) logerrit at kemper.freedesktop.org
Thu May 27 17:27:36 UTC 2021


 cppu/source/uno/lbenv.cxx                      |    6 ++++++
 cppu/source/uno/lbmap.cxx                      |    2 ++
 shell/Module_shell.mk                          |    6 +++---
 solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk |    5 ++++-
 4 files changed, 15 insertions(+), 4 deletions(-)

New commits:
commit 2f8696805ee9554f4385659c8f44594247954027
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Thu May 27 19:26:19 2021 +0200
Commit:     Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Thu May 27 19:26:19 2021 +0200

    Prevent WASM rewriting by wasm-emscripten-finalize
    
    Change-Id: I03c3383d3026e258f8db39996af569c508d3189b

diff --git a/cppu/source/uno/lbenv.cxx b/cppu/source/uno/lbenv.cxx
index 03dbc99eafcc..b24a81bf5ac9 100644
--- a/cppu/source/uno/lbenv.cxx
+++ b/cppu/source/uno/lbenv.cxx
@@ -1012,6 +1012,7 @@ void EnvironmentsData::getRegisteredEnvironments(
 bool loadEnv(OUString const  & cLibStem,
                     uno_Environment * pEnv)
 {
+#ifndef __EMSCRIPTEN__
 #ifdef DISABLE_DYNLOADING
     uno_initEnvironmentFunc fpInit;
 
@@ -1051,6 +1052,11 @@ bool loadEnv(OUString const  & cLibStem,
 
     (*fpInit)( pEnv ); // init of environment
     return true;
+#else
+    (void)cLibStem;
+    (void)pEnv;
+    return false;
+#endif
 }
 
 }
diff --git a/cppu/source/uno/lbmap.cxx b/cppu/source/uno/lbmap.cxx
index 685bf6d4a2a8..03ab13ae7e0d 100644
--- a/cppu/source/uno/lbmap.cxx
+++ b/cppu/source/uno/lbmap.cxx
@@ -328,8 +328,10 @@ static void setNegativeBridge( const OUString & rBridgeName )
 
 static uno_ext_getMappingFunc selectMapFunc( const OUString & rBridgeName )
 {
+#ifndef EMSCRIPTEN
     if (rBridgeName.equalsAscii( CPPU_CURRENT_LANGUAGE_BINDING_NAME "_uno" ))
         return CPPU_ENV_uno_ext_getMapping;
+#endif
 #if HAVE_FEATURE_JAVA
     if (rBridgeName.equalsAscii( "java" "_uno" ))
         return java_uno_ext_getMapping;
diff --git a/shell/Module_shell.mk b/shell/Module_shell.mk
index 193c46f3d75d..cb373f99982a 100644
--- a/shell/Module_shell.mk
+++ b/shell/Module_shell.mk
@@ -104,6 +104,7 @@ $(eval $(call gb_Module_add_targets,shell,\
 ))
 endif
 
+ifeq (,$(filter EMSCRIPTEN,$(OS)))
 ifeq ($(filter DESKTOP,$(BUILD_TYPE)),DESKTOP)
 
 $(eval $(call gb_Module_add_targets,shell,\
@@ -111,17 +112,16 @@ $(eval $(call gb_Module_add_targets,shell,\
 ))
 
 ifneq ($(OS),WNT)
-
 $(eval $(call gb_Module_add_targets,shell,\
 	StaticLibrary_xmlparser \
 	Executable_uri_encode \
 	Library_cmdmail \
 	$(if $(ENABLE_MACOSX_SANDBOX),,Package_senddoc) \
 ))
-
 endif
 
-endif
+endif # DESKTOP
+endif # !EMSCRIPTEN
 
 $(eval $(call gb_Module_add_l10n_targets,shell,\
     AllLangMoTarget_shell \
diff --git a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
index 12f63fe78c62..0c4c33bd6241 100644
--- a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
+++ b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
@@ -14,7 +14,10 @@ include $(GBUILDDIR)/platform/unxgcc.mk
 gb_RUN_CONFIGURE := $(SRCDIR)/solenv/bin/run-configure
 # avoid -s SAFE_HEAP=1 - c.f. gh#8584 this breaks source maps
 gb_EMSCRIPTEN_CPPFLAGS := -pthread -s TOTAL_MEMORY=1GB -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=4
-gb_EMSCRIPTEN_LDFLAGS := $(gb_EMSCRIPTEN_CPPFLAGS) --bind -s ERROR_ON_UNDEFINED_SYMBOLS=1 -s FETCH=1 -s ASSERTIONS=2 -s EXIT_RUNTIME=0 -s EXTRA_EXPORTED_RUNTIME_METHODS=["UTF16ToString","stringToUTF16"]
+# To keep the link time (and memory) down, prevent all rewriting options from wasm-emscripten-finalize
+# See emscrypten.py, finalize_wasm, modify_wasm = True
+# So we need WASM_BIGINT=1 and ASSERTIONS=1 (2 implies STACK_OVERFLOW_CHECK)
+gb_EMSCRIPTEN_LDFLAGS := $(gb_EMSCRIPTEN_CPPFLAGS) --bind -s WASM_BIGINT=1 -s ERROR_ON_UNDEFINED_SYMBOLS=1 -s FETCH=1 -s ASSERTIONS=1 -s EXIT_RUNTIME=0 -s EXTRA_EXPORTED_RUNTIME_METHODS=["UTF16ToString","stringToUTF16"]
 gb_EMSCRIPTEN_QTDEFS := -DQT_NO_LINKED_LIST -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB
 
 gb_Executable_EXT := .html


More information about the Libreoffice-commits mailing list