summaryrefslogtreecommitdiffstats
path: root/compiler-rt/cmake/Modules
diff options
context:
space:
mode:
authorRainer Orth <ro@gcc.gnu.org>2019-07-12 08:30:17 +0000
committerRainer Orth <ro@gcc.gnu.org>2019-07-12 08:30:17 +0000
commit4a9a772f44bfcd5d3387cce61e140cfd7e54f913 (patch)
treeaba46a24914d83065a4d4c3d4ac7f7c1b95c6fbf /compiler-rt/cmake/Modules
parent56f2f1cdb36a152a0f5f03aa6b379e2dd9d9cedc (diff)
downloadbcm5719-llvm-4a9a772f44bfcd5d3387cce61e140cfd7e54f913.tar.gz
bcm5719-llvm-4a9a772f44bfcd5d3387cce61e140cfd7e54f913.zip
Enable compiler-rt on SPARC
This patch enables compiler-rt on SPARC targets. Most of the changes are straightforward: - Add 32 and 64-bit sparc to compiler-rt - lib/builtins/fp_lib.h needed to check if the int128_t and uint128_t types exist (which they don't on sparc) There's one issue of note: many asan tests fail to compile on Solaris/SPARC: fatal error: error in backend: Function "_ZN7testing8internal16BoolFromGTestEnvEPKcb": over-aligned dynamic alloca not supported. Therefore, while asan is still built, both asan and ubsan-with-asan testing is disabled. The goal is to check if asan keeps compiling on Solaris/SPARC. This serves asan in gcc, which doesn't have the problem above and works just fine. With this patch, sparcv9-sun-solaris2.11 test results are pretty good: Failing Tests (9): Builtins-sparc-sunos :: divtc3_test.c Builtins-sparcv9-sunos :: compiler_rt_logbl_test.c Builtins-sparcv9-sunos :: divtc3_test.c [...] UBSan-Standalone-sparc :: TestCases/TypeCheck/misaligned.cpp UBSan-Standalone-sparcv9 :: TestCases/TypeCheck/misaligned.cpp The builtin failures are due to Bugs 42493 and 42496. The tree contained a few additonal patches either currently in review or about to be submitted. Tested on sparcv9-sun-solaris2.11. Differential Revision: https://reviews.llvm.org/D40943 llvm-svn: 365880
Diffstat (limited to 'compiler-rt/cmake/Modules')
-rw-r--r--compiler-rt/cmake/Modules/CompilerRTUtils.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler-rt/cmake/Modules/CompilerRTUtils.cmake b/compiler-rt/cmake/Modules/CompilerRTUtils.cmake
index 4fa14512036..6e672b1e181 100644
--- a/compiler-rt/cmake/Modules/CompilerRTUtils.cmake
+++ b/compiler-rt/cmake/Modules/CompilerRTUtils.cmake
@@ -162,6 +162,8 @@ macro(detect_target_arch)
check_symbol_exists(__powerpc64le__ "" __PPC64LE)
check_symbol_exists(__riscv "" __RISCV)
check_symbol_exists(__s390x__ "" __S390X)
+ check_symbol_exists(__sparc "" __SPARC)
+ check_symbol_exists(__sparcv9 "" __SPARCV9)
check_symbol_exists(__wasm32__ "" __WEBASSEMBLY32)
check_symbol_exists(__wasm64__ "" __WEBASSEMBLY64)
if(__ARM)
@@ -190,6 +192,10 @@ macro(detect_target_arch)
endif()
elseif(__S390X)
add_default_target_arch(s390x)
+ elseif(__SPARCV9)
+ add_default_target_arch(sparcv9)
+ elseif(__SPARC)
+ add_default_target_arch(sparc)
elseif(__WEBASSEMBLY32)
add_default_target_arch(wasm32)
elseif(__WEBASSEMBLY64)
OpenPOWER on IntegriCloud