From 38f6b338fd42e2c16c7e53eed49a80b10ac3692f Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Wed, 23 Jun 2010 10:12:14 +0000 Subject: [PATCH] gdb/ * configure.ac: Always set RDYNAMIC at least as `-rdynamic'. * configure: Regenerate. --- gdb/ChangeLog | 5 +++ gdb/configure | 90 ++++++++++++++++++------------------------------ gdb/configure.ac | 83 ++++++++++++++++++++------------------------ 3 files changed, 77 insertions(+), 101 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1591aa621c2..340e151a74f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2010-06-23 Jan Kratochvil + + * configure.ac: Always set RDYNAMIC at least as `-rdynamic'. + * configure: Regenerate. + 2010-06-22 Hui Zhu * i386-tdep.c (i386_record_lea_modrm): Change warning to query. diff --git a/gdb/configure b/gdb/configure index 7f9c51ad9e1..f557aa1f217 100755 --- a/gdb/configure +++ b/gdb/configure @@ -14186,20 +14186,19 @@ $as_echo "$gdb_cv_bigtoc" >&6; } ;; esac -if test "${gdb_native}" = yes; 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. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the dynamic export flag" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the dynamic export flag" >&5 $as_echo_n "checking for the dynamic export flag... " >&6; } - 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" - dynamic_list=false - if test "${have_libpython}" = no; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +dynamic_list=false +if test "${gdb_native}" = 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. + 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" + if test "${have_libpython}" = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -14215,14 +14214,14 @@ if ac_fn_c_try_link "$LINENO"; then : fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - else - # Workaround http://bugs.python.org/issue4434 where static - # libpythonX.Y.a would get its symbols required for - # pythonX.Y/lib-dynload/*.so modules hidden by -Wl,--dynamic-list. - # Problem does not happen for the recommended libpythonX.Y.so linkage. - old_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $PYTHON_CFLAGS" - if test "$cross_compiling" = yes; then : + else + # Workaround http://bugs.python.org/issue4434 where static + # libpythonX.Y.a would get its symbols required for + # pythonX.Y/lib-dynload/*.so modules hidden by -Wl,--dynamic-list. + # Problem does not happen for the recommended libpythonX.Y.so linkage. + old_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PYTHON_CFLAGS" + if test "$cross_compiling" = yes; then : true else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -14232,10 +14231,10 @@ int main () { int err; - Py_Initialize (); - err = PyRun_SimpleString ("import itertools\n"); - Py_Finalize (); - return err == 0 ? 0 : 1; + Py_Initialize (); + err = PyRun_SimpleString ("import itertools\n"); + Py_Finalize (); + return err == 0 ? 0 : 1; ; return 0; } @@ -14247,41 +14246,20 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi - CFLAGS="$old_CFLAGS" - fi - if $dynamic_list;then - found="-Wl,--dynamic-list" - RDYNAMIC='-Wl,--dynamic-list=$(srcdir)/proc-service.list' - else - RDYNAMIC="-rdynamic" - LDFLAGS="$old_LDFLAGS $RDYNAMIC" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - found="-rdynamic" + CFLAGS="$old_CFLAGS" + fi + LDFLAGS="$old_LDFLAGS" +fi +if $dynamic_list; then + found="-Wl,--dynamic-list" + RDYNAMIC='-Wl,--dynamic-list=$(srcdir)/proc-service.list' else - found="no" - # Error on its usage by .mh file. - RDYNAMIC="no-rdynamic-available" + found="-rdynamic" + RDYNAMIC="-rdynamic" fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - fi - LDFLAGS="$old_LDFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $found" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $found" >&5 $as_echo "$found" >&6; } - fi -fi if test ${build} = ${host} -a ${host} = ${target} ; then diff --git a/gdb/configure.ac b/gdb/configure.ac index aeac06001db..7ddb67fa0d7 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -1453,54 +1453,47 @@ aix*) ;; esac +AC_MSG_CHECKING(for the dynamic export flag) +dynamic_list=false if test "${gdb_native}" = yes; 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" - dynamic_list=false - if test "${have_libpython}" = no; then - AC_TRY_LINK([], [], [dynamic_list=true]) - else - # Workaround http://bugs.python.org/issue4434 where static - # libpythonX.Y.a would get its symbols required for - # pythonX.Y/lib-dynload/*.so modules hidden by -Wl,--dynamic-list. - # Problem does not happen for the recommended libpythonX.Y.so linkage. - old_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $PYTHON_CFLAGS" - AC_RUN_IFELSE( - AC_LANG_PROGRAM( - [#include "]${have_libpython}[/Python.h"], - [int err; - Py_Initialize (); - err = PyRun_SimpleString ("import itertools\n"); - Py_Finalize (); - return err == 0 ? 0 : 1;]), - [dynamic_list=true], [], [true]) - CFLAGS="$old_CFLAGS" - fi - if $dynamic_list;then - found="-Wl,--dynamic-list" - RDYNAMIC='-Wl,--dynamic-list=$(srcdir)/proc-service.list' - else - RDYNAMIC="-rdynamic" - LDFLAGS="$old_LDFLAGS $RDYNAMIC" - AC_TRY_LINK([], [], - [found="-rdynamic"], - [found="no" - # Error on its usage by .mh file. - RDYNAMIC="no-rdynamic-available"]) - fi - AC_SUBST(RDYNAMIC) - LDFLAGS="$old_LDFLAGS" - AC_MSG_RESULT($found) + # 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. + 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" + if test "${have_libpython}" = no; then + AC_TRY_LINK([], [], [dynamic_list=true]) + else + # Workaround http://bugs.python.org/issue4434 where static + # libpythonX.Y.a would get its symbols required for + # pythonX.Y/lib-dynload/*.so modules hidden by -Wl,--dynamic-list. + # Problem does not happen for the recommended libpythonX.Y.so linkage. + old_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PYTHON_CFLAGS" + AC_RUN_IFELSE( + AC_LANG_PROGRAM( + [#include "]${have_libpython}[/Python.h"], + [int err; + Py_Initialize (); + err = PyRun_SimpleString ("import itertools\n"); + Py_Finalize (); + return err == 0 ? 0 : 1;]), + [dynamic_list=true], [], [true]) + CFLAGS="$old_CFLAGS" fi + LDFLAGS="$old_LDFLAGS" +fi +if $dynamic_list; then + found="-Wl,--dynamic-list" + RDYNAMIC='-Wl,--dynamic-list=$(srcdir)/proc-service.list' +else + found="-rdynamic" + RDYNAMIC="-rdynamic" fi +AC_SUBST(RDYNAMIC) +AC_MSG_RESULT($found) dnl For certain native configurations, we need to check whether thread dnl support can be built in or not. -- 2.30.2