Kaydet (Commit) c90312c6 authored tarafından Luboš Luňák's avatar Luboš Luňák

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: 's avatarLuboš Luňák <l.lunak@collabora.com>
üst d0cb2967
......@@ -130,6 +130,7 @@ export ENABLE_EOT=@ENABLE_EOT@
export ENABLE_EVOAB2=@ENABLE_EVOAB2@
export ENABLE_FIREBIRD_SDBC=@ENABLE_FIREBIRD_SDBC@
export ENABLE_FORMULA_LOGGER=@ENABLE_FORMULA_LOGGER@
export ENABLE_GDB_INDEX=@ENABLE_GDB_INDEX@
export ENABLE_GIO=@ENABLE_GIO@
export ENABLE_GPGMEPP=@ENABLE_GPGMEPP@
export ENABLE_GSTREAMER_0_10=@ENABLE_GSTREAMER_0_10@
......
......@@ -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])
......
......@@ -81,6 +81,12 @@ gb_CXXFLAGS_COMMON := \
gb_CXXFLAGS_Wundef = -Wno-undef
ifeq ($(ENABLE_GDB_INDEX),TRUE)
gb_LinkTarget_LDFLAGS += -Wl,--gdb-index
gb_CFLAGS_COMMON += -ggnu-pubnames
gb_CXXFLAGS_COMMON += -ggnu-pubnames
endif
ifeq ($(strip $(gb_GCOV)),YES)
gb_CFLAGS_COMMON += -fprofile-arcs -ftest-coverage
gb_CXXFLAGS_COMMON += -fprofile-arcs -ftest-coverage
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment