Rafael Espíndola
2014-Feb-14 19:15 UTC
[LLVMdev] llvm trunk build failed in cmake_install.cmake on ARM platform
> that CMake is trying to update the installed binary file's > RPATH to contain the $ORIGIN/../lib value. It complains > that no RPATH field at all is found in the file. The linker > may be dropping it for some reason, which is why I asked > Mathias to try:Btw, an awesome way to fix this would be to set rpath to $ORIGIN/../lib during the link itself. That way it doesn't need to be update during install. Is there a way to do that with cmake? Thanks, Rafael
Brad King
2014-Feb-14 19:32 UTC
[LLVMdev] llvm trunk build failed in cmake_install.cmake on ARM platform
On 2/14/2014 2:15 PM, Rafael Espíndola wrote:> Btw, an awesome way to fix this would be to set rpath to > $ORIGIN/../lib during the link itself. That way it doesn't need to be > update during install. Is there a way to do that with cmake?Use -DCMAKE_BUILD_WITH_INSTALL_RPATH=1 to skip RPATH support for the build tree and link directly with the final installation RPATH. See my first response in this thread for details. However, CMake's install-time RPATH update is a widely used feature that is known to work in general. (On non-ELF systems it even does a preinstall step that re-links the binaries with the installation tree RPATH.) There must be something particular to the ARM platform linker or the way it is being invoked that prevents the RPATH field from appearing in the binary, but we'll have to wait for Mathias to report back. -Brad
Rafael Espíndola
2014-Feb-14 20:01 UTC
[LLVMdev] llvm trunk build failed in cmake_install.cmake on ARM platform
On 14 February 2014 14:32, Brad King <brad.king at kitware.com> wrote:> On 2/14/2014 2:15 PM, Rafael Espíndola wrote: >> Btw, an awesome way to fix this would be to set rpath to >> $ORIGIN/../lib during the link itself. That way it doesn't need to be >> update during install. Is there a way to do that with cmake? > > Use -DCMAKE_BUILD_WITH_INSTALL_RPATH=1 to skip RPATH support for > the build tree and link directly with the final installation RPATH. > See my first response in this thread for details. > > However, CMake's install-time RPATH update is a widely used feature > that is known to work in general. (On non-ELF systems it even does > a preinstall step that re-links the binaries with the installation > tree RPATH.) There must be something particular to the ARM platform > linker or the way it is being invoked that prevents the RPATH field > from appearing in the binary, but we'll have to wait for Mathias to > report back.The point is that it is unnecessary for us. We can always use $ORIGIN. That is what we have been doing with configure for ages. I have just tried the attached patch and it fixes my last remaining reason for using configure! :-) Running "readelf -dW lib/LLVMgold.so" shows 0x000000000000001d (RUNPATH) Library runpath: [$ORIGIN/../lib] Both in the build and in the install directory, which is exactly what we want. I will try to port this to also work on OS X and not break windows and send for code review. Thanks, Rafael -------------- next part -------------- A non-text attachment was scrubbed... Name: t.patch Type: text/x-patch Size: 855 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140214/aa670bee/attachment.bin>