Bug 231816

Summary: missing .la files from packages
Product: [openSUSE] openSUSE 10.2 Reporter: macias - <bluedzins>
Component: MaintenanceAssignee: E-mail List <bnc-team-screening>
Status: RESOLVED DUPLICATE QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: andreas.hanke, gassauer
Version: Final   
Target Milestone: ---   
Hardware: i586   
OS: Other   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description macias - 2007-01-04 17:13:15 UTC
I had no problem (zero) compiling anything from the sources in suse 10.0.

But with opensuse 10.2 is a problem -- a lot of prepared packages does not containt .la file. Libstdc++, expat, and many others. So I can compile an app, but I cannot link it. Of course I can download the sources for every package in the system and rebuild it (.la file is generated automagically) but it is not the point, I hope.

Please, provide proper packages.
Comment 1 Cristian Rodríguez 2007-01-04 18:07:27 UTC
This was done on purpose, your software is broken, fix it.

"Code needing libstdc++ has to use g++ for linking as
only that will ensure that the necessary C++ runtime libraries get lionked
in."
Comment 2 Cristian Rodríguez 2007-01-04 18:18:49 UTC
also see :

#215548

and

http://lists.opensuse.org/opensuse-packaging/2006-10/msg00047.html

this is actually a dup.
Comment 3 Cristian Rodríguez 2007-01-04 18:19:12 UTC

*** This bug has been marked as a duplicate of bug 215548 ***
Comment 4 Andreas Hanke 2007-01-04 18:26:35 UTC
For your information: You can solve the problem by recompiling all your packages. The problem here is that libtool "infects" all .la files recursively: If library A links to library B, libB.la gets a reference to the absolute path of libA.la. But if libA.la doesn't exist and you rebuild B, everything will be fine.

The reason why libstdc++.la *must* be removed is that it completely breaks the concept of a search path and the parallel installation of multiple C++ compilers. You would get absolute references to /usr/lib/gcc/i586-suse-linux/4.1.2/libstdc++.la into all your .la files, preventing you from using them with another g++ version. It should have been removed much earlier: Other distributions like Fedora remove *all* .la files and it's much better because that way you cannot even run into this problem.

If you have problems building packages, it means that there are old binaries on your system; remove and rebuild them.
Comment 5 macias - 2007-01-04 18:59:15 UTC
Andreas, thank you for the explanation!

Maybe I will clarify, libstdc++ is just an example. 
When I install (for example!) expat from Opensuse disc, there is no .la. But if I build it from source .la will appear.

And now, I have two g++ installed and I already tried to build amule, wordnet, etc. by myself. Success here. But then I tried to compile k3b and here libtool is used and it demands .la existence for expat, libstdc++ and libmpcdec. And k3b source is fresh new.

So it is quite surprise for me, that .la files are obsolete (if I understood you correctly).
Comment 6 Andreas Hanke 2007-01-04 19:13:18 UTC
(In reply to comment #5)
> When I install (for example!) expat from Opensuse disc, there is no .la. But
> if I build it from source .la will appear.

Correct.

> But then I tried to compile k3b and here libtool
> is used and it demands .la existence for expat, libstdc++ and libmpcdec. And
> k3b source is fresh new.

This means that one of the .la files in the chain contains a reference to libexpat.la, and must be rebuilt against an expat package that does not have a libexpat.la in order to lose this reference.

As an example, libtool might do the following when linking k3b:

libtool --mode=link libA.la libB.la libC.la [...]

There is no libexpat.la here directly. But one of your libA.la, libB.la or libC.la references libexpat.la because it has been built against an expat package that has libexpat.la. So you need to find out which one it is, and rebuild it.

grep -H libexpat.la /usr/lib/*.la
grep -H libexpat.la /opt/kde3/lib/*.la
grep -H libexpat.la /opt/gnome/lib/*.la

That way you can find the guilty .la file and fix it.

> So it is quite surprise for me, that .la files are obsolete (if I understood
> you correctly).

They are not obsolete, but they are useless on Linux.

These .la files are used to track library inter-dependencies. Linux doesn't need that because the dynamic linker on Linux (and Solaris, but IIRC not BSD) handles that on its own, and much better than libtool.

On Linux, all you get from .la files are the disadvantages: You're effectively unable to move libraries around because if you e.g. uninstall /usr/lib/libXYZ.la and compile it yourself, it will become /usr/local/lib/libXYZ.la, but libtool doesn't get it because it always records all the absolute paths.

It's annoying if you have such a broken .la file in the chain and need to track it down, but afterwards, life will be much better without .la files.
Comment 7 macias - 2007-01-04 20:08:55 UTC
Ok, now, I am tracking down all .la dependencies. THANK YOU FOR YOUR HELP :-)

Comment 8 Cristian Rodríguez 2007-01-06 17:10:45 UTC
*** Bug 232410 has been marked as a duplicate of this bug. ***
Comment 9 Chema Ollés 2007-01-06 20:47:30 UTC
Hi all
I rebuild expat package and libexpat.la doesn't create it.
I can't compile k3b if I not create a expat.la by hand and a .libs dir on /usr/lib with a link to libexpat.so
Very annoying 
regards
Comment 10 Andreas Hanke 2007-01-07 01:32:58 UTC
This report gets annoying...

Please remove all Packman and other non-official packages from your system and try again.

Guess what: It will work. k3b builds just fine on clean systems. The problem here is not that libexpat.la is missing, the problem is that you have broken .la files from some other repositories that reference it. Sigh.