Subject: | Tk-804.027 fails to install under Solaris 8/ SUN cc compiler |
Tk-804.027
% uname -a
SunOS crestone 5.8 Generic_108528-22 sun4u sparc SUNW,Sun-Blade-100
% perl -V
Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
Platform:
osname=solaris, osvers=2.8, archname=sun4-solaris
uname='sunos castle 5.8 generic_108528-27 sun4u sparc sunw,ultra-5_10 '
config_args=''
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='/opt/SUNWspro/bin/cc', ccflags =' -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O',
cppflags=''
ccversion='WorkShop Compilers 5.0 98/12/15 C 5.0', gccversion='', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='/opt/SUNWspro/bin/cc', ldflags =' '
libpth=/usr/lib
libs=-lsocket -lnsl -ldb -ldl -lm -lc
perllibs=-lsocket -lnsl -ldl -lm -lc
libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
cccdlflags='-KPIC', lddlflags='-G'
Characteristics of this binary (from libperl):
Compile-time options: USE_LARGE_FILES
Built under solaris
Compiled at Jan 15 2004 19:20:49
@INC:
/opt/antelope/perl5.8/lib/5.8.0/sun4-solaris
/opt/antelope/perl5.8/lib/5.8.0
/opt/antelope/perl5.8/lib/site_perl/5.8.0/sun4-solaris
/opt/antelope/perl5.8/lib/site_perl/5.8.0
/opt/antelope/perl5.8/lib/site_perl
The installation dies while trying to compile imgPNG.c:
cc: Warning: illegal option -fPIC
/opt/SUNWspro/bin/cc -KPIC -c -I/usr/local/include -fPIC -o pngmem.pic.o pngmem.c
cc: Warning: illegal option -fPIC
/opt/SUNWspro/bin/cc -KPIC -c -I/usr/local/include -fPIC -o pngerror.pic.o pngerror.c
cc: Warning: illegal option -fPIC
/opt/SUNWspro/bin/cc -KPIC -c -I/usr/local/include -fPIC -o pngpread.pic.o pngpread.c
cc: Warning: illegal option -fPIC
ld -G -h libpng12.so.0 \
-o libpng12.so.0.1.2.5 png.pic.o pngset.pic.o pngget.pic.o pngrutil.pic.o pngtrans.pic.o pngwutil.pic.o pngread.pic.o pngrio.pic.o pngwio.pic.o pngwrite.pic.o pngrtran.pic.o pngwtran.pic.o pngmem.pic.o pngerror.pic.o pngpread.pic.o
ln -f -s libpng12.so.0.1.2.5 libpng12.so.0
ln -f -s libpng12.so.0 libpng12.so
/opt/SUNWspro/bin/cc -KPIC -I/usr/local/include -c pngtest.c
/opt/SUNWspro/bin/cc -KPIC -o pngtest -I/usr/local/include pngtest.o -L. -R. -L/usr/local/lib -R/usr/local/lib -lpng12 -lz -lm
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!/usr/local! > libpng.pc
( cat scripts/libpng-config-head.in; \
echo prefix=\"/usr/local\"; \
echo I_opts=\"-I/usr/local/include/libpng12\"; \
echo cppflags=\"-DPNG_USE_PNGGCCRD -DPNG_NO_ASSEMBLER_CODE\"; \
echo L_opts=\"-L/usr/local/lib\"; \
echo R_opts=\"-R/usr/local/lib\"; \
echo libs=\"-lpng12 -lz -lm\"; \
cat scripts/libpng-config-body.in ) > libpng-config
chmod +x libpng-config
/opt/SUNWspro/bin/cc -KPIC -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -KPIC -DHAVE_UNISTD_H -DUSE_MMAP -c example.c
cc: Warning: multiple use of -K option, previous one discarded.
/opt/SUNWspro/bin/cc -KPIC -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -KPIC -DHAVE_UNISTD_H -DUSE_MMAP -o example example.o -L. -lz
cc: Warning: multiple use of -K option, previous one discarded.
/opt/SUNWspro/bin/cc -KPIC -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -KPIC -DHAVE_UNISTD_H -DUSE_MMAP -c minigzip.c
cc: Warning: multiple use of -K option, previous one discarded.
/opt/SUNWspro/bin/cc -KPIC -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -KPIC -DHAVE_UNISTD_H -DUSE_MMAP -o minigzip minigzip.o -L. -lz
cc: Warning: multiple use of -K option, previous one discarded.
/opt/antelope/dev/bin/perl /opt/antelope/perl5.8/lib/5.8.0/ExtUtils/xsubpp -typemap /opt/antelope/perl5.8/lib/5.8.0/ExtUtils/typemap -typemap /opt/antelope/perl5.8/cpan/build/Tk-804.027/Tk/typemap PNG.xs > PNG.xsc && mv PNG.xsc PNG.c
/opt/antelope/dev/bin/perl /opt/antelope/perl5.8/lib/5.8.0/ExtUtils/xsubpp -typemap /opt/antelope/perl5.8/lib/5.8.0/ExtUtils/typemap -typemap /opt/antelope/perl5.8/cpan/build/Tk-804.027/Tk/typemap PNG.xs > PNG.xsc && mv PNG.xsc PNG.c
/opt/SUNWspro/bin/cc -c -I.. -Ilibpng -Izlib -I/usr/openwin/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O -DVERSION=\"4.003\" -DXS_VERSION=\"804.027\" -KPIC "-I/opt/antelope/perl5.8/lib/5.8.0/sun4-solaris/CORE" PNG.c
/opt/SUNWspro/bin/cc -c -I.. -Ilibpng -Izlib -I/usr/openwin/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O -DVERSION=\"4.003\" -DXS_VERSION=\"804.027\" -KPIC "-I/opt/antelope/perl5.8/lib/5.8.0/sun4-solaris/CORE" imgPNG.c
"imgPNG.c", line 516: controlling expressions must have scalar type
"imgPNG.c", line 703: controlling expressions must have scalar type
cc: acomp failed for imgPNG.c
*** Error code 2
make: Fatal error: Command failed for target `imgPNG.o'
Current working directory /opt/antelope/perl5.8/cpan/build/Tk-804.027/PNG
*** Error code 1
make: Fatal error: Command failed for target `subdirs'
/usr/ccs/bin/make -- NOT OK
Running make test
Can't test without successful make
Running make install
make had returned bad status, install seems impossible
(In earlier compiles, there seem to be gcc-like relocation flags, but
that's a side issue).
The relevant lines from imgPNG.c are:
if (png_get_sRGB && png_get_sRGB(png_ptr, info_ptr, &intent)) {
png_set_sRGB(png_ptr, info_ptr, intent);
} else if (png_get_gAMA) {
double gamma;
if (!png_get_gAMA(png_ptr, info_ptr, &gamma)) {
gamma = 0.45455;
}
png_set_gamma(png_ptr, 1.0, gamma);
}
The Sun compiler doesn't know what to do with the first reference to
png_get_gAMA. I don't understand this code either, but gcc doesn't
complain about it:
% gcc -fPIC -c -I.. -Ilibpng -Izlib -I/usr/openwin/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O -DVERSION=\"4.003\" -DXS_VERSION=\"804.027\" "-I/opt/antelope/perl5.8/lib/5.8.0/sun4-solaris/CORE" imgPNG.c
%
After this manual step, I was able to complete the make, make test,
and make install by hand.