From bf27f0e2c76839af8524e053cca271934150a90c Mon Sep 17 00:00:00 2001 From: Paul Pluzhnikov Date: Fri, 4 May 2018 10:07:58 -0400 Subject: 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. --- gdb/python/python-config.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'gdb/python/python-config.py') diff --git a/gdb/python/python-config.py b/gdb/python/python-config.py index c2b2969..3e60b86 100644 --- a/gdb/python/python-config.py +++ b/gdb/python/python-config.py @@ -58,12 +58,11 @@ for opt in opt_flags: print (to_unix_path(' '.join(flags))) elif opt in ('--libs', '--ldflags'): - libs = [] + libs = ['-lpython' + pyver + abiflags] if getvar('LIBS') is not None: libs.extend(getvar('LIBS').split()) if getvar('SYSLIBS') is not None: libs.extend(getvar('SYSLIBS').split()) - libs.append('-lpython'+pyver + abiflags) # add the prefix/lib/pythonX.Y/config dir, but only if there is no # shared library in prefix/lib/. if opt == '--ldflags': -- cgit v1.1