File tree Expand file tree Collapse file tree 5 files changed +13
-2
lines changed Expand file tree Collapse file tree 5 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -199,6 +199,8 @@ set (LIBOMPTARGET_ALL_TARGETS "${LIBOMPTARGET_ALL_TARGETS} nvptx64-nvidia-cuda-L
199199set (LIBOMPTARGET_ALL_TARGETS "${LIBOMPTARGET_ALL_TARGETS} nvptx64-nvidia-cuda-JIT-LTO" )
200200set (LIBOMPTARGET_ALL_TARGETS "${LIBOMPTARGET_ALL_TARGETS} s390x-ibm-linux-gnu" )
201201set (LIBOMPTARGET_ALL_TARGETS "${LIBOMPTARGET_ALL_TARGETS} s390x-ibm-linux-gnu-LTO" )
202+ set (LIBOMPTARGET_ALL_TARGETS "${LIBOMPTARGET_ALL_TARGETS} riscv64-unknown-linux-gnu" )
203+ set (LIBOMPTARGET_ALL_TARGETS "${LIBOMPTARGET_ALL_TARGETS} riscv64-unknown-linux-gnu-LTO" )
202204
203205# Once the plugins for the different targets are validated, they will be added to
204206# the list of supported targets in the current system.
Original file line number Diff line number Diff line change @@ -45,6 +45,8 @@ uint16_t utils::elf::getTargetMachine() {
4545 return EM_AARCH64;
4646#elif defined(__powerpc64__)
4747 return EM_PPC64;
48+ #elif defined(__riscv)
49+ return EM_RISCV;
4850#else
4951#warning "Unknown ELF compilation target architecture"
5052 return EM_NONE;
Original file line number Diff line number Diff line change 1- set (supported_targets x86_64 aarch64 ppc64 ppc64le s390x)
1+ set (supported_targets x86_64 aarch64 ppc64 ppc64le riscv64 s390x)
22if (NOT ${CMAKE_SYSTEM_PROCESSOR} IN_LIST supported_targets)
33 message (STATUS "Not building ${machine} NextGen offloading plugin" )
44 return ()
@@ -59,4 +59,8 @@ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "s390x$")
5959 list (APPEND LIBOMPTARGET_SYSTEM_TARGETS
6060 "s390x-ibm-linux-gnu" "s390x-ibm-linux-gnu-LTO" )
6161 set (LIBOMPTARGET_SYSTEM_TARGETS "${LIBOMPTARGET_SYSTEM_TARGETS} " PARENT_SCOPE)
62+ elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "riscv64$" )
63+ list (APPEND LIBOMPTARGET_SYSTEM_TARGETS
64+ "riscv64-unknown-linux-gnu" "riscv64-unknown-linux-gnu-LTO" )
65+ set (LIBOMPTARGET_SYSTEM_TARGETS "${LIBOMPTARGET_SYSTEM_TARGETS} " PARENT_SCOPE)
6266endif ()
Original file line number Diff line number Diff line change @@ -43,7 +43,8 @@ typedef enum {
4343typedef enum ffi_abi {
4444#if (defined(_M_X64 ) || defined(__x86_64__ ))
4545 FFI_DEFAULT_ABI = 2 , // FFI_UNIX64.
46- #elif defined(__aarch64__ ) || defined(__arm64__ ) || defined(_M_ARM64 )
46+ #elif defined(__aarch64__ ) || defined(__arm64__ ) || defined(_M_ARM64 ) || \
47+ defined(__riscv )
4748 FFI_DEFAULT_ABI = 1 , // FFI_SYSV.
4849#elif defined(__powerpc64__ )
4950 FFI_DEFAULT_ABI = 8 , // FFI_LINUX.
Original file line number Diff line number Diff line change @@ -440,6 +440,8 @@ struct GenELF64PluginTy final : public GenericPluginTy {
440440#else
441441 return llvm::Triple::ppc64;
442442#endif
443+ #elif defined(__riscv) && (__riscv_xlen == 64)
444+ return llvm::Triple::riscv64;
443445#else
444446 return llvm::Triple::UnknownArch;
445447#endif
You can’t perform that action at this time.
0 commit comments