Python 2.2.1 on Solaris 2.5.1: compilation problem

David Meleedy david.meleedy at analog.com
Wed Apr 17 02:27:51 EDT 2002


I also am having problems getting python compiled on Solaris 2.5.1.  I
am
seeing the same problem (kind of).  I am using gcc 2.95.3, and I am
using
/usr/ccs/bin/ld because gcc -shared did not work for any version of
Solaris (using gnu binutils) to build the shared object modules for
python.


If I do a configure with
--with-threads=no, then I get:

building 'struct' extension
creating build
creating build/temp.solaris-2.5.1-sun4u-2.2
gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I.
-I/cpd/src/misc/python/2.2.1/./Include -I/usr/local/include -IInclude/
-c /cpd/src/misc/python/2.2.1/Modules/structmodule.c -o
build/temp.solaris-2.5.1-sun4u-2.2/structmodule.o -DNDEBUG -g -O3
-Wall -Wstrict-prototypes
creating build/lib.solaris-2.5.1-sun4u-2.2
ld -G build/temp.solaris-2.5.1-sun4u-2.2/structmodule.o
-L/usr/local/lib -o build/lib.solaris-2.5.1-sun4u-2.2/struct.so
Segmentation Fault
gmake: *** [sharedmods] Error 139

If I build with threads, putting in the hack to
Python/thread_pthreads.h
#if defined(__APPLE__) || defined(sun)
#define destructor xxdestructor
#endif

or

#if defined(__APPLE__) || defined(sun)
#define destructor xxdestructor
#endif
#include <pthread.h>
#if defined(__APPLE__) || defined(sun)
#undef destructor
#endif

Then when I try to compile, I get a bit further, and then things get
fouled
up again:

building 'time' extension
gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I.
-I/cpd/src/misc/python/2.2.1/./Include -I/usr/local/include -IInclude/
-c /cpd/src/misc/python/2.2.1/Modules/timemodule.c -o
build/temp.solaris-2.5.1-sun4u-2.2/timemodule.o -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes
ld -G build/temp.solaris-2.5.1-sun4u-2.2/timemodule.o -L/usr/local/lib
-lm -o build/lib.solaris-2.5.1-sun4u-2.2/time.so
Segmentation Fault
gmake: *** [sharedmods] Error 139


If I then modify setup.py to not compile the time extension, but to
move
along, then other modules get the seg fault later on too.

What I discovered doing this, is that I could get some of the later
modules to work that were previously failing, if I commented out
some of the eariler modules in the setup.py file.  So perhaps lines
like:

exts.append( Extension('xreadlines', ['xreadlinesmodule.c']) )

is causing a memory problem if too many are added?

However I never was able to get time.so to work, so there probably is
a thread
problem in that file.

I hope this helps a bit.

-Dave



More information about the Python-list mailing list