[AIX][compiler-rt] Use the AR/ranlib mode flag for 32-bit and 64-bit mode

since we will be building both 32-bit and 64-bit compiler-rt builtins
from a single configuration.

Reviewed By: hubert.reinterpretcast

Differential Revision: https://reviews.llvm.org/D87113
This commit is contained in:
David Tenty 2020-01-02 10:11:59 -05:00
parent 7afbf3192d
commit 89074bdc81
2 changed files with 18 additions and 0 deletions

View File

@ -482,6 +482,15 @@ if (CMAKE_LINKER MATCHES "link.exe$")
set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /IGNORE:4221") set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /IGNORE:4221")
endif() endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "AIX")
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> -X32_64 qc <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> -X32_64 qc <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> -X32_64 q <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_CXX_ARCHIVE_APPEND "<CMAKE_AR> -X32_64 q <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -X32_64 <TARGET>")
set(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> -X32_64 <TARGET>")
endif()
add_subdirectory(include) add_subdirectory(include)
option(COMPILER_RT_USE_LIBCXX option(COMPILER_RT_USE_LIBCXX

View File

@ -24,6 +24,15 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
include(UseLibtool) include(UseLibtool)
endif() endif()
include(AddCompilerRT) include(AddCompilerRT)
if(${CMAKE_SYSTEM_NAME} MATCHES "AIX")
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> -X32_64 qc <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> -X32_64 qc <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> -X32_64 q <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_CXX_ARCHIVE_APPEND "<CMAKE_AR> -X32_64 q <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -X32_64 <TARGET>")
set(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> -X32_64 <TARGET>")
endif()
endif() endif()
if (COMPILER_RT_STANDALONE_BUILD) if (COMPILER_RT_STANDALONE_BUILD)