[Bug 136009] MakeMaker::MM_Unix doesn't honor LD_RUN_PATH requirements
bugzilla at redhat.com
bugzilla at redhat.com
Wed Dec 7 00:04:10 UTC 2005
Please do not reply directly to this email. All additional
comments should be made in the comments box of this bug report.
Summary: MakeMaker::MM_Unix doesn't honor LD_RUN_PATH requirements
------- Additional Comments From jvdias at redhat.com 2005-12-06 19:04 EST -------
(In reply to comment #13)
> ld does not search LD_LIBRARY_PATH at compile time, that's not feasible.
Yes, ld DOES use LD_LIBRARY_PATH if no LD_RUN_PATH or -rpath option is supplied:
>From man ld(1):
The linker uses the following search paths to locate required shared libraries.
1. Any directories specified by -rpath-link options.
2. Any directories specified by -rpath options. The difference between
-rpath and -rpath-link is that directories specified by -rpath options
are included in the executable and used at runtime, whereas the -rpath-link
option is only effective at link time. It is for the native linker
3. On an ELF system, if the -rpath and "rpath-link" options were not used,
search the contents of the environment variable "LD_RUN_PATH". It is
for the native linker only.
And then an RPATH header is inserted in the object !
4. On SunOS, if the -rpath option was not used, search any directories
specified using -L options.
5. For a native linker, the contents of the environment variable
6. For a native ELF linker, the directories in "DT_RUNPATH" or "DT_RPATH"
of a shared library are searched for shared libraries needed by it.
The "DT_RPATH" entries are ignored if "DT_RUNPATH" entries exist.
There are thus many ways to avoid specifying absolute paths to libraries in
LIBS and getting an RPATH inserted by MakeMaker generating LD_RUN_PATH .
> It seems entirely broken to assume that an RPATH is needed for every library
> search path specified in any case.
Well, this is the way the upstream MakeMaker is designed and documented to work.
It's not really unreasonable to those programmers less familiar with the guts
of C program building - if you specify a fully qualified absolute path to
a library in LIBS, MakeMaker will try to ensure that the path is stored in the
resultant object with LD_RUN_PATH / RPATH . There are many ways to avoid using
full paths to libraries, eg. by using only '-l' options and LD_LIBRARY_PATH.
Configure bugmail: https://bugzilla.redhat.com/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
More information about the perl-devel