problem building 2.1 on Solaris 2.6

j_bence at yahoo.com j_bence at yahoo.com
Fri Apr 20 14:37:53 EDT 2001


Hi:
    The build process for 2.1 dies on the Makefile's 'sharedmods' 
target.  As best as I can tell, the value of the CCSHARED Makefile 
variable is not being propagated into Lib/distutils/unixccompiler.py.

Excerpt from the make:
    ranlib libpython2.1.a
    gcc -lpthread  -o python \
                Modules/python.o \
                libpython2.1.a -lpthread -lsocket -lnsl -ldl \
                -lthread -lm
PYTHONPATH= ./python ./setup.py build

   (for ease of reading, define
        TRRAS = "Text relocation remains against symbol")

TRRAS       offset  reference in file
StructError 0x3358  build/temp.solaris-2.6-sun4u-2.1/structmodule.o
   ... many similar messages for all other modules deleted ...


Hunting around in the python source, I found DISTUTILS_DEBUG and gave 
it a value.  Rerunning everything produced the same problem but did 
display the gcc command lines used to build the .o files for the 
shared modules.  Example:

gcc -I. -I/path/to/src/Python-2.1/./Include -I/usr/local/include
    -IInclude/ -c /path/to/src/Python-2.1/Modules/structmodule.c
    -o build/temp.solaris-2.6-sun4u-2.1/structmodule.o -g -O2 -Wall
    -Wstrict-prototypes -I. -I./Include -DHAVE_CONFIG_H
gcc -shared build/temp.solaris-2.6-sun4u-2.1/structmodule.o
    -L/usr/local/lib -o build/lib.solaris-2.6-sun4u-2.1/struct.so

It's the second gcc command that generates the error message above.

The flag -fPIC is missing on the first gcc, but it is in the Makefile:
    CCSHARED = -fPIC

If I run the first gcc command manually with -fPIC included, the 
second gcc command works and the module builds OK.

I put some print statements in some of the distutils scripts, and I 
found that the value of CCSHARED is pulled out of the Makefile, but I 
was not able to quickly follow where it goes after that.

This is my first attempt at building/using python.  I just finished 
installing Perl 5.6.0 on this machine, and it went well.  Can someone 
suggest what I might be doing wrong?  I have tried starting over from 
scratch several times -- the build of python itself goes OK.  I can 
start it up, and run some simple commands.  I'd like to get some of 
the other modules up and running.

thanks,
James 





More information about the Python-list mailing list