summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config_host.mk.in2
-rw-r--r--configure.ac25
-rw-r--r--solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk5
-rw-r--r--solenv/gbuild/platform/com_GCC_defs.mk2
4 files changed, 23 insertions, 11 deletions
diff --git a/config_host.mk.in b/config_host.mk.in
index 89b433e47168..ee7d7cbce492 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -274,13 +274,13 @@ export HAVE_BROKEN_GCC_WSTRINGOP_OVERFLOW=@HAVE_BROKEN_GCC_WSTRINGOP_OVERFLOW@
export HAVE_CLANG_DEBUG_INFO_KIND_CONSTRUCTOR=@HAVE_CLANG_DEBUG_INFO_KIND_CONSTRUCTOR@
export HAVE_CXX20_ATOMIC_REF=@HAVE_CXX20_ATOMIC_REF@
export HAVE_DLLEXPORTINLINES=@HAVE_DLLEXPORTINLINES@
+export HAVE_EXTERNAL_DWARF=@HAVE_EXTERNAL_DWARF@
export HAVE_LO_CLANG_DLLEXPORTINLINES=@HAVE_LO_CLANG_DLLEXPORTINLINES@
export HAVE_GCC_AVX=@HAVE_GCC_AVX@
export HAVE_GCC_BUILTIN_ATOMIC=@HAVE_GCC_BUILTIN_ATOMIC@
export HAVE_GCC_FNO_ENFORCE_EH_SPECS=@HAVE_GCC_FNO_ENFORCE_EH_SPECS@
export HAVE_GCC_FNO_SIZED_DEALLOCATION=@HAVE_GCC_FNO_SIZED_DEALLOCATION@
export HAVE_GCC_GGDB2=@HAVE_GCC_GGDB2@
-export HAVE_GCC_SPLIT_DWARF=@HAVE_GCC_SPLIT_DWARF@
export HAVE_GCC_STACK_CLASH_PROTECTION=@HAVE_GCC_STACK_CLASH_PROTECTION@
export HAVE_GNUMAKE_FILE_FUNC=@HAVE_GNUMAKE_FILE_FUNC@
export HAVE_LD_BSYMBOLIC_FUNCTIONS=@HAVE_LD_BSYMBOLIC_FUNCTIONS@
diff --git a/configure.ac b/configure.ac
index 0b3dbd5e42fc..c6e778253ef3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1114,11 +1114,13 @@ emscripten)
using_x11=no
test_openldap=no
test_qt5=yes
+ test_split_debug=yes
test_system_freetype=no
enable_compiler_plugins=no
enable_customtarget_components=yes
enable_qt5=yes
enable_scripting=no
+ enable_split_debug=yes
enable_wasm_strip=yes
with_system_zlib=no
with_theme="colibre"
@@ -4579,7 +4581,7 @@ printf ("hello world\n");
}
USE_LD=
if test "$enable_ld" != "no"; then
- if test "$GCC" = "yes"; then
+ if test "$GCC" = "yes" -a "$_os" != "Emscripten"; then
if test -n "$enable_ld"; then
check_use_ld "$enable_ld" fail_if_error
elif test -z "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
@@ -4662,11 +4664,11 @@ printf ("hello world\n");
fi
AC_SUBST(LD_GC_SECTIONS)
-HAVE_GSPLIT_DWARF=
+HAVE_EXTERNAL_DWARF=
if test "$enable_split_debug" != no; then
use_split_debug=
if test -n "$ENABLE_LTO"; then
- true # Inherently incompatible, since no debug info is created while compiling, GCC complains.
+ : # Inherently incompatible, since no debug info is created while compiling, GCC complains.
elif test "$enable_split_debug" = yes; then
use_split_debug=1
dnl Currently by default enabled only on Linux, feel free to set test_split_debug above also for other platforms.
@@ -4674,12 +4676,17 @@ if test "$enable_split_debug" != no; then
use_split_debug=1
fi
if test -n "$use_split_debug"; then
- AC_MSG_CHECKING([whether $CC_BASE supports -gsplit-dwarf])
+ if test "$_os" = "Emscripten"; then
+ TEST_CC_FLAG=-gseparate-dwarf
+ else
+ TEST_CC_FLAG=-gsplit-dwarf
+ fi
+ AC_MSG_CHECKING([whether $CC_BASE supports $TEST_CC_FLAG])
save_CFLAGS=$CFLAGS
- CFLAGS="$CFLAGS -Werror -gsplit-dwarf"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_SPLIT_DWARF=TRUE ],[])
+ CFLAGS="$CFLAGS -Werror $TEST_CC_FLAG"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_EXTERNAL_DWARF=TRUE ],[])
CFLAGS=$save_CFLAGS
- if test "$HAVE_GCC_SPLIT_DWARF" = "TRUE"; then
+ if test "$HAVE_EXTERNAL_DWARF" = "TRUE"; then
AC_MSG_RESULT([yes])
else
if test "$enable_split_debug" = yes; then
@@ -4689,12 +4696,12 @@ if test "$enable_split_debug" != no; then
fi
fi
fi
- if test -z "$HAVE_GCC_SPLIT_DWARF" -a "$test_split_debug" = "yes" -a -n "$use_split_debug"; then
+ if test -z "$HAVE_EXTERNAL_DWARF" -a "$test_split_debug" = "yes" -a -n "$use_split_debug"; then
AC_MSG_WARN([Compiler is not capable of creating split debug info, linking will require more time and disk space.])
add_warning "Compiler is not capable of creating split debug info, linking will require more time and disk space."
fi
fi
-AC_SUBST(HAVE_GCC_SPLIT_DWARF)
+AC_SUBST(HAVE_EXTERNAL_DWARF)
HAVE_CLANG_DEBUG_INFO_KIND_CONSTRUCTOR=
AC_MSG_CHECKING([whether $CC_BASE supports -Xclang -debug-info-kind=constructor])
diff --git a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
index f0063f7c07b1..8d95a8567576 100644
--- a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
+++ b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
@@ -50,6 +50,11 @@ gb_LINKERSTRIPDEBUGFLAGS :=
# https://developer.chrome.com/blog/wasm-debugging-2020/
gb_DEBUGINFO_FLAGS = -g
#gb_DEBUGINFO_FLAGS = -gsource-map --source-map-base=file://$(WORKDIR)/LinkTarget/Executable
+
+ifeq ($(HAVE_EXTERNAL_DWARF),TRUE)
+gb_DEBUGINFO_FLAGS += -gseparate-dwarf
+endif
+
# We need at least code elimination, otherwise linking OOMs even with 64GB.
# So we "fake" -Og support to mean -O1 for Emscripten and always enable it for debug in configure.
gb_COMPILERDEBUGOPTFLAGS := -O1
diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk
index e0c9dfc3d58f..c7cc1c3ef577 100644
--- a/solenv/gbuild/platform/com_GCC_defs.mk
+++ b/solenv/gbuild/platform/com_GCC_defs.mk
@@ -236,7 +236,7 @@ gb_DEBUGINFO_FLAGS=-g2
endif
gb_LINKER_DEBUGINFO_FLAGS=
-ifeq ($(HAVE_GCC_SPLIT_DWARF),TRUE)
+ifeq ($(HAVE_EXTERNAL_DWARF),TRUE)
gb_DEBUGINFO_FLAGS+=-gsplit-dwarf
# GCC 11 defaults to -gdwarf-5, which GDB 10 doesn't support in split debug info
ifeq ($(COM_IS_CLANG),)