[compiler-rt] c455961 - [compiler-rt][AIX] Add CMake support for 32-bit Power builds
David Tenty via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 22 13:09:05 PDT 2020
Author: David Tenty
Date: 2020-09-22T16:08:58-04:00
New Revision: c45596147938191b0ffde91ee8d506e315bf4c8f
URL: https://github.com/llvm/llvm-project/commit/c45596147938191b0ffde91ee8d506e315bf4c8f
DIFF: https://github.com/llvm/llvm-project/commit/c45596147938191b0ffde91ee8d506e315bf4c8f.diff
LOG: [compiler-rt][AIX] Add CMake support for 32-bit Power builds
This patch enables support for building compiler-rt builtins for 32-bit
Power arch on AIX. For now, we leave out the specialized ppc builtin
implementations for 128-bit long double and friends since those will
need some special handling for AIX.
Reviewed By: hubert.reinterpretcast
Differential Revision: https://reviews.llvm.org/D87383
Added:
Modified:
compiler-rt/cmake/Modules/CompilerRTUtils.cmake
compiler-rt/cmake/base-config-ix.cmake
compiler-rt/cmake/builtin-config-ix.cmake
compiler-rt/lib/builtins/CMakeLists.txt
Removed:
################################################################################
diff --git a/compiler-rt/cmake/Modules/CompilerRTUtils.cmake b/compiler-rt/cmake/Modules/CompilerRTUtils.cmake
index 99b9f0e4af44..f61d487e93a0 100644
--- a/compiler-rt/cmake/Modules/CompilerRTUtils.cmake
+++ b/compiler-rt/cmake/Modules/CompilerRTUtils.cmake
@@ -158,6 +158,7 @@ macro(detect_target_arch)
check_symbol_exists(__i386__ "" __I386)
check_symbol_exists(__mips__ "" __MIPS)
check_symbol_exists(__mips64__ "" __MIPS64)
+ check_symbol_exists(__powerpc__ "" __PPC)
check_symbol_exists(__powerpc64__ "" __PPC64)
check_symbol_exists(__powerpc64le__ "" __PPC64LE)
check_symbol_exists(__riscv "" __RISCV)
@@ -179,10 +180,12 @@ macro(detect_target_arch)
add_default_target_arch(mips64)
elseif(__MIPS)
add_default_target_arch(mips)
- elseif(__PPC64)
+ elseif(__PPC64) # must be checked before __PPC
add_default_target_arch(powerpc64)
elseif(__PPC64LE)
add_default_target_arch(powerpc64le)
+ elseif(__PPC)
+ add_default_target_arch(powerpc)
elseif(__RISCV)
if(CMAKE_SIZEOF_VOID_P EQUAL "4")
add_default_target_arch(riscv32)
diff --git a/compiler-rt/cmake/base-config-ix.cmake b/compiler-rt/cmake/base-config-ix.cmake
index 964dd598f102..e7f951064bf9 100644
--- a/compiler-rt/cmake/base-config-ix.cmake
+++ b/compiler-rt/cmake/base-config-ix.cmake
@@ -197,7 +197,10 @@ macro(test_targets)
cmake_pop_check_state()
if(HOST_IS_BIG_ENDIAN)
- test_target_arch(powerpc64 "" "-m64")
+ if(CMAKE_SYSTEM_NAME MATCHES "AIX")
+ test_target_arch(powerpc "" "-m32")
+ endif()
+ test_target_arch(powerpc64 "" "-m64")
else()
test_target_arch(powerpc64le "" "-m64")
endif()
diff --git a/compiler-rt/cmake/builtin-config-ix.cmake b/compiler-rt/cmake/builtin-config-ix.cmake
index 8de901513beb..16d82b127878 100644
--- a/compiler-rt/cmake/builtin-config-ix.cmake
+++ b/compiler-rt/cmake/builtin-config-ix.cmake
@@ -30,6 +30,7 @@ set(X86 i386)
set(X86_64 x86_64)
set(MIPS32 mips mipsel)
set(MIPS64 mips64 mips64el)
+set(PPC32 powerpc)
set(PPC64 powerpc64 powerpc64le)
set(RISCV32 riscv32)
set(RISCV64 riscv64)
@@ -47,7 +48,7 @@ endif()
set(ALL_BUILTIN_SUPPORTED_ARCH
${X86} ${X86_64} ${ARM32} ${ARM64}
- ${HEXAGON} ${MIPS32} ${MIPS64} ${PPC64}
+ ${HEXAGON} ${MIPS32} ${MIPS64} ${PPC32} ${PPC64}
${RISCV32} ${RISCV64} ${SPARC} ${SPARCV9}
${WASM32} ${WASM64} ${VE})
diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt
index 2fee436d9469..b54e53417989 100644
--- a/compiler-rt/lib/builtins/CMakeLists.txt
+++ b/compiler-rt/lib/builtins/CMakeLists.txt
@@ -561,6 +561,8 @@ set(mips64_SOURCES ${GENERIC_TF_SOURCES}
set(mips64el_SOURCES ${GENERIC_TF_SOURCES}
${mips_SOURCES})
+set(powerpc_SOURCES ${GENERIC_SOURCES})
+
set(powerpc64_SOURCES
ppc/divtc3.c
ppc/fixtfdi.c
More information about the llvm-commits
mailing list