RPATH_CHANGE fails when shared object is a GNU ld script
From LLVM build:
if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xcxxx" OR NOT CMAKE_INSTALL_COMPONENT)
if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libc++.so" AND
NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libc++.so")
file(RPATH_CHECK
FILE "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libc++.so"
RPATH "")
endif()
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" TYPE SHARED_LIBRARY FILES "/home/user/llvm/llvm.stage1.build/lib/libc++.so")
if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libc++.so" AND
NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libc++.so")
file(RPATH_CHANGE
FILE "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libc++.so"
OLD_RPATH "/home/user/llvm/llvm.stage1.build/lib:"
NEW_RPATH "")
if(CMAKE_INSTALL_DO_STRIP)
execute_process(COMMAND "/usr/bin/strip" "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libc++.so")
endif()
endif()
endif()
-- Installing: /home/user/llvm/llvm.stage1.bin/lib/libc++.so
CMake Error at projects/libcxx/src/cmake_install.cmake:88 (file):
file RPATH_CHANGE could not write new RPATH:
to the file:
/home/user/llvm/llvm.stage1.bin/lib/libc++.so
Call Stack (most recent call first):
projects/libcxx/cmake_install.cmake:56 (include)
projects/cmake_install.cmake:49 (include)
cmake_install.cmake:76 (include)
FAILED: CMakeFiles/install.util
cd /home/user/llvm/llvm.stage1.build && /usr/bin/cmake -P cmake_install.cmake
$ cat llvm.stage1.bin/lib/libc++.so
INPUT(libc++.so.1 -lc++abi)