summaryrefslogtreecommitdiff
path: root/cmake/Modules
diff options
context:
space:
mode:
authorShiva Chen <shiva0217@gmail.com>2018-03-01 07:47:27 +0000
committerShiva Chen <shiva0217@gmail.com>2018-03-01 07:47:27 +0000
commit9008dc9a4e6c3ac1eb7cdd910c8f74099420d911 (patch)
tree5eb0a76d95b65e0798648433450985adee989136 /cmake/Modules
parentcb51fdb0ad4f3c34c5a7212a1b93163a7489fb76 (diff)
[PATCH] [compiler-rt, RISCV] Support builtins for RISC-V
Summary: Support builtins for RISC-V, RV32 and RV64. Reviewers: asb, apazos, mgrang Differential Revision: https://reviews.llvm.org/D42958 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@326420 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake/Modules')
-rw-r--r--cmake/Modules/CompilerRTUtils.cmake9
1 files changed, 9 insertions, 0 deletions
diff --git a/cmake/Modules/CompilerRTUtils.cmake b/cmake/Modules/CompilerRTUtils.cmake
index 9f79a9b92..f567202fa 100644
--- a/cmake/Modules/CompilerRTUtils.cmake
+++ b/cmake/Modules/CompilerRTUtils.cmake
@@ -168,6 +168,7 @@ macro(detect_target_arch)
check_symbol_exists(__mips64__ "" __MIPS64)
check_symbol_exists(__powerpc64__ "" __PPC64)
check_symbol_exists(__powerpc64le__ "" __PPC64LE)
+ check_symbol_exists(__riscv "" __RISCV)
check_symbol_exists(__s390x__ "" __S390X)
check_symbol_exists(__wasm32__ "" __WEBASSEMBLY32)
check_symbol_exists(__wasm64__ "" __WEBASSEMBLY64)
@@ -187,6 +188,14 @@ macro(detect_target_arch)
add_default_target_arch(powerpc64)
elseif(__PPC64LE)
add_default_target_arch(powerpc64le)
+ elseif(__RISCV)
+ if(CMAKE_SIZEOF_VOID_P EQUAL "4")
+ add_default_target_arch(riscv32)
+ elseif(CMAKE_SIZEOF_VOID_P EQUAL "8")
+ add_default_target_arch(riscv64)
+ else()
+ message(FATAL_ERROR "Unsupport XLEN for RISC-V")
+ endif()
elseif(__S390X)
add_default_target_arch(s390x)
elseif(__WEBASSEMBLY32)