[Freeswitch-users] Build problem with mod_python CentOS 5.5 Python 2.7

John O'Brien john at whitesmiths.com
Mon Aug 29 06:49:19 MSD 2011


Hi,

I am trying to install mod_python on CentOS 5.5 x86_64.

Have downloaded the source of Python 2.7.2 built and installed it

# cd Python-2.7.2
# ./configure
# make
# make install

All good!!!

Have downloaded source of FreeSWITCH 1.0.6.
Edited /usr/local/src/freeswitch/modules.conf to enable mod_python

# cd /usr/local/src/freeswitch/
# ./configure
# make

Creating mod_python.so...
/usr/bin/ld: /usr/local/lib/libpython2.7.a(abstract.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libpython2.7.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
g++ -I/usr/local/include/python2.7 -I/usr/local/include/python2.7 -fPIC -fno-strict-aliasing -m64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/src/freeswitch/src/include -I/usr/local/src/freeswitch/src/include -I/usr/local/src/freeswitch/libs/libteletone/src -fPIC -fvisibility=hidden -DSWITCH_API_VISIBILITY=1 -DHAVE_VISIBILITY=1 -g -O2 -D_GNU_SOURCE -shared -o .libs/mod_python.so -shared -Wl,-x .libs/mod_python.o -m64 freeswitch_python.o mod_python_wrap.o  /usr/local/src/freeswitch/.libs/libfreeswitch.so -L/usr/local/src/freeswitch/libs/apr-util/xml/expat/lib -lpq /usr/local/src/freeswitch/libs/apr-util/xml/expat/lib/.libs/libexpat.a /usr/local/src/freeswitch/libs/apr/.libs/libapr-1.a -luuid -lrt -lcrypt -L/usr/local/src/freeswitch/libs/srtp -L/usr/kerberos/lib64 -lssl -lcrypto -lz -lncurses -L/usr/local/lib -lpthread -ldl -lutil -lm -lpython2.7   -Wl,--rpath -Wl,/usr/local/freeswitch/lib -Wl,--rpath -Wl,/usr/local/freeswitch/mod
make[1]: *** [mod_python.so] Error 1
make: *** [all] Error 1

The problem appears to be the python library libpython2.7.a was not been built with PIC flag.

Have tried various incantations to build a compatible Python library without success.

Does anyone know how to get mod_python to work with Python 2.7?

Regards,

John



Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list