summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2023-01-16 23:16:53 +0200
committerTor Lillqvist <tml@collabora.com>2023-01-17 07:57:12 +0000
commitd648f2ae3a16d0613d1b75848789b9742eb20b19 (patch)
treeff49d03f9ad6708531ceb3deb6c7485f92a5bcf0
parent5c355dbae859d2ac0b0e8fedca86b64797aec081 (diff)
Adapt for --enable-wasm-exceptions
Actually, it seems that to build core with --fwasm-exceptions for use in a LibreOffice Technology -using WASM executable, you need to compile *everything* with that (i.e. *all* of core's externals). Just these gbuild things are not enough to ensure that. You have to put CC=emcc -pthread -fwasm-exceptions -s SUPPORT_LONGJMP=wasm CXX=em++ -pthread -fwasm-exceptions -s SUPPORT_LONGJMP=wasm into your autogen.input. Change-Id: I10d21ad0f73e7e5d72864864d595077bd770f4f6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145646 Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com>
-rw-r--r--solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk8
1 files changed, 8 insertions, 0 deletions
diff --git a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
index 8831aeeb5d54..fdce92af0abe 100644
--- a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
+++ b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
@@ -39,7 +39,15 @@ gb_EMSCRIPTEN_EXCEPT = -s DISABLE_EXCEPTION_CATCHING=0
endif
gb_CXXFLAGS += $(gb_EMSCRIPTEN_CPPFLAGS)
+
+ifeq ($(ENABLE_WASM_EXCEPTIONS),TRUE)
+# Here we don't use += because gb_LinkTarget_EXCEPTIONFLAGS from com_GCC_defs.mk contains -fexceptions and
+# gb_EMSCRIPTEN_EXCEPT already has -fwasm-exceptions
+gb_LinkTarget_EXCEPTIONFLAGS = $(gb_EMSCRIPTEN_EXCEPT)
+else
gb_LinkTarget_EXCEPTIONFLAGS += $(gb_EMSCRIPTEN_EXCEPT)
+endif
+
gb_LinkTarget_CFLAGS += $(gb_EMSCRIPTEN_CPPFLAGS)
gb_LinkTarget_CXXFLAGS += $(gb_EMSCRIPTEN_CPPFLAGS) $(gb_EMSCRIPTEN_EXCEPT)
ifeq ($(ENABLE_QT5),TRUE)