Global runtime library search path setting
Ian Lance Taylor
ian@airs.com
Tue Jun 3 19:40:00 GMT 2003
Ari Pollak <ari@ccs.neu.edu> writes:
> Hi, I am responsible for the gcc & GNU binutils installation on a 100+
> Sun Solaris workstation network.
> Both binutils and gcc are installed to nonstandard paths (/arch/gnu, not
> /usr/local) and this causes problems for programs where -R/arch/gnu/lib
> is not specified on the command line - e.g. a simple g++ compilation
> with no arguments except for the input file creates runtime dependencies
> on libstdc++ and libgcc, which are not usually found if LD_LIBRARY_PATH
> is not set because it is not currently feasible to put /arch/gnu/lib
> into the default library search path in Solaris.
>
> So, the following two possibilities have come up:
> - Make a wrapper script for ld to set LD_RUN_PATH before calling ld if
> it is not already set
> - Set LD_RUN_PATH for everyone by default
>
> Which brings me to my question - are both of those acceptable, meaning
> would they not cause any negative impact on programs?
Yes, either would be a normal way to handle this type of situation.
Most people probably just set LD_RUN_PATH in /etc/profile or
equivalent.
The main disadvantage is that anybody who uses an explict -R option
will have to also explicitly include the entries of LD_RUN_PATH (if
they want them).
> Also, is it at all possible to specify a default library search path at
> compile-time? If so, how?
This is not supported. It would be possible to add it.
Ian
More information about the Binutils
mailing list