aboutsummaryrefslogtreecommitdiff
path: root/gdb/configure.ac
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2010-05-28 18:50:35 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2010-05-28 18:50:35 +0000
commitf6528abd6444820594f6d2147b9aa7f312539411 (patch)
tree890cfc2dc2f2c27bc2db842ded441f000c7aed42 /gdb/configure.ac
parent096554ab8e066968273156f38761b44b57cea151 (diff)
downloadgdb-f6528abd6444820594f6d2147b9aa7f312539411.zip
gdb-f6528abd6444820594f6d2147b9aa7f312539411.tar.gz
gdb-f6528abd6444820594f6d2147b9aa7f312539411.tar.bz2
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 70608af..16789b9 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)