summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorsten Behrens <thorsten.behrens@allotropia.de>2024-06-06 16:17:57 +0200
committerThorsten Behrens <thorsten.behrens@allotropia.de>2024-06-07 23:53:25 +0200
commit8ecdff7ac3e867b3e0e43a0df24695785abc5962 (patch)
tree29ff6ccffa3d60dabf91aa4bae08f93806aa490b
parent57c228803e55ed343c6693de7d0857ad7d3cd9e3 (diff)
Modernize wasm debug symbol generation
Rolling a few suggested split debug changes from https://developer.chrome.com/blog/faster-wasm-debugging/ into our code. Added emdwp after linker line, to collect .dwo DWARF info into one single file (otherwise Chrome lacks local variable support) Still not working: * -gdwarf-5 does not work yet with neither -O1 nor -Og * -Og results in massive binary sizes, -O1 still required to not blow up browser mem right after load Change-Id: Ibf9ea42882df88d947f9bb3881430f0745c0df54 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168562 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
-rw-r--r--configure.ac2
-rw-r--r--solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk4
-rw-r--r--solenv/gbuild/platform/unxgcc.mk1
3 files changed, 5 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 1fe2a15ca366..edd8191c1e26 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4984,7 +4984,7 @@ if test "$enable_split_debug" != no; then
fi
if test -n "$use_split_debug"; then
if test "$_os" = "Emscripten"; then
- TEST_CC_FLAG=-gseparate-dwarf
+ TEST_CC_FLAG=-gsplit-dwarf -gpubnames
else
TEST_CC_FLAG=-gsplit-dwarf
fi
diff --git a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
index 26570fb2f314..45beedd1af34 100644
--- a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
+++ b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
@@ -48,7 +48,7 @@ gb_LINKERSTRIPDEBUGFLAGS :=
gb_DEBUGINFO_FLAGS = -g
ifeq ($(HAVE_EXTERNAL_DWARF),TRUE)
-gb_DEBUGINFO_FLAGS += -gseparate-dwarf
+gb_DEBUGINFO_FLAGS += -gsplit-dwarf -gpubnames
endif
gb_COMPILEROPTFLAGS := -O3
@@ -65,6 +65,7 @@ $(call gb_LinkTarget_add_auxtargets,$(2),\
$(patsubst %.lib,%.wasm,$(3)) \
$(patsubst %.lib,%.js,$(3)) \
$(patsubst %.lib,%.worker.js,$(3)) \
+ $(patsubst %.lib,%.wasm.dwp,$(3)) \
)
endef
@@ -75,6 +76,7 @@ $(call gb_LinkTarget_add_auxtargets,$(2),\
$(patsubst %.lib,%.wasm,$(3)) \
$(patsubst %.lib,%.js,$(3)) \
$(patsubst %.lib,%.worker.js,$(3)) \
+ $(patsubst %.lib,%.wasm.dwp,$(3)) \
)
endef
diff --git a/solenv/gbuild/platform/unxgcc.mk b/solenv/gbuild/platform/unxgcc.mk
index 440f5c71f1d1..68ea5c571c32 100644
--- a/solenv/gbuild/platform/unxgcc.mk
+++ b/solenv/gbuild/platform/unxgcc.mk
@@ -171,6 +171,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 %.html,%.wasm,$(1)) -o $(patsubst %.html,%.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,\