diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2018-06-28 04:10:52 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2018-07-04 15:36:41 +0200 |
commit | c90312c6d61bfa43c70c9acf1093edd731c5f02a (patch) | |
tree | b895ac70ed091a7e341a791e0d2428241c651a05 /configure.ac | |
parent | d0cb2967aa288852561497537327ebea838ebc9a (diff) |
add --enable-gdb-index for --gdb-index from gold/lld
https://lists.freedesktop.org/archives/libreoffice/2018-June/080437.html
Change-Id: I66904333bf329e804025d4b229a0db573e21c3af
Reviewed-on: https://gerrit.libreoffice.org/56566
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index ebe5d0c5be9b..3ca4d8e8ab90 100644 --- a/configure.ac +++ b/configure.ac @@ -1121,6 +1121,11 @@ libo_FUZZ_ARG_ENABLE(split-debug, [Uses split debug information (-gsplit-dwarf compile flag). Saves disk space and build time, but requires tools that support it (both build tools and debuggers).])) +libo_FUZZ_ARG_ENABLE(gdb-index, + AS_HELP_STRING([--enable-gdb-index], + [Creates debug information in the gdb index format, which makes gdb start faster. + Requires the gold or lld linker.])) + libo_FUZZ_ARG_ENABLE(sal-log, AS_HELP_STRING([--enable-sal-log], [Make SAL_INFO and SAL_WARN calls do something even in a non-debug build.])) @@ -3180,6 +3185,31 @@ printf ("hello world\n"); fi AC_SUBST(USE_LD) +ENABLE_GDB_INDEX= +if test "$enable_gdb_index" = "yes"; then + AC_MSG_CHECKING([whether $CC supports -ggnu-pubnames]) + save_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS -Werror -ggnu-pubnames" + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ AC_MSG_RESULT( yes )],[ AC_MSG_ERROR( no )]) + + AC_MSG_CHECKING([whether $CC supports -Wl,--gdb-index]) + ldflags_save=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,--gdb-index" + AC_LINK_IFELSE([AC_LANG_PROGRAM([ +#include <stdio.h> + ],[ +printf ("hello world\n"); + ])], ENABLE_GDB_INDEX=TRUE, []) + if test "$ENABLE_GDB_INDEX" = "TRUE"; then + AC_MSG_RESULT( yes ) + else + AC_MSG_ERROR( no ) + fi + CFLAGS=$save_CFLAGS + LDFLAGS=$ldflags_save +fi +AC_SUBST(ENABLE_GDB_INDEX) + HAVE_LD_BSYMBOLIC_FUNCTIONS= if test "$GCC" = "yes"; then AC_MSG_CHECKING([for -Bsymbolic-functions linker support]) |