Jeff Abrahamson on Sun, 6 Jan 2002 04:30:18 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: LD_LIBRARY_PATH (was: Re: [PLUG] Update on My Debian Progress)


On Sat, Jan 05, 2002 at 01:58:33PM -0500, gabriel rosenkoetter wrote:
> On Sat, Jan 05, 2002 at 02:59:14PM +0100, Jeff Abrahamson wrote:
> > LD_LIBRARY_PATH get /usr/local
> 
> If you've got software in production that requires LD_LIBRARY_PATH,
> you have (or whoever wrote the Makefile has) done something horribly
> wrong in the building process.
> 
> LD_LIBRARY_PATH is a *really* evil hack designed to make life easier
> for library developers. It should NEVER be used in the real world.
> It's a security risk, and it *really* makes the linker do dumb
> things. What's more, if you have it set in your build environment,
> it WILL break your software so it cannot work without it set (and
> set exactly the same way).
> 
> If you think LD_LIBRARY_PATH is necessay for anything you compiled
> from source, you're wrong. Go learn how to use ld (you'll be
> interested in -R and -l, probably). If you think it's necessary for
> certain third-party, closed source software, you're probably right.
> But that should be set in a wrapper script and never, ever included
> in your shell's environment.
> 
> For more background about this, have a look at David Barr's article
> on the subject at http://www.visi.com/~barr/ldpath.html.

Wow, thanks.

I got into LD_LIBRARY_PATH from two sources: config instructions from
sysadmins and/or colleagues and configure.

The first comes up in context like oracle, where I'm told to set

    PATH=$PATH:$ORACLE_HOME/bin,

then set

    LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib.

This sort of thing. I never bothered to test to see if it was really
necessary, but the amount of wrapping I'd have to do as an individual
user would be heinous. And, with everyone else doing it, any bug I had
would get blamed on having a different env, so it wasn't worth
bucking. (Already some people like to blame problems of non-csh users
on the fact that they aren't using csh. They are heathens who don't
understand the finer subtleties of unix, but heathens with power.)


The other is that at work I typically install software with

    ./configure --prefix=$HOME/local

This admittedly floats me to top usage of /home, but, hey, I have also
been a hero from being able to grep something that breaks Sun's grep
just because I had installed gnu grep in my home directory.

Anyway, several apps, can't tell you which right now, have emitted
warnings about how I should be sure to set LD_LIBRARY_PATH or edit
/etc/ld.conf.

Hmm...

-- 
 Jeff

 Jeff Abrahamson  <http://www.purple.com/jeff/>

 Buy my boyfriend's new novel: The Big Book of Misunderstanding
 <http://www.misunderstanding.net/buystuff.html>


______________________________________________________________________
Philadelphia Linux Users Group       -      http://www.phillylinux.org
Announcements-http://lists.phillylinux.org/mail/listinfo/plug-announce
General Discussion  -  http://lists.phillylinux.org/mail/listinfo/plug