[CMake] YARI (yet another RPATH idea)

Alexander Neundorf a.neundorf-work at gmx.net
Fri Jul 7 10:45:45 EDT 2006


-------- Original-Nachricht --------
Datum: Fri, 07 Jul 2006 10:28:01 -0400
Von: Brad King <brad.king at kitware.com>
An: Alexander Neundorf <a.neundorf-work at gmx.net>
Betreff: Re: [CMake] YARI (yet another RPATH idea)

> Alexander Neundorf wrote:
> > it's me again, again with my favourite topic: RPATH.
> > On the Mac there is the install name tool, and now I found a similar
> tool for ELF systems, chrpath.
> > chrpath is able to:
> > 1) remove the RPATH from a executable or library
> > 2) change the RPATH to a RUNPATH
> > 3) replace the RPATH with another RPATH, but the new one may not be
> longer than the existing one.
> > 
> > With this nice tool the need for relinking can be avoided, but only if
> the already existing RPATH is long enough for the new RPATH.
> > Maybe this could be supported somewhat similar to install_name_tool ?
> 
> Since the tool is not provided with the native build tools on ELF 
> systems (such as part of binutils) I'm hesitant to make it a first-class 
> CMake feature.  It looks like the tool could be used on a per-project 
> basis with an INSTALL(SCRIPT) to run the tool on an already-installed 
> binary just after installing it.

Yes, I think this should be possible. The only issue is that the existing RPATH must be long enough to hold the new RPATH too.
It seems it is currently not possible to tell cmake to add a directory to the build RPATH, if I set the INSTALL_RPATH to something and BUILD_WITH_INSTALL_RPATH to TRUE, it builds with only the INSTALL_RPATH.

Just a way to make sure that the RPATH string which is used when building is at least as long as the INSTALL_RPATH would be needed I think.
(I don't know if it is possible to hand some dummy path to the linker, or something like "/////////////////", or an empty string "              " or e.g. /i/really/do/not/exist/but/have/a/long/name/" or whether it is possible to tell the linker to reserve at least XXX bytes for the RPATH entry).

What cmake with the RPATH and the relinking does is really cool, it only has the drawback that the relinking takes a lot of time, and this can be avoided with a tool like this.
Maybe I could contact the objcopy maintainer (whoever this is) to add this functionality too.

Bye
Alex

-- 


Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer


More information about the CMake mailing list