summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2021-11-17 11:43:00 +0100
committerLuboš Luňák <l.lunak@collabora.com>2021-11-17 14:11:57 +0100
commit75450b3affc424cccfc68eae13a3271204108b09 (patch)
treee2afda8de778d36bbf770612cede9a064f1536ed
parent32aa44e928ceb5194e37ad0a4fb2f38f1c7371c2 (diff)
disable split debug if --enable-lto
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88389 is right that split-debug doesn't make sense with LTO. Without -ffat-lto-objects or with Clang .o files aren't even really object files that would be normally usable. Since gcc complains if the combination is used, explicitly avoid it. Change-Id: I76992e94f4790238e5aaee691b5cec54fd0ef3a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125379 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
-rw-r--r--configure.ac12
1 files changed, 10 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 1872faaafbd7..7ebeeaf6e62f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4557,8 +4557,16 @@ AC_SUBST(LD_GC_SECTIONS)
HAVE_GSPLIT_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.
+ 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.
- if test "$enable_split_debug" = yes -o \( "$test_split_debug" = "yes" -a -n "$ENABLE_DEBUG$ENABLE_DBGUTIL" \); then
+ elif test "$test_split_debug" = "yes" -a -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
+ use_split_debug=1
+ fi
+ if test -n "$use_split_debug"; then
AC_MSG_CHECKING([whether $CC_BASE supports -gsplit-dwarf])
save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -Werror -gsplit-dwarf"
@@ -4574,7 +4582,7 @@ if test "$enable_split_debug" != no; then
fi
fi
fi
- if test -z "$HAVE_GCC_SPLIT_DWARF" -a "$test_split_debug" = "yes" -a -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
+ if test -z "$HAVE_GCC_SPLIT_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