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
199
199
set (LIBOMPTARGET_ALL_TARGETS "${LIBOMPTARGET_ALL_TARGETS} nvptx64-nvidia-cuda-JIT-LTO" )
200
200
set (LIBOMPTARGET_ALL_TARGETS "${LIBOMPTARGET_ALL_TARGETS} s390x-ibm-linux-gnu" )
201
201
set (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" )
202
204
203
205
# Once the plugins for the different targets are validated, they will be added to
204
206
# 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() {
45
45
return EM_AARCH64;
46
46
#elif defined(__powerpc64__)
47
47
return EM_PPC64;
48
+ #elif defined(__riscv)
49
+ return EM_RISCV;
48
50
#else
49
51
#warning "Unknown ELF compilation target architecture"
50
52
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 )
2
2
if (NOT ${CMAKE_SYSTEM_PROCESSOR} IN_LIST supported_targets )
3
3
message (STATUS "Not building ${machine} NextGen offloading plugin" )
4
4
return ()
@@ -59,4 +59,8 @@ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "s390x$")
59
59
list (APPEND LIBOMPTARGET_SYSTEM_TARGETS
60
60
"s390x-ibm-linux-gnu" "s390x-ibm-linux-gnu-LTO" )
61
61
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 )
62
66
endif ()
Original file line number Diff line number Diff line change @@ -43,7 +43,8 @@ typedef enum {
43
43
typedef enum ffi_abi {
44
44
#if (defined(_M_X64 ) || defined(__x86_64__ ))
45
45
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 )
47
48
FFI_DEFAULT_ABI = 1 , // FFI_SYSV.
48
49
#elif defined(__powerpc64__ )
49
50
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 {
440
440
#else
441
441
return llvm::Triple::ppc64;
442
442
#endif
443
+ #elif defined(__riscv) && (__riscv_xlen == 64)
444
+ return llvm::Triple::riscv64;
443
445
#else
444
446
return llvm::Triple::UnknownArch;
445
447
#endif
You can’t perform that action at this time.
0 commit comments