[lug] runtime link directory specification

D. Stimits stimits at idcomm.com
Tue Sep 4 15:59:17 MDT 2001


Ken Weinert wrote:
> 
> There's a slight difference - you might need both of these:
> 
> -rpath PATH                 Set runtime shared library search path
> -rpath-link PATH            Set link time shared library search path
> 
> * D. Stimits (stimits at idcomm.com) [010904 21:14]:
> > I can't seem to achieve this with the linux linker options for rpath.
> > (The -R of SunOS has instead --rpath on RH 7.1 it seems).
> 
> --
> Ken Weinert   kenw at ihs.com 303-858-6956 (V) 303-705-4258 (F)
> GnuPG KeyID: 9274F1CE           GnuPG available at http://www.gnupg.org/
> GnuPG Key Fingerprint: 1D87 3720 BB77 4489 A928  79D6 F8EC DD76 9274 F1CE
> This is a test of the Emergency Broadcast System.  This is only a
> test.  Had this been an actual emergency, you'd be writhing on the
> ground in unspeakable agony, bleeding from every orifice, with your
> blackened skin falling away in ragged strips.
> 
>   ------------------------------------------------------------------------
>    Part 1.2Type: application/pgp-signature

If I specify -rpath or -rpath-link at the regular g++ command line (link
stage), it claims it is an unknown option and breaks. If I present it
with an argument passed to the linker, e.g.:
-Wl,-rpath,/some/path,-rpath-link,/some/path

Then it doesn't complain, but it fails to link just the same, arguing
that it can't find the named lib. I know the lib works, because I can
put it in /usr/local/lib, run ldconfig, and it compiles/links just fine.
Does anyone have a sample or other possible clue on how to get regular
-lSomething to work by hardcoding the runtime linker search to a custom
directory? I have to wonder if maybe the g++/gcc 2.96 (and associated
ld) have broken this.

D. Stimits, stimits at idcomm.com



More information about the LUG mailing list