linking extension modules w/ "ld" on Solaris - to be expected?

yaipa yaipa at aol.com
Thu Sep 19 13:01:23 EDT 2002


Skip Montanaro <skip at pobox.com> wrote in message news:<mailman.1032393445.324.python-list at python.org>...
> On a Solaris machine I configured Python (2.1.3 at the moment, but 2.2.1 is
> in the wings) using:
> 
>     ./configure --with-gcc=mycc --with-cxx=mycc
> 
> where "mycc" is a shell script which decides whether or not to invoke Sun's
> C or C++ compiler.  Some (but not all) 3rd party extension modules need to
> be compiled with C++, but I don't want to force all to be C++-compiled.
> (Gcc is not an option here.)
> 
> I noticed in the configure output that LDSHARED got set to "ld -G".  Is this
> typical for Solaris when building with a non-gcc compiler?

Skip,

I've tried compiling both Python 2.1.1 and 2.2.x on Solaris 8 and 9
with gcc 2.9x and 3.x in my path. I consistently get the same build
error each time, so it is likely that there is some *switch* I am not
setting somewhere.  When trying to compile Python I simply run
configure/make as 'root' without modification.  Configure runs without
error, but the build dies part way through claiming several 'function
declaration isn't a prototype'.

Is there a site which covers building Python in a Solaris environment
or maybe you could post a few pointers?

configure 'head'
----------------------
creating cache ./config.cache
checking MACHDEP... sunos5
checking for --without-gcc... no
checking for --with-cxx=<compiler>... no
checking for c++... c++
checking whether the C++ compiler (c++  ) works... yes
checking whether the C++ compiler (c++  ) is a cross-compiler... yes
checking for gcc... gcc
checking whether the C compiler (gcc  ) works... yes
checking whether the C compiler (gcc  ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking how to run the C preprocessor... gcc -E
checking for AIX... no
checking for minix/config.h... no
checking for Cygwin environment... no
checking for mingw32 environment... no
checking for executable suffix... no
checking for --with-suffix... 
checking for case-insensitive build directory... no
checking LIBRARY... libpython$(VERSION).a
checking LINKCC... $(PURIFY) $(CC)
checking LDLIBRARY... libpython$(VERSION).a
checking for ranlib... :
checking for ar... no
checking for aal... no
checking for a BSD compatible install... /opt/sfw/bin/ginstall -c
checking for --with-pydebug... no
checking whether gcc accepts -OPT:Olimit=0... no
checking whether gcc accepts -Olimit 1500... no
checking whether pthreads are available without options... no
checking whether gcc accepts -Kpthread... no

make trace follows
------------------
....
# first sign of error in the make.

gcc -c -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I./Include
-DHAVE_CONFIG_H  -o Python/pythonrun.o Python/pythonrun.c
Python/pythonrun.c: In function `initsigs':
Python/pythonrun.c:1348: warning: function declaration isn't a
prototype
Python/pythonrun.c: In function `PyOS_getsig':
Python/pythonrun.c:1448: warning: function declaration isn't a
prototype
Python/pythonrun.c: In function `PyOS_setsig':
Python/pythonrun.c:1470: warning: function declaration isn't a
prototype
gcc -c -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I./Include
-DHAVE_CONFIG_H  -o Python/structmember.o Python/structmember.c
gcc -c -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I./Include
-DHAVE_CONFIG_H  -o Python/symtable.o Python/symtable.c
gcc -c -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I./Include
-DHAVE_CONFIG_H  -o Python/sysmodule.o Python/sysmodule.c
gcc -c -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I./Include
-DHAVE_CONFIG_H  -o Python/traceback.o Python/traceback.c
gcc -c -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I./Include
-DHAVE_CONFIG_H  -o Python/getopt.o Python/getopt.c
gcc -c -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I./Include
-DHAVE_CONFIG_H  -o Python/dynload_shlib.o Python/dynload_shlib.c
gcc -c -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I./Include
-DHAVE_CONFIG_H  -o Python/thread.o Python/thread.c
gcc -c -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I./Include
-DHAVE_CONFIG_H  -o Modules/config.o Modules/config.c
gcc -c -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I./Include
-DHAVE_CONFIG_H  -DPYTHONPATH='":plat-sunos5:lib-tk"' \
        -DPREFIX='"/usr/local"' \
        -DEXEC_PREFIX='"/usr/local"' \
        -DVERSION='"2.2"' \
        -DVPATH='""' \
        -o Modules/getpath.o ./Modules/getpath.c
gcc -c -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I./Include
-DHAVE_CONFIG_H  -o Modules/main.o Modules/main.c
gcc -c -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I./Include
-DHAVE_CONFIG_H  -o Modules/gcmodule.o Modules/gcmodule.c
gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I./Include
-DHAVE_CONFIG_H   -c ./Modules/threadmodule.c -o
Modules/threadmodule.o
gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I./Include
-DHAVE_CONFIG_H   -c ./Modules/signalmodule.c -o
Modules/signalmodule.o
./Modules/signalmodule.c:89: warning: function declaration isn't a
prototype
./Modules/signalmodule.c: In function `signal_signal':
./Modules/signalmodule.c:213: warning: function declaration isn't a
prototype
./Modules/signalmodule.c:215: warning: function declaration isn't a
prototype
./Modules/signalmodule.c:226: warning: function declaration isn't a
prototype
./Modules/signalmodule.c: In function `initsignal':
./Modules/signalmodule.c:333: warning: function declaration isn't a
prototype
./Modules/signalmodule.c:337: warning: function declaration isn't a
prototype
./Modules/signalmodule.c:356: warning: function declaration isn't a
prototype
./Modules/signalmodule.c:358: warning: function declaration isn't a
prototype
./Modules/signalmodule.c: In function `finisignal':
./Modules/signalmodule.c:562: warning: function declaration isn't a
prototype
./Modules/signalmodule.c:570: warning: function declaration isn't a
prototype
gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I./Include
-DHAVE_CONFIG_H   -c ./Modules/posixmodule.c -o Modules/posixmodule.o
./Modules/posixmodule.c: In function `posix_fstatvfs':
./Modules/posixmodule.c:4389: warning: passing arg 2 of `fstatvfs64'
from incompatible pointer type
./Modules/posixmodule.c: In function `posix_statvfs':
./Modules/posixmodule.c:4416: warning: passing arg 2 of `statvfs64'
from incompatible pointer type
gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I./Include
-DHAVE_CONFIG_H   -c ./Modules/_sre.c -o Modules/_sre.o
gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I./Include
-DHAVE_CONFIG_H   -c ./Modules/newmodule.c -o Modules/newmodule.o
gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I./Include
-DHAVE_CONFIG_H   -c ./Modules/symtablemodule.c -o
Modules/symtablemodule.o
gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I./Include
-DHAVE_CONFIG_H   -c ./Modules/xxsubtype.c -o Modules/xxsubtype.o
if test -f buildno; then \
        expr `cat buildno` + 1 >buildno1; \
        mv -f buildno1 buildno; \
else echo 1 >buildno; fi
gcc -c -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I./Include
-DHAVE_CONFIG_H  -DBUILD=`cat buildno` -o Modules/getbuildinfo.o
./Modules/getbuildinfo.c
rm -f libpython2.2.a
ar cr libpython2.2.a Modules/getbuildinfo.o
gmake: ar: Command not found
gmake: *** [libpython2.2.a] Error 127
Viking1# 


Thanks, any help greatly appreciated.

Alan Haffner



More information about the Python-list mailing list