diff options
author | Qiongsi Wu <qwu@ibm.com> | 2023-04-21 11:31:46 -0400 |
---|---|---|
committer | Tom Stellard <tstellar@redhat.com> | 2023-05-31 20:04:34 -0700 |
commit | e32cbe930f5b36cc3e09c1e86a1c03cb6065f22b (patch) | |
tree | f04ee57e00efa5feeadc3eda7fae9f538056a32b | |
parent | b98da4c71edda3df0a0555b1ab63ec52e92252b4 (diff) | |
download | llvm-e32cbe930f5b36cc3e09c1e86a1c03cb6065f22b.zip llvm-e32cbe930f5b36cc3e09c1e86a1c03cb6065f22b.tar.gz llvm-e32cbe930f5b36cc3e09c1e86a1c03cb6065f22b.tar.bz2 |
[CMake][AIX] Fixing AIX rpath
Recent commit https://github.com/llvm/llvm-project/commit/8f833f88ab78265a8e0ebb0d1522771d67c708a9 modified the installation rpath and did not set `BUILD_WITH_INSTALL_RPATH` correctly on AIX, which led to installation failures on AIX. This patch sets `BUILD_WITH_INSTALL_RPATH` on AIX to fix the installation failures.
Reviewed By: buttaface, daltenty
Differential Revision: https://reviews.llvm.org/D148866
(cherry picked from commit 887828d502b49a09e56551e370cc6c1555ae3ff4)
-rw-r--r-- | llvm/cmake/modules/AddLLVM.cmake | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake index e2e2499..93e6d67 100644 --- a/llvm/cmake/modules/AddLLVM.cmake +++ b/llvm/cmake/modules/AddLLVM.cmake @@ -2318,8 +2318,7 @@ function(llvm_setup_rpath name) # Since BUILD_SHARED_LIBS is only recommended for use by developers, # hardcode the rpath to build/install lib dir first in this mode. # FIXME: update this when there is better solution. - set(_build_rpath "${LLVM_LIBRARY_OUTPUT_INTDIR}" ${extra_libdir}) - set(_install_rpath "${CMAKE_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}") + set(_install_rpath "${LLVM_LIBRARY_OUTPUT_INTDIR}" "${CMAKE_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) elseif(UNIX) set(_build_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}") @@ -2337,9 +2336,11 @@ function(llvm_setup_rpath name) endif() # Enable BUILD_WITH_INSTALL_RPATH unless CMAKE_BUILD_RPATH is set and not - # building for macOS or Windows, as those two platforms seemingly require it. + # building for macOS or AIX, as those platforms seemingly require it. + # On AIX, the tool chain doesn't support modifying rpaths/libpaths for XCOFF + # on install at the moment, so BUILD_WITH_INSTALL_RPATH is required. if("${CMAKE_BUILD_RPATH}" STREQUAL "") - if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin|Windows") + if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin|AIX") set_property(TARGET ${name} PROPERTY BUILD_WITH_INSTALL_RPATH ON) else() set_property(TARGET ${name} APPEND PROPERTY BUILD_RPATH "${_build_rpath}") |