summaryrefslogtreecommitdiff
path: root/solenv/gbuild
diff options
context:
space:
mode:
authorStephan Bergmann <stephan.bergmann@allotropia.de>2024-10-07 20:47:47 +0200
committerStephan Bergmann <stephan.bergmann@allotropia.de>2024-10-07 22:56:39 +0200
commit0a004f1a1528b8a85245de4672852b574bdc2cb2 (patch)
tree708d1185d6fd3a4cff6b23877fa8cb085e7b1dd2 /solenv/gbuild
parent862d9e03910318a8ca5f990fd1db09f51806ff1d (diff)
Emscripten: Silence -Wlimited-postlink-optimizations
...when building with --enable-optimized --enable-symbols --enable-werror, > em++: error: running limited binaryen optimizations because DWARF info requested (or indirectly required) [-Wlimited-postlink-optimizations] [-Werror] > make[3]: *** [Makefile:506: spellout] Error 1 > make[2]: *** [Makefile:366: all] Error 2 > make[1]: *** [external/libnumbertext/ExternalProject_libnumbertext.mk:25: core/workdir/ExternalProject/libnumbertext/build] Error 1 etc. Change-Id: I62ff0a750d62d6bc50de670623e872beddfb4809 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174642 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Diffstat (limited to 'solenv/gbuild')
-rw-r--r--solenv/gbuild/LinkTarget.mk3
-rw-r--r--solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk6
2 files changed, 8 insertions, 1 deletions
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
index accb3a400df5..5dbdadc23f87 100644
--- a/solenv/gbuild/LinkTarget.mk
+++ b/solenv/gbuild/LinkTarget.mk
@@ -51,7 +51,8 @@ gb_LinkTarget__get_debugflags= \
# T_LDFLAGS is just expanded once. Override the flags here, so that the linker and compiler use the same.
ifeq (EMSCRIPTEN,$(OS))
-gb_LinkTarget__get_debugldflags=$(call gb_LinkTarget__get_debugflags,$1)
+gb_LinkTarget__get_debugldflags=$(call gb_LinkTarget__get_debugflags,$1) \
+ $(gb_LinkTarget__emscripten_warnings_ldflags)
else
# similar for LDFLAGS, use linker optimization flags in non-debug case,
# but moreover strip debug from libraries for which debuginfo is not wanted
diff --git a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
index 37d23aabcfe9..227ef83990de 100644
--- a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
+++ b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
@@ -48,6 +48,12 @@ endif
gb_LinkTarget_LDFLAGS += $(gb_EMSCRIPTEN_LDFLAGS) $(gb_EMSCRIPTEN_CPPFLAGS) \
$(gb_EMSCRIPTEN_EXCEPT) -sEXPORT_EXCEPTION_HANDLING_HELPERS
+ifeq ($(ENABLE_OPTIMIZED),TRUE)
+ifneq ($(ENABLE_SYMBOLS_FOR),)
+gb_LinkTarget__emscripten_warnings_ldflags := -Wno-limited-postlink-optimizations
+endif
+endif
+
# Linker and compiler optimize + debug flags are handled in LinkTarget.mk
gb_LINKEROPTFLAGS :=
gb_LINKERSTRIPDEBUGFLAGS :=