attempt to build 64 bit on Solaris fails

daniel lance herrick <[email protected]>
Newsgroups gmane.comp.lang.perl.tk
Message-ID <Pine.GSO.4.44.0510061355280.22082-100000@rfdevel.rfdev.bellhow.com>
The perl we are using was compiled 64 bit. I'm
trying to get TK running with it:

make[2]: Entering directory `/work/appl4/gm/gme/TK/Tk-804.027/PNG/libpng'
gcc -fPIC -I../zlib -Wall -O2   -c -o pngtest.o pngtest.c
gcc -fPIC -o pngtest pngtest.o -L. -L../zlib -lpng -lz -lm -s
ld: warning: file ../zlib/libz.a(crc32.o): wrong ELF class: ELFCLASS64

Then there is a list of 9 undefined symbols that
libpng.a presumably expected to access from libz.a

There were many gcc commands with an "-m64" on the
command line before this point, but not in
directory PNG/libpng.

The command line used to bring us to this point:

/epo/app/martin/gme/epc3/thirdPartyLinks/perl Makefile.PL ; make

Scrolling back a bit, PNG/zlib is compiled with
the "-m64" switch as it needs to be, as, for
example:

gcc -fPIC -mcpu=v9 -m64 -Wa,-xarch=v9 -mcpu=v9 \
-m64 -fno-strict-aliasing -I/usr/local/include \
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC \
-DHAVE_UNISTD_H -DUSE_MMAP   -c -o inffast.o \
inffast.c

But in PNG/libpng, the compile commands are much
shorter:

make[2]: Entering directory `/work/appl4/gm/gme/TK/Tk-804.027/PNG/libpng'
gcc -fPIC -I../zlib -Wall -O2   -c -o png.o png.c
gcc -fPIC -I../zlib -Wall -O2   -c -o pngerror.o pngerror.c

I suspect the problem is that Makefile.PL is
choosing scripts/makefile.gcc when it needs to
choose scripts/makefile.64sunu, except I don't see
the string "-m64" in the 64sunu makefile.

So, I hand-edited the CFLAGS variable in
PNG/libpng/Makefile, did a make clean in
PNG/libpng and repeated the make in the build
directory. This time it compiled all the library
components 64 bit, but still compiled
PNG/libpng/pngtest without the -m64.

Where is the proper place to make such a
configuration change so it affects the whole
build?

dan
(perl -V below)


[herrick@rfautopub:Tk-804.027]$/epo/app/martin/gme/epc3/thirdPartyLinks/perl -V
Summary of my perl5 (revision 5.0 version 8 subversion 1) configuration:
  Platform:
    osname=solaris, osvers=2.9, archname=sun4-solaris-64
    uname='sunos build9 5.9 generic_112233-08 sun4u sparc sunw,ultra-4 '
    config_args='-Dprefix=/opt/perl/5.8.1 -Dcc=gcc -Accflags=-mcpu=v9 -m64 -Aldflags=-mcpu=v9 -m64 -Alddlflags=-mcpu=v9 -m64 -Duse64bitall'
    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=define use64bitall=define uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='gcc', ccflags ='-mcpu=v9 -m64 -Wa,-xarch=v9 -mcpu=v9 -m64 -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O',
    cppflags='-mcpu=v9 -m64 -Wa,-xarch=v9 -mcpu=v9 -m64 -fno-strict-aliasing -I/usr/local/include'
    ccversion='', gccversion='3.3.2', gccosandvers='solaris2.9'
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=87654321
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -mcpu=v9 -m64 -L/usr/lib/sparcv9 -L/usr/local/lib '
    libpth=/usr/lib/sparcv9 /usr/local/lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -ldl -lm -lc
    perllibs=-lsocket -lnsl -ldl -lm -lc
    libc=/usr/lib/sparcv9/libc.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='  -z ignore -z lazyload -z combreloc'
    cccdlflags='-fPIC', lddlflags=' -mcpu=v9 -m64 -G  -z ignore -z lazyload -z combreloc -L/usr/lib/sparcv9 -L/usr/local/lib'


Characteristics of this binary (from libperl):
  Compile-time options: USE_64_BIT_INT USE_64_BIT_ALL USE_LARGE_FILES
  Built under solaris
  Compiled at Oct 27 2003 16:50:15
  @INC:
    /opt/perl/5.8.1/lib/5.8.1/sun4-solaris-64
    /opt/perl/5.8.1/lib/5.8.1
    /opt/perl/5.8.1/lib/site_perl/5.8.1/sun4-solaris-64
    /opt/perl/5.8.1/lib/site_perl/5.8.1
    /opt/perl/5.8.1/lib/site_perl
    .

-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server.  If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.