configure.ac                                        |    2 +-
 instsetoo_native/CustomTarget_emscripten-install.mk |    4 +++-
 solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk      |    8 +++++---
 solenv/gbuild/platform/unxgcc.mk                    |    2 +-
 4 files changed, 10 insertions(+), 6 deletions(-)

New commits:
commit e4b24dba07c54c1957df8c42a19392bd01fc01e2
Author:     Stephan Bergmann <stephan.bergm...@collabora.com>
AuthorDate: Wed Jul 16 11:14:05 2025 +0200
Commit:     Stephan Bergmann <stephan.bergm...@collabora.com>
CommitDate: Wed Jul 16 14:19:47 2025 +0200

    Emscripten: Put back -gseparate-dwarf
    
    ...which had been replaced with -gsplit-dwarf in
    8ecdff7ac3e867b3e0e43a0df24695785abc5962 "Modernize wasm debug symbol
    generation".  But -gseparate-dwarf and -gsplit-dwarf are apparently 
orthogonal:
    
    -gseparate-dwarf adds a supplementary *.wasm.debug.wasm (whose relative URL 
is
    recorded in an external_debug_info section in the original *.wasm), and the
    original *.wasm and the supplementary *.wasm.debug.wasm have exactly the 
same
    content, except that only the supplementary *.wasm.debug.wasm contains any 
of
    the .debug_* sections (and only the original *.wasm contains the
    external_debug_info section).  That way, the original *.wasm stays small (so
    that it does not exceed any limits of the browser's JS WebAssembly 
instantiation
    machinery), while the browser's debugger (like Chrome's "C/C++ DevTools 
Support
    (DWARF)" extension) uses the supplementary *.wasm.debug.wasm.  This is
    especially relevant when building LO with e.g. -fsanitize=address, where the
    resulting soffice.wasm would otherwise easily grow too large.
    
    -gsplit-dwarf, on the other hand, leaves certain debug information in 
.debug_*
    sections in the original *.wasm and offloads further debug data to an 
