Skip to content

Commit 31aebff

Browse files
Qiongsi Wufinagolfin
Qiongsi Wu
authored andcommitted
[CMake][AIX] Fixing AIX rpath
Recent commit llvm@8f833f8 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
1 parent 610fa75 commit 31aebff

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

llvm/cmake/modules/AddLLVM.cmake

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2315,8 +2315,7 @@ function(llvm_setup_rpath name)
23152315
# Since BUILD_SHARED_LIBS is only recommended for use by developers,
23162316
# hardcode the rpath to build/install lib dir first in this mode.
23172317
# FIXME: update this when there is better solution.
2318-
set(_build_rpath "${LLVM_LIBRARY_OUTPUT_INTDIR}" ${extra_libdir})
2319-
set(_install_rpath "${CMAKE_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}")
2318+
set(_install_rpath "${LLVM_LIBRARY_OUTPUT_INTDIR}" "${CMAKE_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
23202319
elseif(UNIX)
23212320
set(_build_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
23222321
set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}")
@@ -2334,9 +2333,11 @@ function(llvm_setup_rpath name)
23342333
endif()
23352334

23362335
# Enable BUILD_WITH_INSTALL_RPATH unless CMAKE_BUILD_RPATH is set and not
2337-
# building for macOS or Windows, as those two platforms seemingly require it.
2336+
# building for macOS or AIX, as those platforms seemingly require it.
2337+
# On AIX, the tool chain doesn't support modifying rpaths/libpaths for XCOFF
2338+
# on install at the moment, so BUILD_WITH_INSTALL_RPATH is required.
23382339
if("${CMAKE_BUILD_RPATH}" STREQUAL "")
2339-
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin|Windows")
2340+
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin|AIX")
23402341
set_property(TARGET ${name} PROPERTY BUILD_WITH_INSTALL_RPATH ON)
23412342
else()
23422343
set_property(TARGET ${name} APPEND PROPERTY BUILD_RPATH "${_build_rpath}")

0 commit comments

Comments
 (0)