[PATCH] nptl: proper soname handling

Timo Teräs timo.teras at iki.fi
Thu Apr 22 11:46:21 UTC 2010


Michael Deutschmann wrote:
> On Thu, 22 Apr 2010, Natanael Copa wrote:
>> Do you have any better suggestions how to upgrade a running system?
> 
> First, build the new uClibc, but don't install it yet.
> 
> Build a customized ld-uclibc.so.0, from the previous uClibc source, that
> looks in a different place for shared libraries and ignores the
> /etc/ld.so.* files.  Install it under a different filename.

So for each transition X -> Y you need both X and Y versions recompiled.
If you want upgrade from n+1 different versions, you need to do work n
times.

> Write a utility to modify the INTERP filename specified in an executable
> from "/lib/ld-uclibc.so.0" to the filename of the special ld.so.  (This is
> much simpler if the temporary ld.so filename is the same length as the
> original.)
> 
> Hardlink the existing shared libraries into the alternate position, then
> hack every existing installed executable in this way.

This means you need to mangle existing binaries?! This invalidates lot
of package manager features. It also means that the running system cannot
be reproduced from packages.

> Then, delete all the old libraries in /usr/lib and the include files. The
> shared libraries will be preserved by the hardlink, while everything else
> is dispensible.  The system should still work for everything except
> compilation.
> 
> Now, install the new uClibc.  Unless the ABI is so thoroughly broken as
> to invalidate the old specs or libgcc.a, you should now be able to compile
> new binaries.
> 
> I intend to do something like this for my 0.9.30.3 to 0.9.31 rollover,
> but I haven't finished writing the necessary utilities yet.

Honestly. I still think it's less work to track the config, change
ABI_VERSION when the ABI breaks, and make binary packages in a way that
it depends only on packages using same libc ABI.

This is fairly easily scriptable on any sane build system.

You also get more or less free the fact that you can upgrade from any
previous version.

But as mentioned, it works only when making sure that the ABI_VERSION
is maintained properly. Since uclibc provides currently no ABI stability
the distribution maintainers can ensure that this holds true.

- Timo


More information about the uClibc mailing list