From 563c28b6508ac836fbe46369a4d2d300cda650cf Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 13 Dec 2022 15:08:26 +0200 Subject: Use libxml2 instead of expat in bundled fontconfig in the Emscripten case For just running LO itdelf as WASM it presumably does not matter. But, when building Collabora Online as WASM, using expat in fontconfig turns out to be problematic. The Poco library that Online uses includes a bundled expat library. For some reason the function signatures in that expat are different from those in the bundled expat library from LO core. Thus you get "RuntimeError: null function or function signature mismatch" as only the Poco copy of expat gets linked in in the WASM binary and when code in fontconfig tries to call expat code the signatures don't match. Change-Id: Ic035bb7aab06564ad0050519a2d7a0975ad3a14d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144049 Tested-by: Jenkins Reviewed-by: Tor Lillqvist --- external/fontconfig/ExternalProject_fontconfig.mk | 2 ++ 1 file changed, 2 insertions(+) (limited to 'external') diff --git a/external/fontconfig/ExternalProject_fontconfig.mk b/external/fontconfig/ExternalProject_fontconfig.mk index 9f85faa393e4..f3675258fdea 100644 --- a/external/fontconfig/ExternalProject_fontconfig.mk +++ b/external/fontconfig/ExternalProject_fontconfig.mk @@ -27,6 +27,7 @@ $(call gb_ExternalProject_get_state_target,fontconfig,build) : $(if $(filter EMSCRIPTEN,$(OS)),-pthread)" \ $(if $(filter ANDROID,$(OS)),LIBS="-lm") \ LDFLAGS="$(call gb_ExternalProject_get_link_flags,fontconfig)" \ + $(if $(filter EMSCRIPTEN,$(OS)),LIBXML2_CFLAGS="$(LIBXML_CFLAGS)" LIBXML2_LIBS="$(LIBXML_LIBS)") \ $(gb_RUN_CONFIGURE) ./configure \ --disable-shared \ --disable-silent-rules \ @@ -39,6 +40,7 @@ $(call gb_ExternalProject_get_state_target,fontconfig,build) : --with-baseconfigdir=/instdir/share/fontconfig \ --with-cache-dir=/instdir/share/fontconfig/cache \ --with-add-fonts=/instdir/share/fonts \ + --enable-libxml2 \ ac_cv_func_fstatfs=no ac_cv_func_fstatvfs=no \ ) \ && $(MAKE) -C src && $(MAKE) fonts.conf \ -- cgit