[PATCH] nptl: proper soname handling

Michael Deutschmann michael at talamasca.ocis.net
Mon Apr 26 14:38:25 UTC 2010


On Mon, 26 Apr 2010, Rob Landley wrote:
> > 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.
>
> Or just build it that way in the first place...

That means yielding the plain /lib and /usr/lib locations forever to the
first uClibc that claims them.  In turn, you'll get a lot of pain dealing
with packages that build new libraries and don't understand that, since
they are building against /lib/NEW/libc.so.0, they need to install their
libfoo.so.1 as /usr/lib/NEW/libfoo.so.1.  Instead, they'll overwrite
/usr/lib/libfoo.so.1, making the new library invisible to freshly compiled
applications, while breaking old executables.

It's better to hack old excutables into looking in /lib/OLD and
/usr/lib/OLD so that the new ABI can seize the traditional locations.
Once you begin changeover, you will no longer be compiling old-API
libraries, so the nonstandard paths do not cause trouble.

> > Write a utility to modify the INTERP filename specified in an executable
>
> Try "probably only feasible if".

The longer-length case is doable.  Append the longer interpreter filename
to the end of the executable, then change the segment header to point at
it.  The old ld.so name becomes dead space in the file.

This can be automated.  However, *I'm* going to lazily just use a
temporary interpreter filename that fits in the original spot.

It would break most self-extracting archives.  However, the concept of a
uClibc SFX file is rather silly when you think about it, anyway.

> Don't forget that pretty much every other shared library (zlib, ncurses,
> openssl, etc) also links against libc, so you have to move those to the
> alternate position and rebuild them too.

You need to move them all, but not recompile them.

I'm well aware of this factor, and it is itself the reason I don't think
changing the uClibc soname alone will do much good.  You also need to
extend ldso & ldconfig to give the same respect to the previous soname,
that they presently grant to libc.so.5 and libc.so.6.

---- Michael Deutschmann <michael at talamasca.ocis.net>


More information about the uClibc mailing list