summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2020-12-21 17:31:23 +0100
committerJan-Marek Glogowski <glogow@fbihome.de>2021-01-25 12:42:13 +0100
commite0b5e2d4c3050b5285884ba725d630411bfaeedd (patch)
tree3525b1a38f852d4a3fd5e2bf0bd80c9bc78c164a
parent62b61d5586fc76b6874823a37728d9e9276bb8a7 (diff)
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
-rw-r--r--README.wasm43
-rw-r--r--Repository.mk12
-rw-r--r--RepositoryExternal.mk7
-rw-r--r--configure.ac4
-rw-r--r--external/cairo/ExternalProject_cairo.mk1
-rw-r--r--solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk8
-rw-r--r--solenv/gbuild/platform/com_GCC_defs.mk2
-rw-r--r--svx/Module_svx.mk2
8 files changed, 45 insertions, 34 deletions
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 84fde47b48ee..0685e92d0a94 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, \
diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index 3cc0c3d21ebe..f8061d75e3f7 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/configure.ac b/configure.ac
index c74501c980df..a424792b0e5e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1128,6 +1128,8 @@ emscripten*)
enable_mariadb_sdbc=no
with_system_zlib=no
_os=Emscripten
+
+ BUILD_TYPE="$BUILD_TYPE FONTCONFIG FREETYPE"
;;
*)
@@ -4431,7 +4433,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"
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/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/Module_svx.mk b/svx/Module_svx.mk
index 870dce6c482f..9a45df4943c1 100644
--- a/svx/Module_svx.mk
+++ b/svx/Module_svx.mk
@@ -47,7 +47,7 @@ $(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) \
))