Subject: [alpine-devel] removing .la files from packages

From: Natanael Copa <[email-masked]>
Date: Fri, 3 Jun 2011 16:15:59 +0200

Hi,

I'd like to suggest a new packaging policy to over time remove all
unneeded .la files.

The reason is simple: Avoid overlinking. to be sure that the linking
works on all systems, including old obsolete ones, they force linking
with everything possible.

When we upgraded libpng from 1.4 to 1.5 alot of packages needed a
rebuild. Many of those were linked to libpng without really needing
that and removing the .la files would have solved it.

Many other distros also does that.

But this needs to be done with care or we will break building for each
other. 

Example we have libfoo which is needed by libbar, which is needed by
appbaz.

libfoo will produce a libfoo.la
libbar will produce a libbar.la which will contain a
reference to /usr/lib/libfoo.la
appbaz will parse the libbar.la and find out that it needs to parse
libfoo.la too.

So if we just remove libfoo.la from libfoo-dev package, all apps that
uses libbar.la will break. (That happened with libpng and is why
nenolod reverted my 'remove .la' patch)

So in order to remove the .la files, we might need to rebuild alot, but
doing so will save us for bigger rebuilds in future.

So i suggest that we start removing the .la files from top and work
down to the bottom (start with appbaz, then libbar and finally libfoo)

If you hit an error due to missing .la files I suggest that you do the
following:

abuild installdeps
grep 'missin.la' /usr/lib/*.la | cut -d: -f1 | xargs apk info --who-owns

and remove the .la files from those and bump pkgrel.

Note that some applications do need the .la file for their plugins.

Thoughts?

Should we have abuild to just remove libtool files and have an option
for keeping them? (i think arch linux does so). I kinda prefer to have
it visible what is going on than having some obscoure automagic.

Some info about libtool and overlinking:
http://wiki.mandriva.com/en/Libtool_archives
http://wiki.mandriva.com/en/Overlinking
http://blog.flameeyes.eu/2008/04/14/what-about-those-la-files

-nc

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---