Skip to content

Commit 887828d

Browse files
author
Qiongsi Wu
committed
[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 f10153f commit 887828d

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
@@ -2336,8 +2336,7 @@ function(llvm_setup_rpath name)
23362336
# Since BUILD_SHARED_LIBS is only recommended for use by developers,
23372337
# hardcode the rpath to build/install lib dir first in this mode.
23382338
# FIXME: update this when there is better solution.
2339-
set(_build_rpath "${LLVM_LIBRARY_OUTPUT_INTDIR}" ${extra_libdir})
2340-
set(_install_rpath "${CMAKE_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}")
2339+
set(_install_rpath "${LLVM_LIBRARY_OUTPUT_INTDIR}" "${CMAKE_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
23412340
elseif(UNIX)
23422341
set(_build_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
23432342
set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}")
@@ -2355,9 +2354,11 @@ function(llvm_setup_rpath name)
23552354
endif()
23562355

23572356
# Enable BUILD_WITH_INSTALL_RPATH unless CMAKE_BUILD_RPATH is set and not
2358-
# building for macOS or Windows, as those two platforms seemingly require it.
2357+
# building for macOS or AIX, as those platforms seemingly require it.
2358+
# On AIX, the tool chain doesn't support modifying rpaths/libpaths for XCOFF
2359+
# on install at the moment, so BUILD_WITH_INSTALL_RPATH is required.
23592360
if("${CMAKE_BUILD_RPATH}" STREQUAL "")
2360-
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin|Windows")
2361+
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin|AIX")
23612362
set_property(TARGET ${name} PROPERTY BUILD_WITH_INSTALL_RPATH ON)
23622363
else()
23632364
set_property(TARGET ${name} APPEND PROPERTY BUILD_RPATH "${_build_rpath}")

0 commit comments

Comments
 (0)