aboutsummaryrefslogtreecommitdiff
path: root/gdb/configure.ac
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2010-06-08 16:41:45 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2010-06-08 16:41:45 +0000
commit3bebe2f205d1c30429898da05047b656e6796f6a (patch)
tree52f7a41bc1daebece577a1496a111359cb90f102 /gdb/configure.ac
parent7da73d69b0c630cf527454e23431747010746393 (diff)
downloadgdb-3bebe2f205d1c30429898da05047b656e6796f6a.zip
gdb-3bebe2f205d1c30429898da05047b656e6796f6a.tar.gz
gdb-3bebe2f205d1c30429898da05047b656e6796f6a.tar.bz2
gdb/
* configure.ac <"${have_libpython}" != no>: New workaround of python#4434. * configure: Regenerate. gdb/testsuite/ * gdb.python/python.exp (pythonX.Y/lib-dynload/*.so): New.
Diffstat (limited to 'gdb/configure.ac')
-rw-r--r--gdb/configure.ac43
1 files changed, 33 insertions, 10 deletions
diff --git a/gdb/configure.ac b/gdb/configure.ac
index d65fd49..6d140cb 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -1470,16 +1470,39 @@ if test ${build} = ${host} -a ${host} = ${target} ; then
# 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"])])
+ 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)