The long-time followers of my blog will almost surely know of my fight against the pollution from libtool archive (.la) files in Gentoo packages. I already said that they are often useless, or even dangerous when dealing with cross-compilation, and that they create problems that can be solved only with --as-needed
(over-linking).
But in particular, I’ve started making the tinderbox warn me when libtool archive files are found in three particular sub-trees where they are absolutely not useful: Python modules, Ruby extensions and PAM plugins. Neither of these use libtool for loading the extensions (for quite obvious reasons), so the .la
file is not going to be used for loading; you also shouldn’t link against dynamically-loaded modules (and libtool warns you about that if you try to do it), so the .la
file is not used for build-time linking. It’s simply unused.
But it goes even worse than that: the warning has also made me notice that quite a few packages not only install the libtool archive, but build and install a static archive as well! This is not only an extra file installed (and in the search path of those implementations) but also force libtool to build all the source code twice: with and without Position-Independent Code (the static archives are usually non-PIC but shared objects are PIC).
In the bugs I reported for this kind of problems I also linked my own documentation on building plugins with libtool, so maybe the Gentoo developers reaching the bugs would be able to fix both up- and down-stream the issue of double build of both PIC and non-PIC objects. Not that I count on it but it might be possible.