[Python-bugs-list] [ python-Bugs-749911 ] --enable-shared fails on Solaris 9 with gcc-3.2.3

SourceForge.net noreply@sourceforge.net
Sat, 14 Jun 2003 08:47:01 -0700


Bugs item #749911, was opened at 2003-06-06 03:21
Message generated for change (Comment added) made by loewis
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=749911&group_id=5470

Category: Build
Group: Platform-specific
Status: Closed
Resolution: Fixed
Priority: 5
Submitted By: Dave Reed (dr2048)
Assigned to: Martin v. Löwis (loewis)
Summary: --enable-shared fails on Solaris 9 with gcc-3.2.3

Initial Comment:
./confgiure --enable-shared
make
fails on Solaris 9 with gcc 3.2.3

        gcc -shared -o libpython2.3.so
Modules/getbuildinfo.o
        Parser/acceler.o Parser/grammar1.o
Parser/listnode.o
        Parser/node.o Parser/parser.o Parser/parsetok.o
        Parser/bitset.o Parser/metagrammar.o
Parser/firstsets.o
        Parser/grammar.o Parser/pgen.o Parser/myreadline.o
        Parser/tokenizer.o Objects/abstract.o
Objects/boolobject.o
        Objects/bufferobject.o Objects/cellobject.o
        Objects/classobject.o Objects/cobject.o
        Objects/complexobject.o Objects/descrobject.o
        Objects/enumobject.o Objects/fileobject.o
        Objects/floatobject.o Objects/frameobject.o
        Objects/funcobject.o Objects/intobject.o
Objects/iterobject.o
        Objects/listobject.o Objects/longobject.o
Objects/dictobject.o
        Objects/methodobject.o Objects/moduleobject.o
Objects/object.o
        Objects/obmalloc.o Objects/rangeobject.o
Objects/sliceobject.o
        Objects/stringobject.o Objects/structseq.o
        Objects/tupleobject.o Objects/typeobject.o
        Objects/weakrefobject.o Objects/unicodeobject.o
        Objects/unicodectype.o Python/bltinmodule.o
        Python/exceptions.o Python/ceval.o Python/compile.o
        Python/codecs.o Python/errors.o Python/frozen.o
        Python/frozenmain.o Python/future.o
Python/getargs.o
        Python/getcompiler.o Python/getcopyright.o
Python/getmtime.o
        Python/getplatform.o Python/getversion.o
Python/graminit.o
        Python/import.o Python/importdl.o Python/marshal.o
        Python/modsupport.o Python/mystrtoul.o
Python/mysnprintf.o
        Python/pyfpe.o Python/pystate.o Python/pythonrun.o
        Python/structmember.o Python/symtable.o
Python/sysmodule.o
        Python/traceback.o Python/getopt.o
Python/dynload_shlib.o
        Python/thread.o Modules/config.o Modules/getpath.o
        Modules/main.o Modules/gcmodule.o 
Modules/threadmodule.o
        Modules/signalmodule.o  Modules/posixmodule.o
        Modules/errnomodule.o  Modules/_sre.o 
Modules/_codecsmodule.o
        Modules/zipimport.o  Modules/symtablemodule.o
        Modules/xxsubtype.o -lsocket -lnsl -lrt -ldl 
-lpthread  -lm;
        \
fi
ld: warning: option -o appears more than once, first
setting taken
ln: libpython2.3.so and libpython2.3.so are identical
make: *** [libpython2.3.so] Error 2

running make again produces:
c++   -o python \
                Modules/python.o \
               
-Wl,-rpath,/home/faculty/dreed/pub/Python-2.3/lib
        -L. -lpython2.3 -lsocket -lnsl -lrt -ldl 
-lpthread   -lm
ld: fatal: option -dn and -P are incompatible
ld: fatal: Flags processing errors
collect2: ld returned 1 exit status
make: *** [python] Error 1


----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2003-06-14 17:47

Message:
Logged In: YES 
user_id=21627

You'll lose your bet :-)

The problem is not that readline is compiled with gcc, but
that it is in a location where ld.so.1 does not look. You can
a) set LD_RUN_PATH
b) set LD_LIBRARY_PATH
c) add more -R options to the linker
d) build readline statically, and link the readline module
statically through Modules/Setup.

See ld.so.1(1)

----------------------------------------------------------------------

Comment By: Dave Reed (dr2048)
Date: 2003-06-14 17:36

Message:
Logged In: YES 
user_id=795169

I don't have root access on this machine so I won't try the
crle command.

I just installed gcc 3.2 and am trying to get Python and
Postgresql compiled with it. readline is compiled with gcc
2.95 so I'll bet that's the problem. I'll recompile readline
or edit Modules/Setup or see if there's a configure option
to disable readline.

Thanks for all your help.

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2003-06-14 17:21

Message:
Logged In: YES 
user_id=21627

I use gcc 3.2.2. I don't see the problem with -rpath as I
use GNU ld, not /usr/ccs/bin/ld. I don't see the problem
with rl_complete because I don't have readline. To fix this
problem, invoke 

crle -u -l <directory where libreadline.so is located>

DO READ THE MAN PAGE OF crle BEFORE INVOKING THIS COMMAND.

I have committed the change from -rpath to -R as

configure 1.406
configure.in 1.417

Closing this report as fixed.

----------------------------------------------------------------------

Comment By: Dave Reed (dr2048)
Date: 2003-06-14 16:16

Message:
Logged In: YES 
user_id=795169

The makefile patch and changing -rpath to -R got it to
compile, but
when I try to execute python I get:

python
ld.so.1: python: fatal: relocation error: file
./libpython2.3.so: symbol rl_complete: referenced symbol not
found
Killed

what version of gcc are you using to compile it on Solaris 9?

----------------------------------------------------------------------

Comment By: Dave Reed (dr2048)
Date: 2003-06-14 15:39

Message:
Logged In: YES 
user_id=795169

I found the rpath line in the Makefile and replaced it with -R
I can't seem to find the ld line in the Makefile.

I noticed that I actually did get a libpython2.3.so file
created even though
I got the errors, but I couldn't complete a make install
because of the errors

I'm trying again now with the -R line.

If you want to contact me via email at "dreed at
capital.edu", it might
be easier to work through these problems using email or IM
at some time
that we're both available. Thanks!

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2003-06-14 15:14

Message:
Logged In: YES 
user_id=21627

Committed as Makefile.pre.in 1.131.

Can you please add -v to the linker line, and report how the
linker is being invoked?

Can you also try to replace -rpath with -R?

This very line works fine on my copy of Solaris 9, so I'm
uncertain what the problem is.

----------------------------------------------------------------------

Comment By: Dave Reed (dr2048)
Date: 2003-06-14 14:25

Message:
Logged In: YES 
user_id=795169

That gets past the first problem. Now during the initial
compile, I get:

c++   -o python \
                Modules/python.o \
               
-Wl,-rpath,/home/faculty/dreed/pub/Python-2.3/lib -L.
-lpython2.3 -lsocket -lnsl -lrt -ldl  -lpthread   -lm  
ld: fatal: option -dn and -P are incompatible
ld: fatal: Flags processing errors
collect2: ld returned 1 exit status
make: *** [python] Error 1


I can't find those flags in the Makefile to try removing one
of them.

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2003-06-14 08:36

Message:
Logged In: YES 
user_id=21627

Please try the attached patch and report whether this solves
the problem.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=749911&group_id=5470