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

David Tenty via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 08:10:54 PDT 2020


Author: David Tenty
Date: 2020-09-22T11:10:47-04:00
New Revision: 89074bdc813a0e8bd9ff5e69e76b134dc7ae1bd9

URL: https://github.com/llvm/llvm-project/commit/89074bdc813a0e8bd9ff5e69e76b134dc7ae1bd9
DIFF: https://github.com/llvm/llvm-project/commit/89074bdc813a0e8bd9ff5e69e76b134dc7ae1bd9.diff

LOG: [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

Added: 
    

Modified: 
    compiler-rt/CMakeLists.txt
    compiler-rt/lib/builtins/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt
index 9967e293749b..c59b4456cd45 100644
--- a/compiler-rt/CMakeLists.txt
+++ b/compiler-rt/CMakeLists.txt
@@ -482,6 +482,15 @@ if (CMAKE_LINKER MATCHES "link.exe$")
   set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /IGNORE:4221")
 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)
 
 option(COMPILER_RT_USE_LIBCXX

diff  --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt
index 3c50df179764..2fee436d9469 100644
--- a/compiler-rt/lib/builtins/CMakeLists.txt
+++ b/compiler-rt/lib/builtins/CMakeLists.txt
@@ -24,6 +24,15 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
     include(UseLibtool)
   endif()
   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()
 
 if (COMPILER_RT_STANDALONE_BUILD)


        


More information about the llvm-commits mailing list