[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: libtool crap [Re: SDL c102 transition]

On Tue, 2003-03-11 at 19:04, Steve Langasek wrote:

> On Tue, Mar 11, 2003 at 06:38:28PM +0100, Josselin Mouette wrote:
> > Le mar 11/03/2003 à 16:29, Steve Langasek a écrit :
> > 
> > > > 3) do the necessary so that SDL_mixer doesn't link unnecessary with
> > > > libsdtc++ anymore (is that a libtool bug ?).
> > > 
> > > And how.  I'm considering ripping the .la files out of all of my packages
> > > because of this; see #180496.
> > I don't see any good reason for linking explicitly with libraries you
> > don't really depend on. If it is not possible to deactivate that (the
> > documentation mentions $link_all_deplibs, but it doesn't seem to do
> > that), maybe it would be wiser to stop using libtool at all.
> I don't think there's any question that it would be wiser to stop using
> libtool.  Unfortunately, many upstreams care (God knows why) about making
> sure their complex library projects are portable to arcane Unix
> platforms.  The hoops libtool jumps through are the only way to get some
> libraries to work as intended on AIX, HPUX, et al.; but Debian is
> penalized in the process.
Only penalised in the sense that shlibs doesn't realise that many of the
NEEDEDs are only there because a dependency library will load them.

There's no loading penalty (the libraries will be loaded anyway!)

> I'm all for writing a libtool replacement that provides portability to
> *sane* platforms.  Maybe I'll start a mailing list.
That would be a stupid thing to do.  Why not just campaign to have a
tiny change to libtool added to declare that Linux *really can* recurse
shared libraries as expected.  You'd have to check with every libc + ld
version combination of course, and provide ample regression tests. 
Nobody's bothered to do this yet, so the libtool upstream understandably
play it safe.

If you do, I'll happily patch Debian's package and campaign for the
patch upstream.

Look, no dep trawling...

virus lttest% ./libtool gcc -o libb.la b.c -lpthread -rpath `pwd`/out
mkdir .libs
rm -fr .libs/libb.la .libs/libb.* .libs/libb.*
gcc -shared   -lpthread  -Wl,-soname -Wl,libb.so.0 -o .libs/libb.so.0.0.0
(cd .libs && rm -f libb.so.0 && ln -s libb.so.0.0.0 libb.so.0)
(cd .libs && rm -f libb.so && ln -s libb.so.0.0.0 libb.so)
ar cru .libs/libb.a  
ranlib .libs/libb.a
creating libb.la
(cd .libs && rm -f libb.la && ln -s ../libb.la libb.la)

virus lttest% ./libtool gcc -o test a.c -lb
gcc -o .libs/test a.c  /home/sjr/tmp/lttest/.libs/libb.so -Wl,--rpath -Wl,/home/sjr/tmp/lttest/out
creating test

virus lttest% objdump -p .libs/libb.so | grep NEEDED
  NEEDED      libpthread.so.0
  NEEDED      libc.so.6
virus lttest% objdump -p .libs/test | grep NEEDED
  NEEDED      libb.so.0
  NEEDED      libc.so.6

Scott James Remnant     Have you ever, ever felt like this?  Had strange
http://netsplit.com/      things happen?  Are you going round the twist?

Attachment: signature.asc
Description: This is a digitally signed message part

Reply to: