diff options
author | Paul Pluzhnikov <ppluzhnikov@google.com> | 2018-05-04 10:07:58 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@ericsson.com> | 2018-05-04 10:08:09 -0400 |
commit | bf27f0e2c76839af8524e053cca271934150a90c (patch) | |
tree | fae5cc97580cdf5b61489be7610f0124187c342e /gdb/configure.ac | |
parent | 089a949083dcd5c679376033e975d54093007408 (diff) | |
download | binutils-gdb-bf27f0e2c76839af8524e053cca271934150a90c.tar.gz |
configure uses incorrect link order when testing libpython
References:
https://stackoverflow.com/a/49868387
https://sourceware.org/bugzilla/show_bug.cgi?id=11420
Configure uses "gcc -o conftest -g ... conftest.c -ldl -lncurses -lm -ldl
... -lpthread ... -lpython2.7" when deciding whether give libpython is
usable.
That of course is the wrong link order, and only works for shared libraries
(mostly by accident), and only on some systems.
gdb/ChangeLog:
PR gdb/11420
* configure.ac: Prepend libpython.
* python/python-config.py: Likewise.
* configure: Regenerate.
Diffstat (limited to 'gdb/configure.ac')
-rw-r--r-- | gdb/configure.ac | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gdb/configure.ac b/gdb/configure.ac index 698fc7b8345..e1f630cd388 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -732,7 +732,7 @@ AC_DEFUN([AC_TRY_LIBPYTHON], save_CPPFLAGS=$CPPFLAGS save_LIBS=$LIBS CPPFLAGS="$CPPFLAGS $new_CPPFLAGS" - LIBS="$LIBS $new_LIBS" + LIBS="$new_LIBS $LIBS" found_usable_python=no AC_LINK_IFELSE(AC_LANG_PROGRAM([[#include "Python.h"]], [[Py_Initialize ();]]), @@ -922,19 +922,19 @@ else elif test "${have_python_config}" != failed; then if test "${have_libpython}" = no; then AC_TRY_LIBPYTHON(python2.7, have_libpython, - ${python_includes}, "${python_libs} -lpython2.7") + ${python_includes}, "-lpython2.7 ${python_libs}") fi if test "${have_libpython}" = no; then AC_TRY_LIBPYTHON(python2.6, have_libpython, - ${python_includes}, "${python_libs} -lpython2.6") + ${python_includes}, "-lpython2.6 ${python_libs}") fi if test ${have_libpython} = no; then AC_TRY_LIBPYTHON(python2.5, have_libpython, - ${python_includes}, "${python_libs} -lpython2.5") + ${python_includes}, "-lpython2.5 ${python_libs}") fi if test ${have_libpython} = no; then AC_TRY_LIBPYTHON(python2.4, have_libpython, - ${python_includes}, "${python_libs} -lpython2.4") + ${python_includes}, "-lpython2.4 ${python_libs}") fi fi if test "${have_libpython}" = python2.7 -o "${have_libpython}" = python27; then |