Skip to content

Commit 1106644

Browse files
committed
[AIX][CMake] Use top-level tools in llvm_ExternalProject_Add
This change force us to use the top-level CMake's detected tools. We need to do this as a temporary workaround as when using CMake versions >= 3.22 we'll pickup the built llvm-ranlib by default if it's in the path (which it is when doing a sub build via llvm_ExternalProject_Add for the runtimes). llvm-ranlib runs into problems on AIX due to missing 64-bit functionality to be added by https://reviews.llvm.org/D142479 and https://reviews.llvm.org/D142660. Once those patches land, this can be reverted. Differential Revision: https://reviews.llvm.org/D142727
1 parent 8b1cd37 commit 1106644

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

llvm/cmake/modules/LLVMExternalProjectUtils.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ function(llvm_ExternalProject_Add name source_dir)
239239
set(sysroot_arg -DCMAKE_SYSROOT=${CMAKE_SYSROOT})
240240
endif()
241241

242-
if(CMAKE_CROSSCOMPILING)
242+
if(CMAKE_CROSSCOMPILING OR _cmake_system_name STREQUAL AIX)
243243
set(compiler_args -DCMAKE_ASM_COMPILER=${CMAKE_ASM_COMPILER}
244244
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
245245
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
@@ -251,6 +251,8 @@ function(llvm_ExternalProject_Add name source_dir)
251251
-DCMAKE_OBJDUMP=${CMAKE_OBJDUMP}
252252
-DCMAKE_STRIP=${CMAKE_STRIP}
253253
-DCMAKE_READELF=${CMAKE_READELF})
254+
endif()
255+
if(CMAKE_CROSSCOMPILING)
254256
set(llvm_config_path ${LLVM_CONFIG_PATH})
255257

256258
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")

0 commit comments

Comments
 (0)