public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Mike Edenfield <kutulu@kutulu.org>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user]  Re: Library file formats
Date: Fri, 16 Oct 2009 14:06:16 -0400	[thread overview]
Message-ID: <4AD8B618.5030901@kutulu.org> (raw)
In-Reply-To: <hba8gb$do7$1@ger.gmane.org>

On 10/16/2009 12:54 PM, walt wrote:
> On 10/16/2009 04:37 AM, Neil Bothwick wrote:
>> On Fri, 16 Oct 2009 12:20:30 +0100, Peter Humphrey wrote:
>>
>>> I thought I'd have a play with swami, but the emerge fails with
>>> "/bin/sed: can't read /usr/lib64/libogg.la: No such file or directory",
>>> and indeed there is none such.
>>
>> The elog message from the last libogg install explains this. Run
>> lafilefixer --justfixit.
>
> There is no manpage for lafilefixer, but the --help flag prints:
>
>        --justfixit       Choose some reasonable dirs, such as /usr/lib*, etc. ,
>                          find all .la files and fix them to not use .la files
>                          for linking
>
> I can't make sense out of that -- one of the major uses of libtool (I thought)
> is for linking.  Can anyone 'splain that to me?

One of the major problems with .la files (besides being mostly useless 
on Linux/FreeBSD/any other ELF-based OS) is when they refer to other .la 
files instead of linking directly to the binaries.  This breaks things 
when they get removed from a ebuild for a library that other libraries 
depend on.

The only time that libtool archives provide a real benefit is when 
there's a need to link in static libraries that have external 
dependencies -- the libtool archive defines the dependency information 
that can't be stored in the static archive format.  If you don't have 
any publicly-consumed static libraries, .la files are just pointless 
clutter, so package maintainers very often remove them.  Any build 
system depending on libtool for its linking then breaks because the 
dependency chain is broken.

Take, for example, this very real example from my system.  I have both 
hal and dbus installed; hal depends on dbus, and both packages install 
libtool archives.  In /usr/lib/libhal.la, there is the following:

# Libraries that this one depends upon.
dependency_libs=' /usr/lib/libdbus-1.la -lcap -lpthread -lrt'

Thus, whenever a package that uses hal tells libtool to link to 
libhal.la, libtool recursively links to libdbus-1.la as well.

Now, say the dbus maintainer suddenly doesn't like .la files (perhaps a 
bad break-up in Los Angeles), and removes them from the ebuild.  The 
next time I true to use libtool to link in hal, it will fail because the 
latest dbus does not include /usr/lib/libdbus-1.la.

The fix is to run lafilefixer, which changes the above line to say:

# Libraries that this one depends upon.
dependency_libs=' -L/usr/lib -ldbus-1 -lcap -lpthread -lrt'

So that hal no longer cares whether or not the dbus package installed 
its libtool archive, and all is well.

--Mike



  parent reply	other threads:[~2009-10-16 18:06 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-16 11:20 [gentoo-user] Library file formats Peter Humphrey
2009-10-16 11:37 ` Neil Bothwick
2009-10-16 11:59   ` Peter Humphrey
2009-10-16 12:04     ` Neil Bothwick
2009-10-16 12:10       ` Volker Armin Hemmann
2009-10-17  9:21         ` Neil Bothwick
2009-10-17  9:30           ` Volker Armin Hemmann
2009-10-17 11:36             ` Neil Bothwick
2009-10-17 17:10               ` Volker Armin Hemmann
2009-10-18 11:57                 ` Neil Bothwick
2009-10-18 12:31                   ` Volker Armin Hemmann
2009-10-16 15:53       ` peter
2009-10-16 16:54   ` [gentoo-user] " walt
2009-10-16 17:05     ` Volker Armin Hemmann
2009-10-16 18:06     ` Mike Edenfield [this message]
2009-10-16 18:51       ` walt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AD8B618.5030901@kutulu.org \
    --to=kutulu@kutulu.org \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox