Subject: Re: static vs. dynamic runtime linking, again (was: PAM and su -K)
To: Jason Thorpe <thorpej@shagadelic.org>
From: Greg A. Woods <woods@weird.com>
List: tech-userlevel
Date: 01/28/2005 20:10:36
[ On Friday, January 28, 2005 at 09:02:46 (-0800), Jason Thorpe wrote: ]
> Subject: Re: static vs. dynamic runtime linking, again (was: PAM and su -K)
>
> 
> On Jan 27, 2005, at 4:48 PM, Greg A. Woods wrote:
> 
> > The "on all ELF systems" part simply is simply not true AT ALL.  Indeed
> > NetBSD is one of the few loners on this front.
> 
> Hm... let's see... NetBSD uses the same tools as Linux... so I would 
> say that we are, in fact, not loners on this front.

We're only talking about a very _VERY_ simple little user interface
change here -- nothing that would make NetBSD a loner -- indeed
something that might even serve as a good example to others.

> Actually, the fact of the matter is, compiler/linker options are not 
> really standardized across platforms, and there are (subtle and 
> not-to-subtle) differences that application developers have to account 
> for in any case.

No kidding -- which is why "fixing" this one little faux pas only on
NetBSD won't have any adverse affect, especially given the nature of the
problem and the fact that reverting to the a.out behaviour won't affect
anything for anyone else since they'll still have to be extra careful
with '-R' or '-rpath'.

The only issue would be with developers starting on NetBSD, and not
using GNU Auto* tools.  They might learn the hard way that NetBSD was
making their lives a tiny little wee bit easier.  It still affects the
fewest people.


> In any case, setting the RPATH is something that all ELF systems have 
> to do.

Well, only when using libraries installed in non-standard directories,
but otherwise I agree -- I just don't want to have to tell the linker
the same thing twice, all the time and every time, just to get it done.


> There are good reasons for NOT setting the RPATH based on -L.  Consider:
> 
> 	cc -o foo -L ../foolib -lfoosup
> 
> Do you really want the RPATH set that way?  Answer: no.

Why not?  You can't predict at link time what the environment of the
runtime linker will be.

You're preventing a non-problem by breaking backwards compatability!

-- 
						Greg A. Woods

H:+1 416 218-0098  W:+1 416 489-5852 x122  VE3TCP  RoboHack <woods@robohack.ca>
Planix, Inc. <woods@planix.com>          Secrets of the Weird <woods@weird.com>