Rafael Avila de Espindola
2014-Feb-13 20:58 UTC
[LLVMdev] llvm trunk build failed in cmake_install.cmake on ARM platform
We try to change cmake's behaviour so that it uses $ORIGIN in the rpath, making the binaries relocatable. That might be falling in here for some reason. Sent from my iPhone> On Feb 12, 2014, at 11:07, Brad King <brad.king at kitware.com> wrote: > >> On 02/12/2014 08:08 AM, Mathias Bauer wrote: >> Hi dear list, >> >> I tried to build llvm+clang on an OpenSuse BuildServer for ARM. The >> build was carried out with CMake 2.8.11. In the installation step I got >> the following error: >> >>> [26815s] -- Installing: /home/abuild/rpmbuild/BUILDROOT/llvm-3.4.99-336.1.arm/usr/lib/libLLVMSupport.so >>> [26815s] CMake Error at lib/Support/cmake_install.cmake:45 (FILE): >>> [26815s] file RPATH_CHANGE could not write new RPATH: >>> [26815s] >>> [26815s] $ORIGIN/../lib >>> [26815s] >>> [26815s] to the file: >>> [26815s] >>> [26815s] /home/abuild/rpmbuild/BUILDROOT/llvm-3.4.99-336.1.arm/usr/lib/libLLVMSupport.so >>> [26815s] >>> [26815s] No valid ELF RPATH or RUNPATH entry exists in the file; > > CMake by default links binaries in the build tree such that they can > be run immediately with no special environment by using RPATH/RUNPATH. > Then at installation time it has a builtin ELF editor that replaces > the build-tree RPATH with one for the install tree as specified by > the INSTALL_RPATH target property: > > http://www.cmake.org/cmake/help/v2.8.12/cmake.html#prop_tgt:INSTALL_RPATH > > When the desired install-tree RPATH is longer than the build tree > one then CMake adds bogus content to the end of the RPATH value for > the build tree to reserve space. > > I'm not familiar with the tools for the platform in question, but > some linkers have a security feature that drops RPATH values that > are invalid. This sometimes trips up CMake's attempt at reserving > space for the install-tree RPATH. One may work around the problem > by telling CMake to build directly with the install-tree RPATH: > > http://www.cmake.org/cmake/help/v2.8.12/cmake.html#variable:CMAKE_BUILD_WITH_INSTALL_RPATH > http://www.cmake.org/cmake/help/v2.8.12/cmake.html#prop_tgt:BUILD_WITH_INSTALL_RPATH > > The cost is one may not be able to run the binaries from the build > tree. To set this for the whole build without modifying the source, > just add -DCMAKE_BUILD_WITH_INSTALL_RPATH=1 to the cmake command line > when configuring the project. > > -Brad > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Brad King
2014-Feb-14 18:41 UTC
[LLVMdev] llvm trunk build failed in cmake_install.cmake on ARM platform
On 2/13/2014 3:58 PM, Rafael Avila de Espindola wrote:> We try to change cmake's behaviour so that it uses $ORIGIN > in the rpath, making the binaries relocatable. That might > be falling in here for some reason.Yes, we can see from the reported output:>>>> [26815s] -- Installing: /home/abuild/rpmbuild/BUILDROOT/llvm-3.4.99-336.1.arm/usr/lib/libLLVMSupport.so >>>> [26815s] CMake Error at lib/Support/cmake_install.cmake:45 (FILE): >>>> [26815s] file RPATH_CHANGE could not write new RPATH: >>>> [26815s] >>>> [26815s] $ORIGIN/../lib >>>> [26815s] >>>> [26815s] to the file: >>>> [26815s] >>>> [26815s] /home/abuild/rpmbuild/BUILDROOT/llvm-3.4.99-336.1.arm/usr/lib/libLLVMSupport.so >>>> [26815s] >>>> [26815s] No valid ELF RPATH or RUNPATH entry exists in the file;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:>> just add -DCMAKE_BUILD_WITH_INSTALL_RPATH=1 to the cmake command lineWe need to know whether this works. Either way, we also need to see what the linker command line used to create the binary in the build tree looks like. -Brad
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
Apparently Analagous Threads
- [LLVMdev] llvm trunk build failed in cmake_install.cmake on ARM platform
- [LLVMdev] llvm trunk build failed in cmake_install.cmake on ARM platform
- [Release-testers] [6.0.0 Release] The final tag is in
- [Release-testers] [6.0.0 Release] The final tag is in
- [Release-testers] [6.0.0 Release] The final tag is in