Building python 2.4.2 on linux with static pthreads

Samuel M. Smith smithsm at
Thu Nov 3 18:37:07 CET 2005

I can build python 2.4.2 from source on the embedded linux box when I  
nfs mount and boot a full debian distribution.
The embedded box also has stripped down linux distribution in onboard  
My goal is to run python from the stripped down linux in onboard flash.

I can successfully install python to the onboard flash when booted to  
the nfs version by using
make install with $DESTDIR set to the onboard flash mounted directory

I then reboot to the onboard flash and can run python from there.
This works if I build python without threading support because the  
onboard flash does not include the library
I need threading support for sockets etc.

I believe that if I can build python with pthread linked statically  
then I should be able to run python when booted from the onboard  
flash without problem.

Problem is I am clueless about how to do this. The setup and  
files only deal with building modules static
or shared where as threading is build into the python interpreter it  
seems not as a module.

I read the readme in the source distribution but can't find any  
configure options that will let me build
python with static linking of the pthread library. I have searched  
google and find vague references to doing something
like that. I don't understand the makefile well enough to know how to  
do it there.

So does anyone understand how include threading support statically?
What I have to modify to do it?

When I tried to run python with shared threading support while booted  
from the onboard flash  it got the following error

./python: error while loading shared libraries:  
cannot open shared object
file: No such file or directory

I naively copied the pthread library from the nfs version to the  
onboard flash version and rebooted and
ran python. This time I got the following error

/usr/local/bin/python: relocation error: /lib/ symbol  
__libc_sigaction, ve
rsion GLIBC_2.2 not defined in file with link time reference

so apparently I can't just copy shared libraries around.

An alternative solution would be to correctly copy the shared library?
Any help comments would be appreciated


Samuel M. Smith Ph.D.
2966 Fort Hill Road
Eagle Mountain, Utah 84043
801-768-2768 voice
801-768-2769 fax
"The greatest source of failure and unhappiness in the world is
giving up what we want most for what we want at the moment"

More information about the Python-list mailing list