Message252454
I encountered this issue when compiling gdb against my own build of Python 2.7 in a non-standard location. gdb could not locate libpython2.7.so.
The solution is to configure Python with LINKFORSHARED variable which contains additional linker flags required to link against libpython2.7.so. Here are the relevant bits (in Makefile syntax):
prefix := /opt/toolchain
python_version := 2.7.10
PREFIX := ${prefix}/python-${python_version}
CPPFLAGS := -fmessage-length=0
LINKFORSHARED := -L${PREFIX}/lib64 -Wl,-rpath=${PREFIX}/lib64
./configure --prefix=${PREFIX} --libdir=${PREFIX}/lib64 --enable-shared --enable-unicode=ucs4 CPPFLAGS="${cppflags}" LDFLAGS="${LDFLAGS}" LINKFORSHARED="${LINKFORSHARED}"
After Python is built and installed verify the flags:
$ /opt/toolchain/python-2.7.10/bin/python-config --ldflags
-lpython2.7 -lpthread -ldl -lutil -lm -L/opt/toolchain/python-2.7.10/lib64 -Wl,-rpath=/opt/toolchain/python-2.7.10/lib64 |
|
Date |
User |
Action |
Args |
2015-10-07 08:02:52 | max0x7ba | set | recipients:
+ max0x7ba, loewis, doko, vstinner, tarek, eric.araujo, Arfrever, mauger, brobecke, koobs |
2015-10-07 08:02:52 | max0x7ba | set | messageid: <1444204972.09.0.297149213666.issue7352@psf.upfronthosting.co.za> |
2015-10-07 08:02:52 | max0x7ba | link | issue7352 messages |
2015-10-07 08:02:51 | max0x7ba | create | |
|