summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config_host.mk.in1
-rw-r--r--configure.ac13
-rw-r--r--solenv/gbuild/platform/com_GCC_defs.mk4
3 files changed, 18 insertions, 0 deletions
diff --git a/config_host.mk.in b/config_host.mk.in
index bcce45b1ce77..f59b51d8f652 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -271,6 +271,7 @@ export GTK3_LIBS=$(gb_SPACE)@GTK3_LIBS@
export USING_X11=@USING_X11@
export HAMCREST_JAR=@HAMCREST_JAR@
export HAVE_BROKEN_GCC_WMAYBE_UNINITIALIZED=@HAVE_BROKEN_GCC_WMAYBE_UNINITIALIZED@
+export HAVE_CLANG_DEBUG_INFO_KIND_CONSTRUCTOR=@HAVE_CLANG_DEBUG_INFO_KIND_CONSTRUCTOR@
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@
diff --git a/configure.ac b/configure.ac
index 8f9e1c71047a..ba2a2d0ea3ee 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4098,6 +4098,19 @@ if test "$enable_split_debug" != no; then
fi
AC_SUBST(HAVE_GCC_SPLIT_DWARF)
+HAVE_CLANG_DEBUG_INFO_KIND_CONSTRUCTOR=
+AC_MSG_CHECKING([whether $CC_BASE supports -Xclang -debug-info-kind=constructor])
+save_CFLAGS=$CFLAGS
+CFLAGS="$CFLAGS -Werror -Xclang -debug-info-kind=constructor"
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_CLANG_DEBUG_INFO_KIND_CONSTRUCTOR=TRUE ],[])
+CFLAGS=$save_CFLAGS
+if test "$HAVE_CLANG_DEBUG_INFO_KIND_CONSTRUCTOR" = "TRUE"; then
+ AC_MSG_RESULT([yes])
+else
+ AC_MSG_RESULT([no])
+fi
+AC_SUBST(HAVE_CLANG_DEBUG_INFO_KIND_CONSTRUCTOR)
+
ENABLE_GDB_INDEX=
if test "$enable_gdb_index" != "no"; then
dnl Currently by default enabled only on Linux, feel free to set test_gdb_index above also for other platforms.
diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk
index 4d3602864bc8..1707a7481ee6 100644
--- a/solenv/gbuild/platform/com_GCC_defs.mk
+++ b/solenv/gbuild/platform/com_GCC_defs.mk
@@ -221,6 +221,10 @@ ifeq ($(HAVE_GCC_SPLIT_DWARF),TRUE)
gb_DEBUGINFO_FLAGS+=-gsplit-dwarf
endif
+ifeq ($(HAVE_CLANG_DEBUG_INFO_KIND_CONSTRUCTOR),TRUE)
+gb_DEBUGINFO_FLAGS+=-Xclang -debug-info-kind=constructor
+endif
+
ifeq ($(ENABLE_GDB_INDEX),TRUE)
gb_LINKER_DEBUGINFO_FLAGS += -Wl,--gdb-index
gb_DEBUGINFO_FLAGS += -ggnu-pubnames