Re: SunOS linking (was: Re: Outstanding GTK+ patches) (fwd)



---------- Forwarded message ----------
Date: Wed, 1 Mar 2000 10:57:03 -0800 (PST)
From: Guy Harris <guy@netapp.com>
To: Tim Janik <timj@gtk.org>
Cc: gtk-devel-list@redhat.com
Subject: Re: SunOS linking (was: Re: Outstanding GTK+ patches)

NOTE: I am not on "gtk-devel-list" (I just read it from the www.gtk.org
site archives); I'm responding to all, but the mail to "gtk-devel-list"
may bounce....

> the info section in question is ld.info-1.gz:
> 
> `-rpath DIR'

	...

>      The `-rpath' option may also be used on SunOS.  By default, on
>      SunOS, the linker will form a runtime search patch out of all the
>      `-L' options it is given.  If a `-rpath' option is used, the
>      runtime search path will be formed exclusively using the `-rpath'
>      options, ignoring the `-L' options.  This can be useful when using
>      gcc, which adds many `-L' options which may be on NFS mounted
>      filesystems.

	...

> so, according to the ld info pages, -L is sufficient,

They may be using the "SunOS = SunOS prior to 5.x, Solaris = SunOS 5.x"
convention, in which case the assertion is correct - "-R" was introduced
in SunOS 5.x (I think, in fact, it may have been introduced in SVR4 in
general, but it's been ages since I was involved in the AT&T/Sun deal,
so my memory may have faded).  SunOS 4.x's linker built the run-time
path out of "-L" directories - from the 4.1.3 "LD(1)" man page:

     -Ldir
          Add dir to the list of directories in which  to  search
          for  libraries.   Directories  specified  with  -L  are
          searched  before  the   standard   directories,   /lib,
          /usr/lib,  and /usr/local/lib.  When building a program
					  ^^^^^^^^^^^^^^^^^^^^^^^
          in which one or more objects are loaded when  -Bdynamic
	  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          is in effect, those directories specified by -L options
	  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          will be "remembered" for use at execution  time.   This
	  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          permits  the  construction of software that uses shared
          objects as libraries not residing in the standard loca-
          tions  and  avoids  requiring  the specification of the
          LD_LIBRARY_PATH environment variable in order  to  exe-
          cute  such  software.   Note  that such directories are
          retained in exactly the form specified in  the  option,
          which  means  that  relative  directory  specifications
          (i.e., not beginning with "/") will be evaluated  rela-
          tive  to the current directory when the program is run,
          not just during the operation of ld.

The SunOS 5.x linker, however, doesn't do this.

I presume GNU ld is imitating the native ld here, hence the bit about
"-L" options in the info file.




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