Thursday, February 28, 2008

libtool 1.5 bug?

I was trying to compile gtk+-2.6.10 using Fink, on Mac OS X 10.5.2 with a new MacBook Pro. It stopped at the following error (I broke the lines to make it fit in 80 columns):
/bin/sh ../libtool --mode=link gcc  -O3 -funroll-loops -fstrict-aliasing -pipe -
Wall   -o libgdk-x11-2.0.la  -version-info 600:10:600 -export-dynamic -rpath /sw
/lib  -export-symbols-regex "^[^_].*" gdk.lo gdkcolor.lo gdkcursor.lo gdkdisplay
.lo gdkdnd.lo gdkdraw.lo gdkevents.lo gdkfont.lo gdkgc.lo gdkglobals.lo gdkkeys.
lo gdkkeyuni.lo gdkimage.lo gdkdisplaymanager.lo gdkpango.lo gdkpixbuf-drawable.
lo gdkpixbuf-render.lo gdkpixmap.lo gdkpolyreg-generic.lo gdkrgb.lo gdkrectangle
.lo gdkregion-generic.lo gdkscreen.lo gdkselection.lo gdkvisual.lo gdkwindow.lo
gdkenumtypes.lo x11/libgdk-x11.la -L/usr/X11/lib -lXrandr -lXrender -lXinerama -
lXext  -L/usr/X11/lib -lXfixes   -L/usr/X11/lib -lXcursor    -Wl,-framework,Core
Services,-framework,ApplicationServices -L/sw/lib -L/usr/X11/lib -lpangoxft-1.0
-lXft -lXrender -lpangoft2-1.0 -lfontconfig -lfreetype -lz -lpangox-1.0 -lX11 -l
pango-1.0 -lm -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -liconv    -lm ../gd
k-pixbuf/libgdk_pixbuf-2.0.la -lintl
libtool: link: warning: `/sw/lib//libintl.la' seems to be moved
rm -fr  .libs/libgdk-x11-2.0.exp .libs/libgdk-x11-2.0.lax
generating symbol list for `libgdk-x11-2.0.la'
/usr/bin/nm -p  .libs/gdk.o .libs/gdkcolor.o .libs/gdkcursor.o .libs/gdkdisplay.
o .libs/gdkdnd.o .libs/gdkdraw.o .libs/gdkevents.o .libs/gdkfont.o .libs/gdkgc.o
.libs/gdkglobals.o .libs/gdkkeys.o .libs/gdkkeyuni.o .libs/gdkimage.o .libs/gdk
displaymanager.o .libs/gdkpango.o .libs/gdkpixbuf-drawable.o .libs/gdkpixbuf-ren
der.o .libs/gdkpixmap.o .libs/gdkpolyreg-generic.o .libs/gdkrgb.o .libs/gdkrecta
ngle.o .libs/gdkregion-generic.o .libs/gdkscreen.o .libs/gdkselection.o .libs/gd
kvisual.o .libs/gdkwindow.o .libs/gdkenumtypes.o  x11/.libs/libgdk-x11.a | sed -
n -e 's/^.*[  ]\([BCDEGRST][BCDEGRST]*\)[  ][  ]*_\([_A-Za-z][_A-Za-z0-
9]*\)$/\1 _\2 \2/p' | /usr/bin/sed 's/.* //' | sort | uniq > .libs/libgdk-x11-2.
0.exp
grep -E -e "^[^_].*" ".libs/libgdk-x11-2.0.exp" > ".libs/libgdk-x11-2.0.expT"
mv -f ".libs/libgdk-x11-2.0.expT" ".libs/libgdk-x11-2.0.exp"
rm -fr .libs/libgdk-x11-2.0.lax
mkdir .libs/libgdk-x11-2.0.lax
rm -fr .libs/libgdk-x11-2.0.lax/libgdk-x11.a
mkdir .libs/libgdk-x11-2.0.lax/libgdk-x11.a
Extracting /sw/src/fink.build/gtk+2-2.6.10-1004/gtk+-2.6.10/gdk/x11/.libs/libgdk
-x11.a
(cd .libs/libgdk-x11-2.0.lax/libgdk-x11.a && ar x /sw/src/fink.build/gtk+2-2.6.1
0-1004/gtk+-2.6.10/gdk/x11/.libs/libgdk-x11.a)
sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < .libs/libgdk-x11-2.0.exp >
.libs/libgdk-x11-2.0-symbols.expsym
gcc -dynamiclib ${wl}-undefined ${wl}dynamic_lookup -o .libs/libgdk-x11-2.0.0.60
0.10.dylib  .libs/gdk.o .libs/gdkcolor.o .libs/gdkcursor.o .libs/gdkdisplay.o .l
ibs/gdkdnd.o .libs/gdkdraw.o .libs/gdkevents.o .libs/gdkfont.o .libs/gdkgc.o .li
bs/gdkglobals.o .libs/gdkkeys.o .libs/gdkkeyuni.o .libs/gdkimage.o .libs/gdkdisp
laymanager.o .libs/gdkpango.o .libs/gdkpixbuf-drawable.o .libs/gdkpixbuf-render.
o .libs/gdkpixmap.o .libs/gdkpolyreg-generic.o .libs/gdkrgb.o .libs/gdkrectangle
.o .libs/gdkregion-generic.o .libs/gdkscreen.o .libs/gdkselection.o .libs/gdkvis
ual.o .libs/gdkwindow.o .libs/gdkenumtypes.o  .libs/libgdk-x11-2.0.lax/libgdk-x1
1.a/gdkasync.o .libs/libgdk-x11-2.0.lax/libgdk-x11.a/gdkcolor-x11.o .libs/libgdk
-x11-2.0.lax/libgdk-x11.a/gdkcursor-x11.o .libs/libgdk-x11-2.0.lax/libgdk-x11.a/
gdkdisplay-x11.o .libs/libgdk-x11-2.0.lax/libgdk-x11.a/gdkdnd-x11.o .libs/libgdk
-x11-2.0.lax/libgdk-x11.a/gdkdrawable-x11.o .libs/libgdk-x11-2.0.lax/libgdk-x11.
a/gdkevents-x11.o .libs/libgdk-x11-2.0.lax/libgdk-x11.a/gdkfont-x11.o .libs/libg
dk-x11-2.0.lax/libgdk-x11.a/gdkgc-x11.o .libs/libgdk-x11-2.0.lax/libgdk-x11.a/gd
kgeometry-x11.o .libs/libgdk-x11-2.0.lax/libgdk-x11.a/gdkglobals-x11.o .libs/lib
gdk-x11-2.0.lax/libgdk-x11.a/gdkim-x11.o .libs/libgdk-x11-2.0.lax/libgdk-x11.a/g
dkimage-x11.o .libs/libgdk-x11-2.0.lax/libgdk-x11.a/gdkinput-none.o .libs/libgdk
-x11-2.0.lax/libgdk-x11.a/gdkinput.o .libs/libgdk-x11-2.0.lax/libgdk-x11.a/gdkke
ys-x11.o .libs/libgdk-x11-2.0.lax/libgdk-x11.a/gdkmain-x11.o .libs/libgdk-x11-2.
0.lax/libgdk-x11.a/gdkpango-x11.o .libs/libgdk-x11-2.0.lax/libgdk-x11.a/gdkpixma
p-x11.o .libs/libgdk-x11-2.0.lax/libgdk-x11.a/gdkproperty-x11.o .libs/libgdk-x11
-2.0.lax/libgdk-x11.a/gdkscreen-x11.o .libs/libgdk-x11-2.0.lax/libgdk-x11.a/gdks
election-x11.o .libs/libgdk-x11-2.0.lax/libgdk-x11.a/gdkspawn-x11.o .libs/libgdk
-x11-2.0.lax/libgdk-x11.a/gdkvisual-x11.o .libs/libgdk-x11-2.0.lax/libgdk-x11.a/
gdkwindow-x11.o .libs/libgdk-x11-2.0.lax/libgdk-x11.a/gdkxid.o .libs/libgdk-x11-
2.0.lax/libgdk-x11.a/xsettings-client.o .libs/libgdk-x11-2.0.lax/libgdk-x11.a/xs
ettings-common.o   -L/sw/lib -lc -L/usr/X11/lib /usr/X11/lib/libXrandr.2.0.0.dyl
ib /usr/X11/lib/libXau.6.0.0.dylib /usr/X11/lib/libXdmcp.6.0.0.dylib /usr/X11/li
b/libXinerama.1.0.0.dylib /usr/X11/lib/libXext.6.4.0.dylib /usr/X11/lib/libXfixe
s.3.1.0.dylib /usr/X11/lib/libXcursor.1.0.2.dylib /sw/lib/libpangoxft-1.0.dylib
-L/usr/X11R6/lib /usr/lib/libexpat.dylib /usr/lib/libz.dylib /usr/lib/libc.dylib
/usr/X11/lib/libXft.2.1.2.dylib /usr/X11/lib/libXrender.1.3.0.dylib /sw/lib/lib
pangoft2-1.0.dylib /usr/lib/libm.dylib /usr/X11/lib/libfontconfig.dylib /usr/X11
/lib/libfreetype.dylib -lz /sw/lib/libpangox-1.0.dylib /usr/X11/lib/libX11.6.2.0
.dylib /sw/lib/libpango-1.0.dylib /sw/lib/libgobject-2.0.dylib /sw/lib/libgmodul
e-2.0.dylib /sw/lib/libglib-2.0.dylib /sw/lib/libiconv.dylib -lm ../gdk-pixbuf/.
libs/libgdk_pixbuf-2.0.dylib /sw/lib//libintl.dylib /sw/lib/libintl.dylib  -Wl,-
framework -Wl,CoreServices -Wl,-framework -Wl,ApplicationServices -install_name
/sw/lib/libgdk-x11-2.0.0.dylib -Wl,-compatibility_version -Wl,601 -Wl,-current_
version -Wl,601.10
i686-apple-darwin9-gcc-4.0.1: /usr/X11/lib/libXrandr.2.0.0.dylib: No such file o
r directory
It appears the culprit is that libtool assumes all minor version numbers of dynamic libraries to be zero. But it is not so.
$ ls -l /usr/X11/lib/libXrandr.*
lrwxr-xr-x 1 root wheel     17 2008-02-14 09:48 /usr/X11/lib/libXrandr.2.1.0.dylib -> libXrandr.2.dylib
-rwxr-xr-x 1 root wheel 164144 2008-01-14 00:35 /usr/X11/lib/libXrandr.2.dylib
lrwxr-xr-x 1 root wheel     17 2008-02-14 09:48 /usr/X11/lib/libXrandr.dylib -> libXrandr.2.dylib
-rwxr-xr-x 1 root wheel    955 2007-09-09 01:34 /usr/X11/lib/libXrandr.la
This is the version of libtool I'm using:
$ dpkg -l libtool*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name           Version        Description
+++-==============-==============-============================================
un  libtool                 (no description available)
ii  libtool14      1.5.26-1       Shared library build helper, v1.5
ii  libtool14-shli 1.5.26-1       Shared libraries for libtool, v1.5
$
A workaround is to create the symbolic link:
$ cd /usr/X11/lib
$ sudo ln -s libXrandr.2.dylib libXrandr.2.0.0.dylib
Password:
$
And this hack should satisfy libtool for now. This is not a bug in the build script of gtk+-2.6.10 in fink, nor the Makefile though. The failed gcc command was generated automatically by libtool.
Post a Comment