Re: [VCDImager Bugs/Devel] vcdimager 0.7.20 build problem under Mac OS X

"R. Bernstein" <[email protected]> Mon, 8 Mar 2004 20:54:33 -0500
Newsgroups gmane.comp.gnu.vcdimager.bugs
Message-ID <[email protected]>
Thanks for looking into this. It seems reasonable to me to allow
--with-versioned-libs only if when GNU ld is used. Unless the other
VCDImager developers disagree, I'll make a mental note to address this
by the next release. (I suspect the others would be more qualified to
make the best change; but if it's not done, I'll do it.)

Sebastian Hagedorn writes:
 > Hi,
 >=20
 > -- "R. Bernstein" <[email protected]> is rumored to have mumbled on Mi=
ttwoch,=20
 > 3. M=E4rz 2004 8:40 Uhr -0500 regarding Re: [VCDImager Bugs/Devel] v=
cdimager=20
 > 0.7.20 build problem under Mac OS X:
 >=20
 > > Sebastian Hagedorn writes:
 > >  > strange, I haven't had this problem with libcdio 0.66. Or have =
you
 > > added   > versioning support in 0.67?
 > >
 > > Looking at NEWS for libcdio 0.66, I see the versioning was in
 > > 0.66. 0.67 added --without-versioned-libs.
 > >
 > >  > I'll try to find out what's the best route to take.
 > >
 > > Thanks.
 >=20
 > I've examined this some more. Versioning works fine under OS X with =
libcdio=20
 > 0.67. I believe the reason for that to be a different version of lib=
tool:
 >=20
 > libcdio-0.67/libtool --version
 > ltmain.sh (GNU libtool) 1.4.3 (1.922.2.111 2002/10/23 02:54:36)
 >=20
 > vcdimager-0.7.20] hgd% ./libtool --version
 > ltmain.sh (GNU libtool) 1.5.2 (1.1220.2.60 2004/01/25 12:25:08) Debi=
an: 192=20
 > $
 >=20
 > When libcdio calls libtool, the following happens:
 >=20
 > /bin/sh ../libtool --mode=3Dlink gcc  -g -O2 -Wall -Wchar-subscripts=
=20
 > -Wmissing-prototypes -Wmissing-declarations -Wunused -Wpointer-arith=
=20
 > -Wwrite-strings -Wnested-externs -Wno-sign-compare  -L/sw/lib -o=20
 > libiso9660.la -rpath /sw/lib -version-info 1:0:1=20
 > -Wl,--version-script=3Dlibiso9660.la.ver iso9660.lo iso9660_fs.lo xa=
.lo=20
 > libcdio.la -lm
 >=20
 > Note that "-Wl,--version-script=3Dlibiso9660.la.ver" is part of that=
 command.=20
 > It results in this:
 >=20
 > gcc -r -keep_private_externs -nostdlib -o=20
 > .libs/libiso9660.0.1.0.dylib-master.o  iso9660.lo iso9660_fs.lo xa.l=
o &&=20
 > gcc -dynamiclib -flat_namespace -undefined suppress -o=20
 > .libs/libiso9660.0.1.0.dylib .libs/libiso9660.0.1.0.dylib-master.o=20=

 > -L/sw/lib -L./.libs -lcdio -lm -lc --version-script=3Dlibiso9660.la.=
ver=20
 > -install_name /sw/lib/libiso9660.0.dylib -compatibility_version 2=20=

 > -current_version 2.0
 >=20
 > For whatever reason the second call of gcc includes only=20
 > "--version-script=3Dlibiso9660.la.ver", which gcc ignores (note the =
absence=20
 > of -Wl, in front of it). The versioning OS X uses works because of t=
he=20
 > "-version-info 1:0:1" flag.
 >=20
 > When vcdimager calls libtool, it looks like this:
 >=20
 > /bin/sh ../libtool --mode=3Dlink gcc  -g -O2  -Wall -Wchar-subscript=
s=20
 > -Wmissing-prototypes -Wmissing-declarations -Wunused -Wpointer-arith=
=20
 > -Wwrite-strings -Wnested-externs -Wno-sign-compare  -L/sw/lib -o=20
 > libvcdinfo.la -rpath /sw/lib -version-info 0:1:0=20
 > -Wl,--version-script=3Dlibvcdinfo.la.ver info.lo inf.lo info_private=
.lo=20
 > vcd_read.lo -L/sw/lib -lcdio   -L/sw/lib -liso9660 -lcdio=20
 > ../lib/libvcd.la -lm
 >=20
 > This is basically the same as with libcdio. But the newer libtool be=
haves=20
 > differently:
 >=20
 > gcc -dynamiclib -undefined dynamic_lookup -o .libs/libvcdinfo.0.0.1.=
dylib=20
 > .libs/info.o .libs/inf.o .libs/info_private.o .libs/vcd_read.o -all_=
load=20
 > ../lib/.libs/libvcd.a  -L/sw/lib /sw/lib/libiso9660.dylib=20
 > /sw/lib/libcdio.dylib -lm -Wl,--version-script=3Dlibvcdinfo.la.ver=20=

 > -install_name  /sw/lib/libvcdinfo.0.dylib -compatibility_version 1=20=

 > -current_version 1.1
 >=20
 > It does only one call to gcc, which contains the original=20
 > "-Wl,--version-script=3Dlibvcdinfo.la.ver" part. Thus the flag=20
 > "--version-script=3Dlibvcdinfo.la.ver" isn't dropped by gcc but rath=
er passed=20
 > to the loader. The loader (or rather Apple's own libtool) doesn't kn=
ow it=20
 > and barfs:
 >=20
 > /usr/bin/libtool: unknown option character `-' in:=20
 > --version-script=3Dlibvcdinfo.la.ver
 >=20
 > I suppose that libcdio working is just coincidence. If my analysis i=
s=20
 > correct, the configure script should determine whether GNU ld is bei=
ng used=20
 > or not. In fact, it does so already. What needs to be done is for=20=

 > "-Wl,--version-script=3Dlibvcdinfo.la.ver" to be passed to libtool *=
only* if=20
 > GNU ld is being used ... versioning should *still* work, because lib=
tool=20
 > does the right thing in translating the "-version-info" flag to the=20=

 > appropriate " -compatibility_version" and  "-current_version" flags =
that=20
 > are used by OS X.
 > --
 > Sebastian Hagedorn
 > Ehrenfeldg=FCrtel 156, 50823 K=F6ln, Germany
 > http://www.spinfo.uni-koeln.de/~hgd/
 >=20
 > "Being just contaminates the void" - Robyn Hitchcock