[Libreoffice-commits] core.git: Branch 'feature/wasm' - configure.ac external/cairo include/tools README.wasm RepositoryExternal.mk Repository.mk RepositoryModule_build.mk solenv/gbuild svx/Executable_gengal.mk svx/Module_svx.mk tools/source
Jan-Marek Glogowski (via logerrit)
logerrit at kemper.freedesktop.org
Mon Dec 21 16:41:23 UTC 2020
README.wasm | 43 +++++++----------
Repository.mk | 14 +++--
RepositoryExternal.mk | 7 ++
RepositoryModule_build.mk | 62 ++++++++++++-------------
configure.ac | 8 ++-
external/cairo/ExternalProject_cairo.mk | 1
include/tools/stream.hxx | 1
solenv/gbuild/extensions/pre_BuildTools.mk | 2
solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk | 8 +--
solenv/gbuild/platform/com_GCC_defs.mk | 2
svx/Executable_gengal.mk | 2
svx/Module_svx.mk | 8 ++-
tools/source/stream/stream.cxx | 2
13 files changed, 91 insertions(+), 69 deletions(-)
New commits:
commit dddf54013b7015529973e0ec98aab07b59d5ab2e
Author: Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Mon Dec 21 17:31:23 2020 +0100
Commit: Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Mon Dec 21 17:35:06 2020 +0100
Catchall again
As described, I think I found the origin of the problem with an
emcc.py patch I wrote in the beginning to fix configure with cpp
tests. This compiles LO up to some point in Calc with a template
failure. I've made an extra patch from the galeries changes.
The binary is essentially broken. While the alignment is checked
by LO configure, the result instantly crashes with memory
alignement errors somewhere. There seems to be a problem with
inline Exceptions, so I just converted SvStreamEOFException to
non-inline as a workaround.
Change-Id: I3333a04cdb765da3efc4aa511e265a3863d5c9cd
diff --git a/README.wasm b/README.wasm
index b1c3c8d1797a..f7b71fe33db4 100644
--- a/README.wasm
+++ b/README.wasm
@@ -5,6 +5,10 @@ $ make vcl.all
> instdir/program/ui-previewer.html
+Plain make vcl.all may still have dependency problems. But a general
+make currently fails with a template problem in sc. The ui-previewer
+"binary" will "crash" with memory alignment problems.
+
= Setup for the LO WASM build (with Qt) =
@@ -27,6 +31,19 @@ Example bashrc scriptlet:
EMSDK_ENV=$HOME/Development/libreoffice/git_emsdk/emsdk_env.sh
[ -f "$EMSDK_ENV" ] && \. "$EMSDK_ENV" 1>/dev/null 2>&1
+Before cleaning up all configure calls, I patched git_emsdk/upstream/emscripten/emcc.py for cpp:
+
++++ git_emsdk/upstream/emscripten/emcc.py
+@@ -707,7 +707,7 @@ There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR P
+
+ # If this is a configure-type thing, do not compile to JavaScript, instead use clang
+ # to compile to a native binary (using our headers, so things make sense later)
+- CONFIGURE_CONFIG = (os.environ.get('EMMAKEN_JUST_CONFIGURE') or 'conftest.c' in args) and not os.environ.get('EMMAKEN_JUST_CONFIGURE_RECURSE')
++ CONFIGURE_CONFIG = (os.environ.get('EMMAKEN_JUST_CONFIGURE') or ('conftest.' + ext in args for ext in ['c', 'cpp'])) and not os.environ.get('EMMAKEN_JUST_CONFIGURE_RECURSE')
+ CMAKE_CONFIG = 'CMakeFiles/cmTryCompileExec.dir' in ' '.join(args)# or 'CMakeCCompilerId' in ' '.join(args)
+ if CONFIGURE_CONFIG or CMAKE_CONFIG:
+ # XXX use this to debug configure stuff. ./configure's generally hide our
+
== Setup Qt ==
@@ -39,32 +56,9 @@ make -j<CORES> module-qtbase module-qtdeclarative
Building with examples will break with some of them, but at that point Qt already works.
-I used to get a configure failure for Qt:
-
Checking for target architecture... Project ERROR: target architecture detection binary not found.
-Originally I tried two patches to "fix" these:
-
-Edit git_emsdk/upstream/emscripten/emcc.py:
-@@ -760,8 +760,8 @@
- only_object = '-c' in cmd
- for i in reversed(range(len(cmd) - 1)): # Last -o directive should take precedence, if multiple are specified
- if cmd[i] == '-o':
-- if not only_object:
-- cmd[i + 1] += '.js'
-+# if not only_object:
-+# cmd[i + 1] += '.js'
- target = cmd[i + 1]
- break
- if not target:
-
-qtbase/config.tests/arch/write_info.pri:
-- ext = .wasm
-+ ext = .js.wasm
-
-Both break the build in different ways.
-
-What seems to have fixed it instead was to run "emsdk activate 1.39.8" again.
+What seems to have fixed this was to run "emsdk activate 1.39.8" again.
Current Qt fails to start the demo webserver: https://bugreports.qt.io/browse/QTCREATORBUG-24072
Use: emrun --serve_after_close to run Qt WASM demos
@@ -110,6 +104,7 @@ QT5DIR=/dir/of/git_qt5/qtbase
--disable-report-builder
--disable-scripting
--disable-sdremote-bluetooth
+--enable-ccache
--enable-qt5
--without-fonts
--without-helppack-integration
diff --git a/Repository.mk b/Repository.mk
index 29538c57469b..8914c9ceae9e 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -470,7 +470,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
$(if $(filter iOS MACOSX,$(OS)), \
MacOSXSpell \
) \
- $(if $(filter $(OS),EMSCRIPTEN),vclplug_qt5) \
+ $(if $(filter EMSCRIPTEN,$(OS)),vclplug_qt5) \
))
$(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,postgresqlsdbc, \
@@ -553,9 +553,13 @@ $(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_URE,ure, \
) \
log_uno_uno \
unsafe_uno_uno \
- $(if $(filter MSC,$(COM)), \
- $(if $(filter INTEL,$(CPUNAME)),msci, \
- $(if $(filter ARM64,$(CPUNAME)),msca,mscx)),gcc3)_uno \
+ $(if $(filter EMSCRIPTEN,$(OS)),, \
+ $(if $(filter MSC,$(COM)), \
+ $(if $(filter INTEL,$(CPUNAME)),msci_uno) \
+ $(if $(filter X86_64,$(CPUNAME)),mscx_uno) \
+ $(if $(filter ARM64,$(CPUNAME)),msca_uno) \
+ , gcc3_uno) \
+ ) \
))
$(eval $(call gb_Helper_register_libraries_for_install,PRIVATELIBS_URE,ure, \
@@ -905,7 +909,7 @@ $(eval $(call gb_Helper_register_packages_for_install,ooo,\
sfx2_emojiconfig \
$(call gb_Helper_optional,DESKTOP,\
$(if $(filter-out WNT,$(OS)),$(if $(ENABLE_MACOSX_SANDBOX),,shell_senddoc))) \
- $(call gb_Helper_optional,DESKTOP,$(if $(filter-out MACOSX WNT,$(OS)),svx_gengal)) \
+ $(call gb_Helper_optional,DESKTOP,$(if $(filter-out EMSCRIPTEN MACOSX WNT,$(OS)),svx_gengal)) \
$(if $(USING_X11),vcl_fontunxppds) \
$(if $(filter $(OS),MACOSX),vcl_osxres) \
xmloff_dtd \
diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index 050b56d83cf7..cd575faa11a5 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -1363,6 +1363,8 @@ $(call gb_LinkTarget_add_libs,$(1),$(FONTCONFIG_LIBS))
endef
+gb_ExternalProject__use_fontconfig :=
+
else
define gb_LinkTarget__use_fontconfig
@@ -1378,6 +1380,11 @@ $(call gb_LinkTarget_add_libs,$(1),\
endef
+define gb_ExternalProject__use_fontconfig
+$(call gb_ExternalProject_use_external_project,$(1),fontconfig)
+
+endef
+
endif # SYSTEM_FONTCONFIG
ifneq ($(SYSTEM_GRAPHITE),)
diff --git a/RepositoryModule_build.mk b/RepositoryModule_build.mk
index 09bad286cffe..3ea89f432c41 100644
--- a/RepositoryModule_build.mk
+++ b/RepositoryModule_build.mk
@@ -56,38 +56,38 @@ $(eval $(call gb_Module_add_moduledirs,cross_toolset,\
unotools \
ure \
xmlreader \
+ $(if $(WITH_GALLERY_BUILD), \
+ avmedia \
+ basic \
+ canvas \
+ configmgr \
+ connectivity \
+ cppcanvas \
+ drawinglayer \
+ editeng \
+ emfio \
+ filter \
+ framework \
+ linguistic \
+ officecfg \
+ package \
+ postprocess \
+ sfx2 \
+ shell \
+ sot \
+ svgio \
+ svl \
+ svtools \
+ svx \
+ toolkit \
+ ucb \
+ unoxml \
+ uui \
+ vcl \
+ xmloff \
+ xmlscript \
+ ) \
$(call gb_Helper_optional_for_host,DESKTOP, \
- $(if $(WITH_GALLERY_BUILD), \
- avmedia \
- basic \
- canvas \
- configmgr \
- connectivity \
- cppcanvas \
- drawinglayer \
- editeng \
- emfio \
- filter \
- framework \
- linguistic \
- officecfg \
- package \
- postprocess \
- sfx2 \
- shell \
- sot \
- svgio \
- svl \
- svtools \
- svx \
- toolkit \
- ucb \
- unoxml \
- uui \
- vcl \
- xmloff \
- xmlscript \
- ) \
helpcompiler \
xmlhelp \
) \
diff --git a/configure.ac b/configure.ac
index b2277808bbf9..4fe429379b8e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1129,6 +1129,8 @@ emscripten*)
enable_mariadb_sdbc=no
with_system_zlib=no
_os=Emscripten
+
+ BUILD_TYPE="$BUILD_TYPE FONTCONFIG FREETYPE"
;;
*)
@@ -2948,10 +2950,10 @@ AC_SUBST(SYSBASE)
dnl ===================================================================
dnl Sort out various gallery compilation options
dnl ===================================================================
+WITH_GALLERY_BUILD=TRUE
AC_MSG_CHECKING([how to build and package galleries])
if test -n "${with_galleries}"; then
if test "$with_galleries" = "build"; then
- WITH_GALLERY_BUILD=TRUE
AC_MSG_RESULT([build from source images internally])
elif test "$with_galleries" = "no"; then
WITH_GALLERY_BUILD=
@@ -2961,7 +2963,6 @@ if test -n "${with_galleries}"; then
fi
else
if test $_os != iOS -a $_os != Android; then
- WITH_GALLERY_BUILD=TRUE
AC_MSG_RESULT([internal src images for desktop])
else
WITH_GALLERY_BUILD=
@@ -4433,7 +4434,7 @@ fi
AC_SUBST(USE_LD)
HAVE_LD_BSYMBOLIC_FUNCTIONS=
-if test "$GCC" = "yes"; then
+if test "$GCC" = "yes" -a "$_os" != Emscripten ; then
AC_MSG_CHECKING([for -Bsymbolic-functions linker support])
bsymbolic_functions_ldflags_save=$LDFLAGS
LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions"
@@ -5253,6 +5254,7 @@ if test "$cross_compiling" = "yes"; then
fi
test -n "$TARFILE_LOCATION" && sub_conf_opts="$sub_conf_opts --with-external-tar=$TARFILE_LOCATION"
test "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" && sub_conf_opts="$sub_conf_opts --with-system-icu"
+ test "$with_galleries" = "no" -o -z "$WITH_GALLERY_BUILD" && sub_conf_opts="$sub_conf_opts --with-galleries=no"
sub_conf_opts="$sub_conf_opts $with_build_platform_configure_options"
# Don't bother having configure look for stuff not needed for the build platform anyway
diff --git a/external/cairo/ExternalProject_cairo.mk b/external/cairo/ExternalProject_cairo.mk
index eb32338fe74b..59232c9d16be 100644
--- a/external/cairo/ExternalProject_cairo.mk
+++ b/external/cairo/ExternalProject_cairo.mk
@@ -12,6 +12,7 @@ $(eval $(call gb_ExternalProject_ExternalProject,cairo))
$(eval $(call gb_ExternalProject_use_external_project,cairo,pixman))
$(eval $(call gb_ExternalProject_use_externals,cairo,\
+ fontconfig \
freetype \
libpng \
zlib \
diff --git a/include/tools/stream.hxx b/include/tools/stream.hxx
index 2032b30f1d74..7b0a160a3f1c 100644
--- a/include/tools/stream.hxx
+++ b/include/tools/stream.hxx
@@ -676,6 +676,7 @@ public:
class TOOLS_DLLPUBLIC SvStreamEOFException : public std::exception
{
public:
+ SvStreamEOFException();
virtual const char * what() const throw() override;
};
diff --git a/solenv/gbuild/extensions/pre_BuildTools.mk b/solenv/gbuild/extensions/pre_BuildTools.mk
index c45be554a128..9327cbe41714 100644
--- a/solenv/gbuild/extensions/pre_BuildTools.mk
+++ b/solenv/gbuild/extensions/pre_BuildTools.mk
@@ -19,6 +19,7 @@ gb_BUILD_TOOLS = \
gencoll_rule \
genconv_dict \
gendict \
+ $(if $(WITH_GALLERY_BUILD),gengal) \
genindex_data \
helpex \
idxdict \
@@ -33,7 +34,6 @@ gb_BUILD_TOOLS = \
unoidl-write \
xrmex \
$(call gb_Helper_optional_for_host,DESKTOP, \
- gengal \
HelpIndexer \
HelpLinker \
lngconvex \
diff --git a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
index b8af059b4ff7..614d320c6b2c 100644
--- a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
+++ b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
@@ -15,13 +15,13 @@ endif
include $(GBUILDDIR)/platform/unxgcc.mk
-emscripten_CPPFLAGS := -pthread -s TOTAL_MEMORY=1GB -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=4
+gb_EMSCRIPTEN_CPPFLAGS := -pthread -s TOTAL_MEMORY=1GB -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=4 -s SAFE_HEAP=1
gb_Executable_EXT := .html
-gb_CFLAGS += $(emscripten_CPPFLAGS)
-gb_CXXFLAGS += $(emscripten_CPPFLAGS) -s DISABLE_EXCEPTION_CATCHING=0
-gb_LinkTarget_LDFLAGS += $(emscripten_CPPFLAGS) --bind
+gb_CFLAGS += $(gb_EMSCRIPTEN_CPPFLAGS)
+gb_CXXFLAGS += $(gb_EMSCRIPTEN_CPPFLAGS) -s DISABLE_EXCEPTION_CATCHING=0
+gb_LinkTarget_LDFLAGS += $(gb_EMSCRIPTEN_CPPFLAGS) --bind
define gb_Library_get_rpath
endef
diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk
index d5b23ae31875..9c91f61e3b99 100644
--- a/solenv/gbuild/platform/com_GCC_defs.mk
+++ b/solenv/gbuild/platform/com_GCC_defs.mk
@@ -106,8 +106,10 @@ endif
ifeq ($(DISABLE_DYNLOADING),TRUE)
gb_CFLAGS_COMMON += -ffunction-sections -fdata-sections
gb_CXXFLAGS_COMMON += -ffunction-sections -fdata-sections
+ifneq ($(OS),EMSCRIPTEN)
gb_LinkTarget_LDFLAGS += -Wl,--gc-sections
endif
+endif
ifeq ($(COM_IS_CLANG),TRUE)
gb_CXXFLAGS_COMMON += \
diff --git a/svx/Executable_gengal.mk b/svx/Executable_gengal.mk
index 9c82ac774ec5..989711d5d41f 100644
--- a/svx/Executable_gengal.mk
+++ b/svx/Executable_gengal.mk
@@ -29,6 +29,8 @@ $(eval $(call gb_Executable_use_external,gengal,boost_headers))
$(eval $(call gb_Executable_use_sdk_api,gengal))
+$(eval $(call gb_Executable_use_package,gengal,svx_gengal))
+
$(eval $(call gb_Executable_use_libraries,gengal,\
basegfx \
sal \
diff --git a/svx/Module_svx.mk b/svx/Module_svx.mk
index fed54a9185ca..9a45df4943c1 100644
--- a/svx/Module_svx.mk
+++ b/svx/Module_svx.mk
@@ -47,11 +47,17 @@ $(eval $(call gb_Module_add_screenshot_targets,svx,\
ifneq (,$(filter DESKTOP,$(BUILD_TYPE)))
$(eval $(call gb_Module_add_targets,svx,\
- $(if $(filter-out EMSCRIPTEN,$(OS)),Executable_gengal) \
+ Executable_gengal \
$(if $(filter-out MACOSX WNT,$(OS)), \
Package_gengal) \
))
+else # !DESKTOP
+ifeq ($(WITH_GALLERY_BUILD),TRUE)
+$(eval $(call gb_Module_add_targets_for_build,svx,\
+ Executable_gengal \
+))
endif
+endif # !DESKTOP
$(eval $(call gb_Module_add_subsequentcheck_targets,svx,\
JunitTest_svx_unoapi \
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index 0feae91ece83..af5028b0fe6b 100644
--- a/tools/source/stream/stream.cxx
+++ b/tools/source/stream/stream.cxx
@@ -2149,6 +2149,8 @@ std::size_t write_uInt16_lenPrefixed_uInt8s_FromOString(SvStream& rStrm,
return nWritten;
}
+SvStreamEOFException::SvStreamEOFException() : std::exception() {}
+
const char * SvStreamEOFException::what() const throw()
{
return "SvStreamEOFException";
More information about the Libreoffice-commits
mailing list