solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk |    8 ++++++++
 1 file changed, 8 insertions(+)

New commits:
commit d648f2ae3a16d0613d1b75848789b9742eb20b19
Author:     Tor Lillqvist <t...@collabora.com>
AuthorDate: Mon Jan 16 23:16:53 2023 +0200
Commit:     Tor Lillqvist <t...@collabora.com>
CommitDate: Tue Jan 17 07:57:12 2023 +0000

    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 <t...@collabora.com>
    Tested-by: Tor Lillqvist <t...@collabora.com>

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)

Reply via email to