2008.04.29 19:48 "[Tiff] Error building TIFF-3.8.2. on AIX 5.3.3 System", by José_Luis_Casique_Torres

2008.04.30 17:18 "[Tiff] Libtiff on AIX 5.3", by Richard Nolde

>> Hi, I´m tried to install Tiff-3.8.2 on Aix 5.3.3 System but during the make execution i
>> got this error:

What was the error? I don't see it in your original Post. I have built and regularly update libtiff on a AIX 5.3 system using GCC 4.1.1, both by hand and as an RPM.

There are numerous issues with GCC on AIX. The most recent version of GCC available on IBM's freeware website is borked and they don't seem to be interested in fixing it. It will build C programs and libraries just fine but C++ files cannot be linked due to missing symbols in the GCC system libraries. I had a friend find the problem and build us a custom version of GCC 4.1.1 and it now works fine. The issues is in the way GCC rebuilds itself (second stage build) with the new compilier version it has just built with the previous version. If you need GCC 4.1.1, let me know. I have an RPM for it.

For all versions of GCC on AIX, the linker provided with binutils does not work (which is what causes the problem when GCC tries to rebuild itself using that version of ld). You must specify the native AIX versions of the linker ld and possible nm as well. The AIX linker builds both 32bit and 64bit entries for library functions in the same archive file, which GNU ld can't handle if I remember correctly. There are issues with GNU ar and nm here as well. Alos, large file support is native to AIX and you will get errors if you explicitly enable it as this redfines some symbols which then become unresolved.

Here are the patched settings I use in my RPM SPEC file for libtiff-3.8.2. You may need an updated version of libtool as well.

GCCLIBDIR=`gcc -print-libgcc-file-name |
          gawk ' { gsub (/usr\/utils/, "opt")
                   gsub (/\/bin\/../, "")
                   gsub ("\/libgcc.a", "")
                   print}' 2>/dev/null`

./configure $ARCH_FLAGS --with-GCOPTS="-O3 -s" --disable-largefile --prefix=%{_prefix} --sysconfdir=%{_sysconfdir} --enable-shared <<EOF no

$RPM_BUILD_ROOT/bin
$RPM_BUILD_ROOT/lib
$RPM_BUILD_ROOT/include
$RPM_BUILD_ROOT/man
$RPM_BUILD_ROOT/doc/%{name}-%{version}
bsd-source-cat
yes
EOF

AIXDTEMP=/tmp/libtiff-link$$
BLD=$(pwd)
echo ${BLD}
mkdir ${AIXDTEMP}
cp libtiff/.libs/libtiff.a ${AIXDTEMP}/libtiff.a.orig

dump -g libtiff/.libs/libtiff.a | gawk ' $1 ~ /[0-9]+/ && $2 !~ /\.[^ ]*/ { print $2 }' > ${AIXDTEMP}/libtiff.syms

cd ${AIXDTEMP}
/bin/ar -x ${BLD}/libtiff/.libs/libtiff.a

/bin/ld -o shr.o -bM\:SRE -bE\:libtiff.syms -lc -lm -lz -ljpeg -L${BLD}/libtiff/.libs libtiff.so.3 -blibpath:/opt/freeware/lib:${GCCLIBDIR}:/usr/lib:/lib -bnoipath -bnoquiet /bin/ar -q ${BLD}/libtiff/.libs/libtiff.a shr.o

cd ${BLD}
cp libtiff/.libs/libtiff.a ${AIXDTEMP}/libtiff.a.new

make install DESTDIR=$RPM_BUILD_ROOT
cd libtiff/.libs
install -m644 libtiff.a $RPM_BUILD_ROOT%{prefix}/lib
install -m644 libtiff.la $RPM_BUILD_ROOT%{prefix}/lib
install -m644 libtiff.lai $RPM_BUILD_ROOT%{prefix}/lib
install -m644 libtiff.so.3 $RPM_BUILD_ROOT%{prefix}/lib
done

Richard Nolde
Tiffcrop author

Does adding this to the configure options help?

   LDFLAGS='-brtl'

I think that this flag enables run-time linking similar to most other

> OSs.

Be sure to do 'make clean' before running configure.

>
>
    Hi, I set the variable but didn't work

>>
> I hadn't noticed that you are using GCC. I have not used GCC on any
> modern AIX. I have used IBM's commercial compiler for AIX.
>
> Perhaps this syntax is better for GCC
>
> 'LDFLAGS=-Wl,-brtl'
>
> Bob

>