Rebased ref, commits from common ancestor: commit 69e63f88dc68b47e72096ff787a90a1a5fdd8551 Author: Jan-Marek Glogowski <glo...@fbihome.de> AuthorDate: Sun Nov 14 14:23:43 2021 +0100 Commit: Jan-Marek Glogowski <glo...@fbihome.de> CommitDate: Sun Nov 14 14:37:36 2021 +0100
Load android/default-document/example.odt via cmdline This also includes fixes needed after the master rebase for the following bugs: * boost 1.77.0 Emscripten WASM build * thread support with Emscripten clang via gb_CXXFLAGS * gb_var2file rename And it lowers the logging to +WARN. SAL_DEBUG is alway logged. Change-Id: I8ccae56868c7c9e6a88f0281578e17392c8b10ab diff --git a/desktop/Executable_soffice_bin.mk b/desktop/Executable_soffice_bin.mk index 14a72ab6c055..a88d817afea5 100644 --- a/desktop/Executable_soffice_bin.mk +++ b/desktop/Executable_soffice_bin.mk @@ -27,6 +27,8 @@ $(eval $(call gb_Executable_add_cobjects,soffice_bin,\ desktop/source/app/main \ )) +$(eval $(call gb_Executable_add_prejs,soffice_bin,static/soffice_args.js)) + ifeq ($(OS),WNT) $(eval $(call gb_Executable_set_targettype_gui,soffice_bin,NO)) diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx index e5f354ac7935..688491eb248f 100644 --- a/desktop/source/app/cmdlineargs.cxx +++ b/desktop/source/app/cmdlineargs.cxx @@ -112,7 +112,6 @@ 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 @@ -246,7 +245,6 @@ CommandLineEvent CheckWebQuery(/* in,out */ OUString& arg, CommandLineEvent curE return curEvt; } -#endif } // namespace @@ -279,8 +277,6 @@ 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; @@ -293,10 +289,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier ) // start with writer only m_writer = true; m_bDocumentArgs = true; - - m_bEmpty = false; - -#else +#endif m_cwdUrl = supplier.getCwdUrl(); CommandLineEvent eCurrentEvent = CommandLineEvent::Open; @@ -670,6 +663,9 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier ) case CommandLineEvent::Open: m_openlist.push_back(aArg); m_bDocumentArgs = true; +#ifdef ENABLE_WASM_STRIP + m_writer = false; +#endif break; case CommandLineEvent::View: m_viewlist.push_back(aArg); @@ -709,7 +705,6 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier ) } } } -#endif } void CommandLineArgs::InitParamValues() diff --git a/external/boost/UnpackedTarball_boost.mk b/external/boost/UnpackedTarball_boost.mk index 838c495c5161..beb03a436550 100644 --- a/external/boost/UnpackedTarball_boost.mk +++ b/external/boost/UnpackedTarball_boost.mk @@ -44,6 +44,7 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,boost,3)) $(eval $(call gb_UnpackedTarball_add_patches,boost,\ $(foreach patch,$(boost_patches),external/boost/$(patch)) \ external/boost/boost-emscripten-noshm.patch.0 \ + external/boost/boost-emscripten-nowasm.patch.0 \ )) # vim: set noet sw=4 ts=4: diff --git a/external/boost/boost-emscripten-nowasm.patch.0 b/external/boost/boost-emscripten-nowasm.patch.0 new file mode 100644 index 000000000000..39723351e380 --- /dev/null +++ b/external/boost/boost-emscripten-nowasm.patch.0 @@ -0,0 +1,11 @@ +--- boost/config/detail/select_platform_config.hpp.orig 2021-11-13 18:32:09.446182220 +0100 ++++ boost/config/detail/select_platform_config.hpp 2021-11-13 18:32:57.734041110 +0100 +@@ -89,7 +89,7 @@ + // Nuxi CloudABI: + # define BOOST_PLATFORM_CONFIG "boost/config/platform/cloudabi.hpp" + +-#elif defined (__wasm__) ++#elif defined (__wasm__) && !defined (__EMSCRIPTEN__) + // Web assembly: + # define BOOST_PLATFORM_CONFIG "boost/config/platform/wasm.hpp" + diff --git a/postprocess/CustomTarget_components.mk b/postprocess/CustomTarget_components.mk index c6bea411f7f9..8bf34ada4020 100644 --- a/postprocess/CustomTarget_components.mk +++ b/postprocess/CustomTarget_components.mk @@ -22,7 +22,7 @@ $(postprocess_WORKDIR)/services_componentfiles.list: \ $(call gb_Rdb_get_target,ure/services) \ | $(postprocess_WORKDIR)/.dir $(call gb_Output_announce,$(subst $(BUILDDIR)/,,$@),$(true),GEN,2) - TEMPFILE=$(call var2file,$(shell $(gb_MKTEMP)),1, \ + TEMPFILE=$(call gb_var2file,$(shell $(gb_MKTEMP)),1, \ $(foreach comp,$(sort $(gb_ComponentTarget__ALLCOMPONENTS)),$(call gb_ComponentTarget_get_source,$(comp)))) && \ mv $$TEMPFILE $@ diff --git a/solenv/gbuild/Executable.mk b/solenv/gbuild/Executable.mk index ef393cb33949..133220a3e587 100644 --- a/solenv/gbuild/Executable.mk +++ b/solenv/gbuild/Executable.mk @@ -156,6 +156,7 @@ gb_Executable_use_clang = $(call gb_Executable__forward_to_Linktarget,$(0),$(1), gb_Executable_set_clang_precompiled_header = $(call gb_Executable__forward_to_Linktarget,$(0),$(1),$(2),$(3)) gb_Executable_use_glxtest = $(call gb_Executable__forward_to_Linktarget,$(0),$(1),$(2),$(3)) gb_Executable_use_vclmain = $(call gb_Executable__forward_to_Linktarget,$(0),$(1),$(2),$(3)) +gb_Executable_add_prejs = $(call gb_Executable__forward_to_Linktarget,$(0),$(1),$(2),$(3)) # Run-time use diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk index 619410313f95..25c9c05353f0 100644 --- a/solenv/gbuild/LinkTarget.mk +++ b/solenv/gbuild/LinkTarget.mk @@ -900,7 +900,7 @@ define gb_LinkTarget__static_dep_x_template define gb_LinkTarget__command_dep_$(1) $$(call gb_Output_announce,LNK:$$(2).d.$(1),$$(true),DEP,1) mkdir -p $$(dir $$(1)) && \ -TEMPFILE=$$(call var2file,$$(shell $$(gb_MKTEMP)),200,\ +TEMPFILE=$$(call gb_var2file,$$(shell $$(gb_MKTEMP)),200,\ $$(call gb_LinkTarget__get_all_$(1),$$(2))) && \ $$(call gb_Helper_replace_if_different_and_touch,$$$${TEMPFILE},$$(1)) @@ -1066,6 +1066,7 @@ $(call gb_LinkTarget_get_target,$(1)) : T_CC := $(call gb_LinkTarget_get_target,$(1)) : T_CXX := $(call gb_LinkTarget_get_target,$(1)) : T_USE_LD := $(USE_LD) $(call gb_LinkTarget_get_target,$(1)) : T_LTOFLAGS := $(gb_LTOFLAGS) +$(call gb_LinkTarget_get_target,$(1)) : T_PREJS := ifeq ($(gb_FULLDEPS),$(true)) ifeq (depcache:,$(filter depcache,$(.FEATURES)):$(gb_PARTIAL_BUILD)) @@ -2258,4 +2259,12 @@ endef # call gb_LinkTarget__set_plugin_for_nodep,linktarget,loader gb_LinkTarget__set_plugin_for_nodep = $(call gb_LinkTarget__set_plugin_for,$(1),$(2),$(true)) +define gb_LinkTarget_add_prejs +ifeq (EMSCRIPTEN,$(OS)) +$(call gb_LinkTarget_get_target,$(1)) : T_PREJS += $(SRCDIR)/$(2) +$(call gb_LinkTarget_get_target,$(1)) : $(SRCDIR)/$(2) +endif + +endef + # vim: set noet sw=4: diff --git a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk index 562ed18cf867..9ad434a4eb66 100644 --- a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk +++ b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk @@ -33,6 +33,7 @@ else gb_EMSCRIPTEN_EXCEPT = -s DISABLE_EXCEPTION_CATCHING=0 endif +gb_CXXFLAGS += $(gb_EMSCRIPTEN_CPPFLAGS) gb_LinkTarget_EXCEPTIONFLAGS += $(gb_EMSCRIPTEN_EXCEPT) gb_LinkTarget_CFLAGS += $(gb_EMSCRIPTEN_CPPFLAGS) $(gb_EMSCRIPTEN_QTDEFS) gb_LinkTarget_CXXFLAGS += $(gb_EMSCRIPTEN_CPPFLAGS) $(gb_EMSCRIPTEN_QTDEFS) diff --git a/solenv/gbuild/platform/unxgcc.mk b/solenv/gbuild/platform/unxgcc.mk index 30e1b1946060..84d315c20e3a 100644 --- a/solenv/gbuild/platform/unxgcc.mk +++ b/solenv/gbuild/platform/unxgcc.mk @@ -124,7 +124,7 @@ $(call gb_Helper_abbreviate_dirs,\ $(if $(SOVERSIONSCRIPT),-Wl$(COMMA)--soname=$(notdir $(1)) \ -Wl$(COMMA)--version-script=$(SOVERSIONSCRIPT)) \ $(subst \d,$$,$(RPATH)) \ - $(T_USE_LD) $(T_LDFLAGS) \ + $(T_USE_LD) $(T_LDFLAGS) $(foreach pre_js,$(T_PREJS), --pre-js $(pre_js)) \ $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \ $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \ $(foreach object,$(ASMOBJECTS),$(call gb_AsmObject_get_target,$(object))) \ diff --git a/static/CustomTarget_wasm_fs_image.mk b/static/CustomTarget_wasm_fs_image.mk index b999811be389..54400cc2b219 100644 --- a/static/CustomTarget_wasm_fs_image.mk +++ b/static/CustomTarget_wasm_fs_image.mk @@ -1121,6 +1121,7 @@ gb_wasm_image_filelist := \ $(INSTROOT)/share/config/soffice.cfg/sfx/ui/templatepanel.ui \ $(INSTROOT)/share/config/soffice.cfg/sfx/ui/floatingrecord.ui \ $(INSTROOT)/share/config/images_breeze.zip \ + $(SRCDIR)/android/default-document/example.odt \ wasm_fs_image_WORKDIR := $(call gb_CustomTarget_get_workdir,static/wasm_fs_image) @@ -1137,7 +1138,7 @@ $(wasm_fs_image_WORKDIR)/soffice.data.js.link: $(wasm_fs_image_WORKDIR)/soffice. $(call gb_Helper_replace_if_different_and_touch,$^.tmp,$@) $(wasm_fs_image_WORKDIR)/soffice.data.filelist: $(gb_wasm_image_filelist) | $(wasm_fs_image_WORKDIR)/.dir - TEMPFILE=$(call var2file,$(shell $(gb_MKTEMP)),1,$(subst $(BUILDDIR)/,,$^)) && \ + TEMPFILE=$(call gb_var2file,$(shell $(gb_MKTEMP)),1,$(subst $(SRCDIR)/,,$(subst $(BUILDDIR)/,,$^))) && \ mv $$TEMPFILE $@.tmp $(call gb_Helper_replace_if_different_and_touch,$@.tmp,$@) diff --git a/static/environment.js b/static/environment.js index 61663cb148e6..9435635fb7e4 100644 --- a/static/environment.js +++ b/static/environment.js @@ -1,3 +1,3 @@ Module.preRun.push(function() { - ENV.SAL_LOG = "+INFO+WARN+DEBUG" + ENV.SAL_LOG = "+WARN" }); diff --git a/static/soffice_args.js b/static/soffice_args.js new file mode 100644 index 000000000000..4db43905aa07 --- /dev/null +++ b/static/soffice_args.js @@ -0,0 +1 @@ +Module['arguments'] = ['/android/default-document/example.odt']; commit 72c689895e48892f2928beaf41ef14d323409d5e Author: Armin Le Grand (Allotropia) <armin.le.gr...@me.com> AuthorDate: Fri Nov 12 17:16:32 2021 +0100 Commit: Jan-Marek Glogowski <glo...@fbihome.de> CommitDate: Sun Nov 14 14:37:36 2021 +0100 WASM: Make test file loading work Change-Id: Ic34104534c3e0e73791cf867bfb2e1246dc79cf8 diff --git a/framework/source/helper/statusindicator.cxx b/framework/source/helper/statusindicator.cxx index 2deb4a0ae5b2..7dcc9018e1f3 100644 --- a/framework/source/helper/statusindicator.cxx +++ b/framework/source/helper/statusindicator.cxx @@ -40,7 +40,7 @@ void SAL_CALL StatusIndicator::start(const OUString& sText, sal_Int32 nRange) comphelper::LibreOfficeKit::statusIndicatorStart(sText); } -#if !defined(IOS) && !defined(ANDROID) +#if !defined(IOS) && !defined(ANDROID) && !defined(EMSCRIPTEN) css::uno::Reference<css::task::XStatusIndicatorFactory> xFactory(m_xFactory); if (xFactory.is()) { @@ -58,7 +58,7 @@ void SAL_CALL StatusIndicator::end() { comphelper::LibreOfficeKit::statusIndicatorFinish(); } -#if !defined(IOS) && !defined(ANDROID) +#if !defined(IOS) && !defined(ANDROID) && !defined(EMSCRIPTEN) css::uno::Reference<css::task::XStatusIndicatorFactory> xFactory(m_xFactory); if (xFactory.is()) { @@ -72,7 +72,7 @@ void SAL_CALL StatusIndicator::reset() { if (comphelper::LibreOfficeKit::isActive()) return; -#if !defined(IOS) && !defined(ANDROID) +#if !defined(IOS) && !defined(ANDROID) && !defined(EMSCRIPTEN) css::uno::Reference<css::task::XStatusIndicatorFactory> xFactory(m_xFactory); if (xFactory.is()) { @@ -86,7 +86,7 @@ void SAL_CALL StatusIndicator::setText(const OUString& sText) { if (comphelper::LibreOfficeKit::isActive()) return; -#if !defined(IOS) && !defined(ANDROID) +#if !defined(IOS) && !defined(ANDROID) && !defined(EMSCRIPTEN) css::uno::Reference<css::task::XStatusIndicatorFactory> xFactory(m_xFactory); if (xFactory.is()) { @@ -113,7 +113,7 @@ void SAL_CALL StatusIndicator::setValue(sal_Int32 nValue) } return; } -#if !defined(IOS) && !defined(ANDROID) +#if !defined(IOS) && !defined(ANDROID) && !defined(EMSCRIPTEN) css::uno::Reference<css::task::XStatusIndicatorFactory> xFactory(m_xFactory); if (xFactory.is()) { diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx index 2b298e0ebdf8..46502be3adba 100644 --- a/package/source/zipapi/ZipFile.cxx +++ b/package/source/zipapi/ZipFile.cxx @@ -653,9 +653,11 @@ uno::Reference< XInputStream > ZipFile::createStreamForZipEntry( uno::Reference<io::XInputStream> xBufStream; static const sal_Int32 nThreadingThreshold = 10000; +#ifndef EMSCRIPTEN if( xSrcStream->available() > nThreadingThreshold ) xBufStream = new XBufferedThreadedStream(xSrcStream, xSrcStream->getSize()); else +#endif xBufStream = new XBufferedStream(xSrcStream); return xBufStream; diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx index 97435e2219ea..bc4e00ba0349 100644 --- a/sax/source/fastparser/fastparser.cxx +++ b/sax/source/fastparser/fastparser.cxx @@ -838,6 +838,9 @@ void FastSaxParserImpl::parseStream(const InputSource& rStructSource) rEntity.mxDocumentHandler->startDocument(); } +#ifdef EMSCRIPTEN + rEntity.mbEnableThreads = false; +#else if (!getenv("SAX_DISABLE_THREADS") && !m_bDisableThreadedParser) { Reference<css::io::XSeekable> xSeekable(rEntity.maStructSource.aInputStream, UNO_QUERY); @@ -845,6 +848,7 @@ void FastSaxParserImpl::parseStream(const InputSource& rStructSource) rEntity.mbEnableThreads = (xSeekable.is() && xSeekable->getLength() > 10000) || (rEntity.maStructSource.aInputStream->available() > 10000); } +#endif if (rEntity.mbEnableThreads) { diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index faaafa3f7cd3..a0b5ecfe5f3d 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -482,6 +482,7 @@ static bool ImplYield(bool i_bWait, bool i_bAllEvents) bool Application::Reschedule( bool i_bAllEvents ) { #ifdef EMSCRIPTEN + SAL_INFO("wasm", "Application::Reschedule(" << i_bAllEvents << ")"); (void) i_bAllEvents; std::abort(); #else @@ -541,6 +542,7 @@ SAL_DLLPUBLIC_EXPORT void unit_lok_process_events_to_idle() void Application::Yield() { #ifdef EMSCRIPTEN + SAL_INFO("wasm", "Application::Yield()"); std::abort(); #else ImplYield(true, false); diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 6fa0830ff68b..68f56b09c859 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -1567,7 +1567,9 @@ void SvXMLImport::SetAutoStyles( SvXMLStylesContext *pAutoStyles ) mxAutoStyles = pAutoStyles; GetTextImport()->SetAutoStyles( pAutoStyles ); GetShapeImport()->SetAutoStylesContext( pAutoStyles ); +#ifndef ENABLE_WASM_STRIP_CHART GetChartImport()->SetAutoStylesContext( pAutoStyles ); +#endif GetFormImport()->setAutoStyleContext( pAutoStyles ); }