[CMake] strange rpath with lotf of ":"-s

Michael Hertling mhertling at online.de
Thu Jun 9 17:48:40 EDT 2011


On 06/09/2011 01:08 PM, Rolf Eike Beer wrote:
>> Hi,
>>
>> I see strange rpath in binaries inside the build tree, linked in such
>> a way that these can run from the build tree. In some cases the rpath
>> list contains a fairly large amount of ":"-s, sometimes only one at
>> the end. Already one colon is unnecessary (at least in my case), but
>> the case when there are many of them is very strange. After make
>> install-ing the colons are gone, so it's not really a security
>> vulnerability, but it's still strange.
>>
>> Does anyone have any idea whether this is caused by a bug in my
>> CMakeList.txt-s or it's a CMake "feature"?
> 
> If you look closely you will see that both rpaths are of the same length.
> CMake inserts an rpath with lot's of empty settings in the build tree so
> it can simply overwrite this later for the install tree without the need
> to rebuild the file.
> 
> Eike

FYI: This placeholder mechanism is in effect only if an RPATH is
enabled for the installed binaries, e.g. via CMAKE_INSTALL_RPATH,
and it can be switched off by setting CMAKE_NO_BUILTIN_CHRPATH to
TRUE; in the letter case, the final binaries are actually relinked
at installation time instead of being patched with the final RPATH.
See [1] for a related discussion.

Regards,

Michael

[1] http://www.mail-archive.com/cmake@cmake.org/msg35955.html


More information about the CMake mailing list