diff --git a/llvm/tools/lto/CMakeLists.txt b/llvm/tools/lto/CMakeLists.txt --- a/llvm/tools/lto/CMakeLists.txt +++ b/llvm/tools/lto/CMakeLists.txt @@ -21,7 +21,15 @@ set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/lto.exports) -add_llvm_library(LTO SHARED INSTALL_WITH_TOOLCHAIN ${SOURCES} DEPENDS +if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.16.0" AND CMAKE_SYSTEM_NAME STREQUAL AIX) + set(LTO_LIBRARY_TYPE MODULE) + set(LTO_LIBRARY_NAME libLTO) + else() + set(LTO_LIBRARY_TYPE SHARED) + set(LTO_LIBRARY_NAME LTO) +endif() + +add_llvm_library(${LTO_LIBRARY_NAME} ${LTO_LIBRARY_TYPE} INSTALL_WITH_TOOLCHAIN ${SOURCES} DEPENDS intrinsics_gen) install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/lto.h