From xemacs-m  Wed May 28 16:47:43 1997
Received: from jagor.srce.hr (hniksic@jagor.srce.hr [161.53.2.130])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id QAA19952
	for <xemacs-beta@xemacs.org>; Wed, 28 May 1997 16:47:16 -0500 (CDT)
Received: (from hniksic@localhost)
          by jagor.srce.hr (8.8.5/8.8.4)
	  id XAA25452; Wed, 28 May 1997 23:46:36 +0200 (MET DST)
To: XEmacs Developers <xemacs-beta@xemacs.org>
Subject: Re: `-R' on Solaris
References: <kigu3jom7k5.fsf@jagor.srce.hr> 	<199705281401.KAA00826@anthem.CNRI.Reston.Va.US> <199705281854.OAA23345@verve.canada.sun.com>
X-Attribution: Hrv
X-Face: Mie8:rOV<\c/~z{s.X4A{!?vY7{drJ([U]0O=W/<W*SMo/Mv:58:*_y~ki>xDi&N7XG
        KV^$k0m3Oe/)'e%3=$PCR&3ITUXH,cK>]bci&<qQ>Ff%x_>1`T(+M2Gg/fgndU%k*ft
        [(7._6e0n-V%|%'[c|q:;}td$#INd+;?!-V=c8Pqf}3J
X-AT&T-Hype: 
   Have you ever joined a church where everyone but you can hum God
   Save the Queen madly with your anteater?  Or seen your dog make
   annoying phone calls to large lymph nodes six times in a row? You
   will.  And the company that will bring it to you: AT&T.
From: Hrvoje Niksic <hniksic@srce.hr>
Date: 28 May 1997 23:46:35 +0200
In-Reply-To: Georg Nikodym's message of Wed, 28 May 1997 14:54:46 -0400
Message-ID: <kigu3jne0ck.fsf@jagor.srce.hr>
Lines: 43
X-Mailer: Gnus v5.4.52/XEmacs 20.2

Georg Nikodym <georgn@Canada.Sun.COM> writes:

> Here's how -L and -R work.
> 
> -L tells the link editor (ld) where to look for .so's and .a's
> The LD_LIBRARY_PATH env variable does the same.  Directories added the 
> path by -L take precedence.
> 
> So, if LD_LIBRARY_PATH=/tmp then for ld to honour the args "-L/var/tmp
> foo.o -lx -ly -lz" it will look in /var/tmp:/tmp:/usr/lib for libx,
> liby, and libz.
> 
> The resultant binary has a dynamic dependency on lib[xyz] but no
> location information (path) is encoded.
> 
> -R tells the link editor (ld) to add the run path that gets encoded
> into an ELF object (dynamic executable or shared object).  The
> LD_RUN_PATH env variable does the same.
> 
> So, if LD_RUN_PATH=/tmp then ld with the args "-R/var/tmp
> -L/var/tmp foo.o -lx -ly -lz" will look only in /var/tmp for
> lib[xyz] but will encode /var/tmp:/tmp in the run path of the binary.
> 
> At run time, the runtime linker will use binary's run path before
> examining the LD_LIBRARY_PATH environment variable to find dynamic
> dependencies.
> 
> So, in the first example, assume that lib[xyz] live in /var/tmp.  The
> program will only run with LD_LIBRARY_PATH=/var/tmp.
> 
> The second example, will run without an LD_LIBRARY_PATH...  If
> lib[xyz] lived in /foo, however, then an LD_LIBRARY_PATH=/foo would be 
> required to run...

All very true -- only you bring no conclusion.  To me it seems that
the only reasonable thing is to simply add the required `-R'.  I
haven't heard a good reason against this.

-- 
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
Then...  his face does a complete change of expression.  It goes from
a "Vengeance is mine" expression, to a "What the fuck" blank look.

