2013.08.21 09:08 "[Tiff] compiling tiff on solaris for 64 bit", by KAs Coenen

2013.08.21 14:29 "Re: [Tiff] compiling tiff on solaris for 64 bit", by KAs Coenen

> CC: tiff@lists.maptools.org
> Subject: Re: [Tiff] compiling tiff on solaris for 64 bit

I am trying to compile libtiff 4.0.3 on Solaris 5.10 as this is needed for pdflib. I need the 64 bit libraries because i need them for pdflib which is needed to compile the libpdf module for php (my php install is 64 bit and so is my apache). My specific systems info is:

# cat /etc/release

> Oracle Solaris 10 9/10 s10x_u9wos_14a X86 > Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.

> Assembled 11 August 2010

When running configure everything seems ok. This is the configure line:

# CC=/opt/csw/bin/gcc-4.8 CFLAGS=-m64 ABI=64 LD_LIBRARY_PATH=/opt/csw/lib/amd64/ ./configure --prefix=/usr/local/ --disable-static

This is the last few lines from make output:

LD_LIBRARY_PATH is a run-time environment variable. It is used to find shared libraries at run-time, but not for linking. You definitely need to set LDFLAGS to tell the linker where to find the libraries. The Solaris linker also uses LD_RUN_PATH as a way to specify the run-time search paths to encode into the binaries (see 'ld' manual page).

Try something more like

./configure CC=/opt/csw/bin/gcc-4.8 'CFLAGS=-m64' \
   'LDFLAGS=-m64 -L/opt/csw/lib/amd64' --prefix=/usr/local --disable-static

I don't know if it meets the desires of the CSW project, but you can also add -R/opt/csw/lib/amd64 to LDFLAGS (or set LD_RUN_PATH) so that the built binaries will search that directory by default.

Thanks for the suggestion. But to no avail:

/bin/bash ../libtool  --tag=CXX   --mode=link g++  -g -O2 -no-undefined -version-info 7:0:2   -m64 -L/opt/csw/lib/amd64 -R/opt/csw/lib/amd64 -o libtiffxx.la -rpath /usr/local/lib tif_stream.lo ../libtiff/libtiff.la ../port/libport.la -ljpeg -lz -lm

libtool: link: g++ -shared  -fPIC -DPIC -nostdlib  /usr/lib/crti.o /usr/lib/values-Xa.o /usr/sfw/lib/gcc/i386-pc-solaris2.10/3.4.3/crtbegin.o  .libs/tif_stream.o  -Wl,-z -Wl,allextract ../port/.libs/libport.a -Wl,-z -Wl,defaultextract  -Wl,-R -Wl,/export/home/coenenka/tiff-4.0.3/libtiff/.libs -Wl,-R -Wl,/opt/csw/lib/amd64 -Wl,-R -Wl,/usr/local/lib -Wl,-R -Wl,/opt/csw/lib/amd64 -L/opt/csw/lib/amd64 ../libtiff/.libs/libtiff.so -lm -lm -ljpeg -lz -lm -L/usr/sfw/lib/gcc/i386-pc-solaris2.10/3.4.3 -L/usr/sfw/lib/gcc/i386-pc-solaris2.10/3.4.3/../../.. /opt/csw/lib/amd64/libstdc++.so -lm -lm -lgcc_s -lgcc_s /usr/sfw/lib/gcc/i386-pc-solaris2.10/3.4.3/crtend.o /usr/lib/crtn.o  -O2 -m64   -Wl,-h -Wl,libtiffxx.so.5 -o .libs/libtiffxx.so.5.2.0

ld: warning: file ../port/.libs/libport.a(dummy.o): wrong ELF class: ELFCLASS64
ld: fatal: file ../libtiff/.libs/libtiff.so: wrong ELF class: ELFCLASS64
ld: fatal: File processing errors. No output written to .libs/libtiffxx.so.5.2.0
collect2: ld returned 1 exit status
make[2]: *** [libtiffxx.la] Error 1
make[2]: Leaving directory `/export/home/coenenka/tiff-4.0.3/libtiff'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/export/home/coenenka/tiff-4.0.3/libtiff'
make: *** [all-recursive] Error 1

Is it normal its still pointing to /usr/lib/crtn.o? This clearly is a 32 bit file:

# file /usr/lib/crtn.o
/usr/lib/crtn.o: ELF 32-bit LSB relocatable 80386 Version 1

Although I have a 64 version on my system. If i change my configure command to this:

./configure CC=/opt/csw/bin/gcc-4.8 'CFLAGS=-m64' 'LDFLAGS=-m64 -L/op