Skip to content

Commit 8f24a56

Browse files
krajMaskRay
authored andcommitted
[compiler-rt][CMake] Enable TF intrinsics on powerpc32 Linux
clang generates calls to these intrinsics when used for ppc32/linux, when using libgcc this works ok but when using compiler-rt for rtlib it fails with missing intrinsic symbols. also see [1] [1] https://lists.llvm.org/pipermail/llvm-dev/2014-May/072784.html Reviewed By: MaskRay, glaubitz Differential Revision: https://reviews.llvm.org/D121379
1 parent b33aeee commit 8f24a56

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

compiler-rt/lib/builtins/CMakeLists.txt

+7-9
Original file line numberDiff line numberDiff line change
@@ -621,11 +621,9 @@ set(mips64_SOURCES ${GENERIC_TF_SOURCES}
621621
set(mips64el_SOURCES ${GENERIC_TF_SOURCES}
622622
${mips_SOURCES})
623623

624-
set(powerpc_SOURCES ${GENERIC_SOURCES})
625-
626624
set(powerpcspe_SOURCES ${GENERIC_SOURCES})
627625

628-
set(powerpc64_SOURCES
626+
set(powerpc_SOURCES
629627
ppc/divtc3.c
630628
ppc/fixtfdi.c
631629
ppc/fixunstfdi.c
@@ -640,14 +638,15 @@ set(powerpc64_SOURCES
640638
)
641639
# These routines require __int128, which isn't supported on AIX.
642640
if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "AIX")
643-
set(powerpc64_SOURCES
641+
set(powerpc_SOURCES
644642
ppc/floattitf.c
645643
ppc/fixtfti.c
646644
ppc/fixunstfti.c
647-
${powerpc64_SOURCES}
645+
${powerpc_SOURCES}
648646
)
649647
endif()
650-
set(powerpc64le_SOURCES ${powerpc64_SOURCES})
648+
set(powerpc64le_SOURCES ${powerpc_SOURCES})
649+
set(powerpc64_SOURCES ${powerpc_SOURCES})
651650

652651
set(riscv_SOURCES
653652
riscv/save.S
@@ -754,9 +753,8 @@ else ()
754753
list(APPEND BUILTIN_CFLAGS_${arch} -fomit-frame-pointer -DCOMPILER_RT_ARMHF_TARGET)
755754
endif()
756755

757-
# For RISCV32, we must force enable int128 for compiling long
758-
# double routines.
759-
if("${arch}" STREQUAL "riscv32")
756+
# For some arches, force enable int128 for compiling long double routines.
757+
if("${arch}" STREQUAL "powerpc" OR "${arch}" STREQUAL "riscv32")
760758
list(APPEND BUILTIN_CFLAGS_${arch} -fforce-enable-int128)
761759
endif()
762760

compiler-rt/lib/builtins/int_types.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ typedef union {
6464
} udwords;
6565

6666
#if defined(__LP64__) || defined(__wasm__) || defined(__mips64) || \
67-
defined(__riscv) || defined(_WIN64)
67+
defined(__riscv) || defined(_WIN64) || defined(__powerpc__)
6868
#define CRT_HAS_128BIT
6969
#endif
7070

0 commit comments

Comments
 (0)