-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Tue, Jan 18, 2005 at 10:36:00PM +0100, Mario Klebsch wrote:
> > Reason Two (the biggy): It makes upgrading a major library
> > impossible.
>
> The opposite is true. Without rpath, upgrading a library replaces an
> existing one. with rpath I can safely install a new version at a
> different location and I do not risk to break anything.
So why install a new version at all, if all you notice is that it
"breaks" things?
Ah, but then *everything else* that uses your library, or every library
to which your executable links, must *also* use rpath. Otherwise, you
get your rpath-binary (library or executable) dynamically linked to lib
A and to lib B version 17, and lib A implicitly linked to lib B version
42, so you have two lib B's linked into your program, producing
segfaults when lib B code accesses its globals.
libB-1.0.17.so (soname libB.so.1):
static int n17 = 0;
int nextnum(void)
{
return n17++;
}
libB-1.0.42.so (soname libB.so.1):
static int n42 = 0;
int nextnum(void)
{
return n42++;
}
Imagine further that both libA.so and your binary call nextnum() and
expect the result to be globally monotonically increasing.
Now without rpath, libA.so links to /usr/local/libB-1.0.42.so, and some
binary linked to both libA.so and to libB.so.1 links to /usr/lib/libA.so
and to /usr/lib/libB.so.17, since it has /usr/lib in rpath. Bang.
> But once again, I can understand why distribution makers argue
> different.
Their reasons are not magically counter to the interests of
non-distributors.
IMHO rpath is evil purely because it restricts my options - permanently!
> >http://www.visi.com/~barr/ldpath.html
>
> Hey, this one tells us to use rpath.
"This is written from a SunOS 4.x/5.x (and to some extent Linux) point
of view"
> configure should first check, wether the compiler accepts any rpath
> flags (-R, -Wl,--rpath, LD_RUN_PATH, ...). If the compiler does,
> configure should supply the approriate rpath arguments to the compiler
> for each -L-argument used. This is letting ./configure plaing safe,
> since it does no harm to the probe program.
>
> When the tests show, that the libs are available and working,
> configure should check for each -L, wether it can be omitted from
> rpath.
Or, you could just let libtool figure out all this messy stuff?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQFB7gfD/FmLrNfLpjMRAjmjAKCcRWMLmYJJ+hkaE7tveV/bUAUX4gCdFq49
AkWYT7SIf0XyqHOubFreJq0=
=/UBe
-----END PGP SIGNATURE-----