Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 46189

Summary: Linking is braindamage, apps break on upgrade
Product: Gentoo Linux Reporter: John Richard Moser <nigelenki>
Component: Current packagesAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Severity: major CC: avenj, mr_bones_
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Package list:
Runtime testing required: ---

Description John Richard Moser 2004-03-29 19:56:38 UTC
I don't know what genious came up with the set-up we have, but things
work kind of like this in general:

lrwxrwxrwx  1 root root     11 /usr/lib/ ->
lrwxrwxrwx  1 root root     15 /usr/lib/ ->
-r-xr-xr-x  1 root root 193064 /usr/lib/

Notice how points at, and points at
the real library.

Now, occasionally these things go up in version, i.e. upgrades/updates.
In theory, the applications don't care, because of the symlinks to
the real library.

This is not a fact.  Things break.  For example, updating gnome and
causing to becom breaks abiword
until you relink abiword (by remerging it)

Interestingly enough, points at, so is a symlink itself.

MORE interestingly. linking to
fixes abiword without a recompile.

A lot of applications are linked to some .so.* libraries, like this
big one:

bluefox@icebox bluefox $ ldd /usr/bin/gimp-2.0 => /usr/lib/ (0x4002d000) => /usr/lib/ (0x400f5000) => /usr/lib/ (0x400fa000) => /usr/lib/ (0x40102000) => /usr/lib/ (0x40108000) => /usr/lib/ (0x4010e000) => /usr/lib/ (0x40119000) => /usr/lib/ (0x403c1000) => /usr/lib/ (0x40432000) => /usr/lib/ (0x4044c000) => /lib/ (0x40460000) => /usr/lib/ (0x40482000) => /usr/lib/ (0x40488000) => /usr/lib/ (0x40493000) => /usr/lib/ (0x404aa000) => /usr/lib/ (0x404d0000) => /usr/lib/ (0x40505000) => /usr/lib/ (0x4053c000) => /lib/ (0x40541000) => /usr/lib/ (0x40544000) => /usr/lib/ (0x405be000) => /usr/lib/ (0x405e7000) => /lib/ (0x40658000) => /lib/ (0x40669000) => /usr/X11R6/lib/ (0x40796000) => /usr/X11R6/lib/ (0x4087a000) => /usr/X11R6/lib/ (0x4087e000) => /usr/X11R6/lib/ (0x40887000) => /usr/X11R6/lib/ (0x4088a000) => /usr/X11R6/lib/ (0x4089c000) => /usr/X11R6/lib/ (0x408b2000)
        /lib/ => /lib/ (0x40000000) => /usr/lib/ (0x408bb000)

You do realize that it would probably work to link to the .so, and
that things wouldn't break on upgrades, right?  Like wget, when libssl
is updated.

Admittedly, it appears some things endure upgrades.  It may though be
that the upgrades don't change the major/minor that is in the symlink,
and thus doesn't disrupt the and dl stuff.

bluefox@icebox bluefox $ ldd /usr/bin/wget => /usr/lib/ (0x4002d000) => /usr/lib/ (0x4005c000) => /lib/ (0x40160000) => /lib/ (0x40163000)
        /lib/ => /lib/ (0x40000000)

THIS ONE doesn't have that luxury; it breaks as soon as some idiot
updates libssl.

This is probably more of a problem for either autoconf or the
Comment 1 Jon Portnoy (RETIRED) gentoo-dev 2004-03-30 08:27:52 UTC
We can't patch every Makefile in Portage to link elsewhere.
Comment 2 John Richard Moser 2004-03-30 09:02:22 UTC
I realize that.  Notice the last paragraph/sentence of the commnent.

It's just frustrating is all.  You could TRY to patch major ones once
in a while (especially wget) that can potentially waste the core
system, and ask the developers to please take the patches.  If Python
or wget goes out from underneath you, you need to mess with a rescue
package for portage.  If bzip2 or tar goes (that probably wouldn't
happen. . .) you're screwed.

But yes, you are right.  It's too much work to fix other peoples'
stuff constantly, and it's not really your responsibility.
Comment 3 Donnie Berkholz (RETIRED) gentoo-dev 2004-03-30 09:09:12 UTC
Why don't you submit some patches instead of just telling us about it?
Comment 4 John Richard Moser 2004-04-25 15:09:18 UTC
Technical question here.

Most of this stuff is linked by `gcc -lfoo -lbar -lbaz biz.o qux.o qax.o -o foobar`, right?  Would that make this a binutils issue, rather than a makefile issue?  I could believe that ld would resolve symlinks one level, or something.

If this is true, then it'd be a binutils problem, in which case I should figure out who the heck puts those out and go bug them.

I'll leave this as resolved cantfix for now.  I'm not taking up any coding project to resolve this.