This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: --enable-shared fails on Solaris 9 with gcc-3.2.3
Type: Stage:
Components: Build Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: loewis Nosy List: dr2048, loewis
Priority: normal Keywords:

Created on 2003-06-06 01:21 by dr2048, last changed 2022-04-10 16:09 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
makefile.diff loewis, 2003-06-14 06:36
Messages (9)
msg16268 - (view) Author: Dave Reed (dr2048) Date: 2003-06-06 01:21
./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
msg16269 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2003-06-14 06:36
Logged In: YES 
user_id=21627

Please try the attached patch and report whether this solves
the problem.
msg16270 - (view) Author: Dave Reed (dr2048) Date: 2003-06-14 12:25
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.
msg16271 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2003-06-14 13:14
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.
msg16272 - (view) Author: Dave Reed (dr2048) Date: 2003-06-14 13:39
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!
msg16273 - (view) Author: Dave Reed (dr2048) Date: 2003-06-14 14:16
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?
msg16274 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2003-06-14 15:21
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.
msg16275 - (view) Author: Dave Reed (dr2048) Date: 2003-06-14 15:36
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.
msg16276 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2003-06-14 15:47
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)
History
Date User Action Args
2022-04-10 16:09:03adminsetgithub: 38599
2003-06-06 01:21:53dr2048create