install(TARGETS): Unnecessary file(RPATH_CHANGE) on .so "NAMELINK"
INSTALL_RPATH disregards that an SO could be a linker script, not an ELF, and fails.
file(RPATH_CHANGE)
breaks on linker scripts named as .so files.
Here's the example:
FAILED: libcxx/src/CMakeFiles/install-cxx /home/tcwg-buildbot/worker/linaro-armv8-libcxx-03/llvm-project/libcxx-ci/build/armv8/libcxx/src/CMakeFiles/install-cxx
cd /home/tcwg-buildbot/worker/linaro-armv8-libcxx-03/llvm-project/libcxx-ci/build/armv8/libcxx/src && /usr/local/bin/cmake -DCMAKE_INSTALL_COMPONENT=cxx -P /home/tcwg-buildbot/worker/linaro-armv8-libcxx-03/llvm-project/libcxx-ci/build/armv8/libcxx/cmake_install.cmake
-- Install configuration: "RelWithDebInfo"
-- Installing: /home/tcwg-buildbot/worker/linaro-armv8-libcxx-03/llvm-project/libcxx-ci/build/armv8/install/lib/libc++.so.1.0
-- Installing: /home/tcwg-buildbot/worker/linaro-armv8-libcxx-03/llvm-project/libcxx-ci/build/armv8/install/lib/libc++.so.1
-- Set runtime path of "/home/tcwg-buildbot/worker/linaro-armv8-libcxx-03/llvm-project/libcxx-ci/build/armv8/install/lib/libc++.so.1.0" to "$ORIGIN"
-- Installing: /home/tcwg-buildbot/worker/linaro-armv8-libcxx-03/llvm-project/libcxx-ci/build/armv8/install/lib/libc++.so
CMake Error at cmake_install.cmake:88 (file):
file RPATH_CHANGE could not write new RPATH:
$ORIGIN
to the file:
/home/tcwg-buildbot/worker/linaro-armv8-libcxx-03/llvm-project/libcxx-ci/build/armv8/install/lib/libc++.so
The file format is not recognized.
Call Stack (most recent call first):
/home/tcwg-buildbot/worker/linaro-armv8-libcxx-03/llvm-project/libcxx-ci/build/armv8/libcxx/cmake_install.cmake:48 (include)
The LLVM's libc++.so is a linker script, i.e. not an ELF file, which is a totally valid situation.
There should not be an attempt to set an RPATH on an SO that is not an ELF.
Edited by Brad King