This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: RPATH/RUNPATH issue, equivalent to -headerpad on OSX
- From: Michael Hennebry <hennebry at web dot cs dot ndsu dot NoDak dot edu>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Alexander Neundorf <neundorf at kde dot org>, <binutils at sourceware dot org>
- Date: Thu, 3 Jan 2008 10:20:22 -0600 (CST)
- Subject: Re: RPATH/RUNPATH issue, equivalent to -headerpad on OSX
On Thu, 3 Jan 2008, Jakub Jelinek wrote:
> On Thu, Jan 03, 2008 at 01:54:04PM +0100, Alexander Neundorf wrote:
> > 1) build the executables with RPATH to the build directory, and when
> > installing link them again with the modified RPATH for the install location
> >
> > This works correctly and convenient, but it takes a lot of time (really a lot
> > for big projects).
This surprises me.
I'd have thought that link time would
be small compared to compile time.
> BTW, on Linux, you generally want to avoid RPATH/RUNPATH for the installed
> binaries/libraries, because it is expensive at runtime, ld.so needs to
> search all the paths in RPATH/RUNPATH lists, compared to
> libraries which are just looked up from ld.so.cache. Adding
> /etc/ld.so.conf.d/*.conf snippets for the extra dirs (if you need any) is
> preferrable, provided there are no SONAME clashes.
That suggests a solution:
Use RPATH in the build tree.
Shrink it to nothing in the installed version.
--
Michael hennebry@web.cs.ndsu.NoDak.edu
"I AM DEATH, NOT TAXES. *I* TURN UP ONLY ONCE." -- Death