Skip Menu |

This queue is for tickets about the Tk CPAN distribution.

Report information
The Basics
Id: 6234
Status: resolved
Priority: 0/
Queue: Tk

People
Owner: Nobody in particular
Requestors: danq [...] brtt.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



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.
From: Julian Bridle
[guest - Wed May 5 16:13:15 2004]: Show quoted text
> 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.
Same problem exists under Solaris 2.6 I don't understand the code either, but I think that this logic is in preparation for making these libraries dynamic and the intention is to treat png_get_gAMA as a pointer to a function, and only call the actual function if it points to something. It is notable that the same type of logic exists for png_get_sRGB, but the compiler doesn't complain. I have managed to workaround the compiler complaint by changing the code in libPNG.c at the two complaint lines like so: 516: } else if (png_get_gAMA && 1) { 703: if (png_set_gAMA && 1) { I have no idea if this does achieve the desired effect, but my guess is that both the tests in question are always true because the function is always defined.
[guest - Wed Feb 23 10:46:12 2005]: Show quoted text
> [guest - Wed May 5 16:13:15 2004]: >
> > Tk-804.027 > > > > % uname -a > > SunOS crestone 5.8 Generic_108528-22 sun4u sparc SUNW,Sun-Blade-100
Show quoted text
> > 516: } else if (png_get_gAMA && 1) { > 703: if (png_set_gAMA && 1) { > > I have no idea if this does achieve the desired effect, but my guess is > that both the tests in question are always true because the function is > always defined.
In ISO C (AKA ANSI C), in an expression, the name of a function is conveted to the address of the function. This is just like the way that the name of an array is converted into the address of the first element (except in sizeof). So the expression is perfectly valid, unless I've missed something by not actually looking at the code. I would say that this is a bug in the Solaris compiler. Has a Sun customer reported this?
Subject: Re: [cpan #6234] Tk-804.027 fails to install under Solaris 8/ SUNcc compiler
To: bug-Tk [...] rt.cpan.org
Date: Thu, 03 Mar 2005 19:24:37 +0000
From: Nick Ing-Simmons <nick [...] ing-simmons.net>
RT-Send-Cc:
Guest via RT <bug-Tk@rt.cpan.org> writes: Show quoted text
>This message about Tk was sent to you by guest <> via rt.cpan.org > >Full context and any attached attachments can be found at: ><URL: https://rt.cpan.org/Ticket/Display.html?id=6234 > > >[guest - Wed Feb 23 10:46:12 2005]: >
>> [guest - Wed May 5 16:13:15 2004]: >>
>> > Tk-804.027 >> > >> > % uname -a >> > SunOS crestone 5.8 Generic_108528-22 sun4u sparc SUNW,Sun-Blade-100
>
>> >> 516: } else if (png_get_gAMA && 1) { >> 703: if (png_set_gAMA && 1) {
Could you try it as } else if (&png_get_gAMA) { i.e. explicitly take address and see iif that fixes it? Or I just remove this junk which is a vestige of way Tcl/Tk loads the library. Show quoted text
>> >> I have no idea if this does achieve the desired effect, but my guess is >> that both the tests in question are always true because the function is >> always defined.
> > >In ISO C (AKA ANSI C), in an expression, the name of a function is >conveted to the address of the function. This is just like the way that >the name of an array is converted into the address of the first element >(except in sizeof). So the expression is perfectly valid, unless I've >missed something by not actually looking at the code. I would say that >this is a bug in the Solaris compiler. Has a Sun customer reported this?