Building python 2.1 on Solaris 7 with gcc

tflagg2001 at tflagg2001 at
Tue Jun 26 16:54:05 EDT 2001

I'm having the same problem a number of people had which seem
to relate to the -shared/-fPIC/-G flags.  I'm trying to build
the Python-2.1 version on Solaris 7 on SPARC with gcc 2.95.3.

Everything is fine until:
        PYTHONPATH= ./python ./ build
        running build
        running build_ext
        building 'struct' extension
        creating build
        creating build/temp.solaris-2.7-sun4m-2.1
        gcc -I. -I/export/Python-2.1/./Include -I/usr/local/include -IInclude/
-c /export/Python-2.1/Modules/structmodule.c -o
        creating build/lib.solaris-2.7-sun4m-2.1
        gcc -shared build/temp.solaris-2.7-sun4m-2.1/structmodule.o
-L/usr/local/lib -o build/lib.solaris-2.7-sun4m-2.1/
        Text relocation remains                     referenced
            against symbol          offset  in file
        <unknown>                           0x2098     
        <unknown>                           0x20ac     
        ld: fatal: relocations remain against allocatable but non-writable
        collect2: ld returned 1 exit status
        WARNING: building of extension "struct" failed: command 'gcc' failed
with exit
        status 1
        building 'regex' extension
        [same errors for regex, and lots of others from here on...]

The file DOES have this:
   633  if test -z "$CCSHARED"
   634  then
   635      case $ac_sys_system/$ac_sys_release in
   636      SunOS*) if test "$GCC" = yes;
   637              then CCSHARED="-fPIC";
   638              fi;;

However, the "-fPIC" doesn't seem to propagate up to the "gcc"
command.  I've tried various other things, including adding -fPIC
into the python distutils, or adding '-G', with various other problems...

This has happened on 2 different SPARC Solaris 7 systems.

Any help would be appreciated!


More information about the Python-list mailing list