Skip to content

Commit

Permalink
runtime: allow cross-compilation to loongarch64
Browse files Browse the repository at this point in the history
Signed-off-by: WANG Xuerui <[email protected]>
  • Loading branch information
xen0n committed Nov 17, 2024
1 parent a2bc464 commit b4c2c28
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/runtime/eng/common/cross/toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ elseif(TARGET_ARCH_NAME STREQUAL "armv6")
else()
set(TOOLCHAIN "arm-linux-gnueabihf")
endif()
elseif(TARGET_ARCH_NAME STREQUAL "loongarch64")
set(CMAKE_SYSTEM_PROCESSOR loongarch64)
set(TOOLCHAIN "loongarch64-linux-gnu")
elseif(TARGET_ARCH_NAME STREQUAL "ppc64le")
set(CMAKE_SYSTEM_PROCESSOR ppc64le)
if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/powerpc64le-alpine-linux-musl)
Expand Down Expand Up @@ -118,7 +121,7 @@ elseif(TARGET_ARCH_NAME STREQUAL "x86")
set(TIZEN_TOOLCHAIN "i586-tizen-linux-gnu/9.2.0")
endif()
else()
message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only arm, arm64, armel, armv6, ppc64le, riscv64, s390x, x64 and x86 are supported!")
message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only arm, arm64, armel, armv6, loongarch64, ppc64le, riscv64, s390x, x64 and x86 are supported!")
endif()

if(DEFINED ENV{TOOLCHAIN})
Expand Down Expand Up @@ -312,7 +315,7 @@ endif()

# Specify compile options

if((TARGET_ARCH_NAME MATCHES "^(arm|arm64|armel|armv6|ppc64le|riscv64|s390x|x64|x86)$" AND NOT ANDROID AND NOT FREEBSD) OR ILLUMOS OR HAIKU)
if((TARGET_ARCH_NAME MATCHES "^(arm|arm64|armel|armv6|loongarch64|ppc64le|riscv64|s390x|x64|x86)$" AND NOT ANDROID AND NOT FREEBSD) OR ILLUMOS OR HAIKU)
set(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN})
set(CMAKE_CXX_COMPILER_TARGET ${TOOLCHAIN})
set(CMAKE_ASM_COMPILER_TARGET ${TOOLCHAIN})
Expand Down

0 comments on commit b4c2c28

Please sign in to comment.