auxiliary
    *.wasm.dwp (which the browser's debugger will then load and use in addition 
to
    using the original *.wasm's debug information).  When combined with
    -gseparate-dwarf, there's an overall three files now: the original *.wasm 
(used
    by the browser's JS WebAssembly instantiation machinery; lacking any debug
    information), the supplementary *.wasm.debug.wasm (used by the browser's
    debugger; containing some debug information), and the auxiliary
    *.wasm.debug.wasm.dwp (used by the browser's debugger; containing further 
debug
    information).  (One might assume that when using -gseparate-dwarf there 
would be
    no benefit from additionally using -gsplit-dwarf.  But when I tried that 
with at
    least Chrome version 138.0.7204.100 and the "C/C++ DevTools Support (DWARF)"
    extension version 0.2.5854.1, it would still sometimes fail with
    
    > [C/C++ DevTools Support (DWARF)] Loading debug symbols for 
http://localhost:6931/soffice.wasm (via soffice.wasm.debug.wasm)…
    > [C/C++ DevTools Support (DWARF)] Failed to load debug symbols for 
http://localhost:6931/soffice.wasm (TypeError: Failed to fetch)
    
    and the emrun server reporting
    
    > 127.0.0.1 - - [15/Jul/2025 22:41:58] code 404, message File not found: 
/home/sberg/cowasm/core/workdir/installation/LibreOffice/emscripten/soffice.wasm.debug.wasm.dwp
    > 127.0.0.1 - - [15/Jul/2025 22:41:58] "GET /soffice.wasm.debug.wasm.dwp 
HTTP/1.1" 404 -
    
    making it look like it wanted to access a non-existing auxiliary
    soffice.wasm.debug.wasm.dwp for some unclear reason.  So, at least for now, 
it
    looks better to just use a setup that provides that auxiliary file anyway.)
    
    Change-Id: I72352479c864c8d89cc63cc228aa676c7c2d8ccf
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187953
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <stephan.bergm...@collabora.com>

diff --git a/configure.ac b/configure.ac
index 52461372d428..f3761d0eeca6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5178,7 +5178,7 @@ if test "$enable_split_debug" != no; then
     fi
     if test -n "$use_split_debug"; then
         if test "$_os" = "Emscripten"; then
-            TEST_CC_FLAG='-gsplit-dwarf -gpubnames'
+            TEST_CC_FLAG='-gseparate-dwarf -gsplit-dwarf -gpubnames'
         else
             TEST_CC_FLAG=-gsplit-dwarf
         fi
diff --git a/instsetoo_native/CustomTarget_emscripten-install.mk 
b/instsetoo_native/CustomTarget_emscripten-install.mk
index 6f89d5e37fe4..607217742413 100644
--- a/instsetoo_native/CustomTarget_emscripten-install.mk
+++ b/instsetoo_native/CustomTarget_emscripten-install.mk
@@ -19,7 +19,9 @@ emscripten_install_files := \
     soffice.js \
     soffice.wasm \
     $(if $(EMSCRIPTEN_WORKERJS),soffice.worker.js) \
-    $(if $(ENABLE_SYMBOLS_FOR),soffice.wasm.dwp) \
+    $(if $(ENABLE_SYMBOLS_FOR), \
+        soffice.wasm.debug.wasm \
+        soffice.wasm.debug.wasm.dwp) \
     $(if $(DISABLE_GUI),, \
         qt_soffice.html \
         qtloader.js \
diff --git a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk 
b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
index 462992588abb..17bc0ba3f22d 100644
--- a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
+++ b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
@@ -76,7 +76,7 @@ gb_LINKERSTRIPDEBUGFLAGS :=
 gb_DEBUGINFO_FLAGS = -g
 
 ifeq ($(HAVE_EXTERNAL_DWARF),TRUE)
-gb_DEBUGINFO_FLAGS += -gsplit-dwarf -gpubnames
+gb_DEBUGINFO_FLAGS += -gseparate-dwarf -gsplit-dwarf -gpubnames
 endif
 
 gb_COMPILEROPTFLAGS := -O3
@@ -92,7 +92,8 @@ $(call gb_LinkTarget_add_auxtargets,$(2),\
         $(patsubst %.lib,%.linkdeps,$(3)) \
         $(patsubst %.lib,%.wasm,$(3)) \
         $(if $(EMSCRIPTEN_WORKERJS),$(patsubst %.lib,%.worker.js,$(3))) \
-        $(patsubst %.lib,%.wasm.dwp,$(3)) \
+        $(patsubst %.lib,%.wasm.debug.wasm,$(3)) \
+        $(patsubst %.lib,%.wasm.debug.wasm.dwp,$(3)) \
 )
 
 endef
@@ -102,7 +103,8 @@ $(call gb_LinkTarget_add_auxtargets,$(2),\
         $(patsubst %.lib,%.linkdeps,$(3)) \
         $(patsubst %.lib,%.wasm,$(3)) \
         $(if $(EMSCRIPTEN_WORKERJS),$(patsubst %.lib,%.worker.js,$(3))) \
-        $(patsubst %.lib,%.wasm.dwp,$(3)) \
+        $(patsubst %.lib,%.wasm.debug.wasm,$(3)) \
+        $(patsubst %.lib,%.wasm.debug.wasm.dwp,$(3)) \
 )
 
 endef
diff --git a/solenv/gbuild/platform/unxgcc.mk b/solenv/gbuild/platform/unxgcc.mk
index 2f8f4df9603b..1c22db269d34 100644
--- a/solenv/gbuild/platform/unxgcc.mk
+++ b/solenv/gbuild/platform/unxgcc.mk
@@ -172,7 +172,7 @@ $(call gb_Helper_abbreviate_dirs,\
                 ) \
                -o $(1) \
        $(if $(SOVERSIONSCRIPT),&& ln -sf ../../program/$(notdir $(1)) 
$(ILIBTARGET)) \
-       $(if $(filter EMSCRIPTEN,$(OS)),$(if $(filter 
TRUE,$(HAVE_EXTERNAL_DWARF)),&& emdwp -e $(patsubst 
%$(gb_Executable_EXT),%.wasm,$(1)) -o $(patsubst 
%$(gb_Executable_EXT),%.wasm.dwp,$(1)))) \
+       $(if $(filter EMSCRIPTEN,$(OS)),$(if $(filter 
TRUE,$(HAVE_EXTERNAL_DWARF)),&& emdwp -e $(patsubst 
%$(gb_Executable_EXT),%.wasm.debug.wasm,$(1)) -o $(patsubst 
%$(gb_Executable_EXT),%.wasm.debug.wasm.dwp,$(1)))) \
        $(if $(call gb_LinkTarget__WantLock,$(2)),; RC=$$? ; rm -f 
$(gb_LinkTarget__Lock); if test $$RC -ne 0; then exit $$RC; fi))
 
 $(if $(filter Library,$(TARGETTYPE)), $(call gb_Helper_abbreviate_dirs,\

Reply via email to