[llvm-branch-commits] [llvm] e32cbe9 - [CMake][AIX] Fixing AIX rpath
Tom Stellard via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed May 31 20:05:38 PDT 2023
Author: Qiongsi Wu
Date: 2023-05-31T20:04:34-07:00
New Revision: e32cbe930f5b36cc3e09c1e86a1c03cb6065f22b
URL: https://github.com/llvm/llvm-project/commit/e32cbe930f5b36cc3e09c1e86a1c03cb6065f22b
DIFF: https://github.com/llvm/llvm-project/commit/e32cbe930f5b36cc3e09c1e86a1c03cb6065f22b.diff
LOG: [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)
Added:
Modified:
llvm/cmake/modules/AddLLVM.cmake
Removed:
################################################################################
diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
index e2e2499205d3..93e6d67551de 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}")
More information about the llvm-branch-commits
mailing list