summaryrefslogtreecommitdiff
path: root/gdb/configure.ac
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2010-05-28 18:50:29 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2010-05-28 18:50:29 +0000
commite4c30a7b51181b7a61f62d0907e3df4c28e61733 (patch)
tree9ebd5fc91c13b4fa531fc6f7636837ea54180813 /gdb/configure.ac
parenta614d2015993ccb4e660d80ab59dc8ac02aafea1 (diff)
downloadgdb-e4c30a7b51181b7a61f62d0907e3df4c28e61733.tar.gz
gdb/
* Makefile.in (RDYNAMIC): New. (SFILES): Add proc-service.list. * config/alpha/alpha-linux.mh (NAT_CDEPS): New. (LOADLIBES): Replace -rdynamic by $(RDYNAMIC). * config/arm/linux.mh: Likewise. * config/i386/linux.mh: Likewise. * config/i386/linux64.mh: Likewise. * config/ia64/linux.mh: Likewise. * config/m32r/linux.mh: Likewise. * config/m68k/linux.mh: Likewise. * config/mips/linux.mh: Likewise. * config/pa/linux.mh: Likewise. * config/powerpc/linux.mh: Likewise. * config/powerpc/ppc64-linux.mh: Likewise. * config/s390/s390.mh: Likewise. * config/sparc/linux.mh: Likewise. * config/sparc/linux64.mh: Likewise. * config/xtensa/linux.mh: Likewise. * configure.ac: New RDYNAMIC on native host and GCC. (solaris*): Replace -Wl,-export-dynamic by $RDYNAMIC. * configure: Regenerate. * proc-service.list: New. gdb/gdbserver/ * Makefile.in (SFILES): Add $(srcdir)/proc-service.list. (CDEPS): New. * configure.ac (RDYNAMIC): New AC_MSG_CHECKING wrapping. Test also -Wl,--dynamic-list. * configure: Regenerate. * proc-service.list: New.
Diffstat (limited to 'gdb/configure.ac')
-rw-r--r--gdb/configure.ac38
1 files changed, 25 insertions, 13 deletions
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 70608afedbe..16789b9aefa 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -1450,6 +1450,30 @@ dnl Note that we only want this if we are both native (host == target),
dnl and not doing a canadian cross build (build == host).
if test ${build} = ${host} -a ${host} = ${target} ; then
+ if test "$GCC" = "yes" ; then
+ # The dynamically loaded libthread_db needs access to symbols in the gdb
+ # executable. Older GNU ld supports --export-dynamic but --dynamic-list
+ # may not be supported there.
+ AC_MSG_CHECKING(for the dynamic export flag)
+ old_LDFLAGS="$LDFLAGS"
+ # Older GNU ld supports --export-dynamic but --dynamic-list it does not.
+ RDYNAMIC="-Wl,--dynamic-list=${srcdir}/proc-service.list"
+ LDFLAGS="$LDFLAGS $RDYNAMIC"
+ AC_TRY_LINK([], [],
+ [found="-Wl,--dynamic-list"
+ RDYNAMIC='-Wl,--dynamic-list=$(srcdir)/proc-service.list'],
+ [RDYNAMIC="-rdynamic"
+ LDFLAGS="$old_LDFLAGS $RDYNAMIC"
+ AC_TRY_LINK([], [],
+ [found="-rdynamic"],
+ [found="no"
+ # Error on its usage by .mh file.
+ RDYNAMIC="no-rdynamic-available"])])
+ AC_SUBST(RDYNAMIC)
+ LDFLAGS="$old_LDFLAGS"
+ AC_MSG_RESULT($found)
+ fi
+
case ${host_os} in
hpux*)
AC_MSG_CHECKING(for HPUX/OSF thread support)
@@ -1480,19 +1504,7 @@ if test ${build} = ${host} -a ${host} = ${target} ; then
CONFIG_OBS="${CONFIG_OBS} sol-thread.o"
CONFIG_SRCS="${CONFIG_SRCS} sol-thread.c"
AC_CHECK_LIB(dl, dlopen)
- if test "$GCC" = "yes" ; then
- # The GNU linker requires the -export-dynamic option to make
- # all symbols visible in the dynamic symbol table.
- hold_ldflags=$LDFLAGS
- AC_MSG_CHECKING(for the ld -export-dynamic flag)
- LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
- AC_TRY_LINK(, [int i;], found=yes, found=no)
- LDFLAGS=$hold_ldflags
- AC_MSG_RESULT($found)
- if test $found = yes; then
- CONFIG_LDFLAGS="${CONFIG_LDFLAGS} -Wl,-export-dynamic"
- fi
- fi
+ CONFIG_LDFLAGS="${CONFIG_LDFLAGS} $RDYNAMIC"
# Sun randomly tweaked the prototypes in <proc_service.h>
# at one point.
AC_MSG_CHECKING(if <proc_service.h> is old)