Any GCC experts out there?

Staffan Gimåker staffan at gimaker.se
Mon Aug 25 08:46:25 BST 2008


On Monday 25 August 2008 08:51:56 Erik Bågfors wrote:
> I'm fairly sure that -L just sets the location at compile time, not
> run time. You'll need to set it in the solaris equivalent of /etc/
> ld.so.conf or whatever it's named (or the environment variable you
> mention below)

I can verify that at least on Linux, what Eriks writes is true.
However, according to "man ld", the situation may be different on Solaris:

  "By default, on SunOS, the linker will form a runtime search patch out of 
all the -L options it is given."

Which I interpret as Russel did - assuming gcc uses GNU ld.


On Monday 25 August 2008 08:08:28 Russel Winder wrote:
> b) should not be needed since the compilation stage set -L and this
> should have been remembered. in the shared object.

You can try the "-rpath" option to ld (gcc doesn't appear to accept this) if 
you're dead set on *not* changing your LD_LIBRARY_PATH/ld.so.conf/whatever.

Cut-and-pasted from "man ld":
  -rpath dir
             Add  a  directory  to the runtime library search path. ...

(Using rpath is generally considered bad practice though - google "rpath 
considered harmful")


-- 
Staffan Gimåker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080825/d20a1daa/attachment.pgp 


More information about the bazaar mailing list