From 8e7b00111149713fca06ba548edbd419a79fe778 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 5 Jan 2024 00:39:45 +0800 Subject: add more loong64 support --- configure | 2 +- core/src/tbox/tbox | 2 +- xmake/modules/private/detect/find_platform.lua | 2 ++ xmake/platforms/cross/xmake.lua | 2 +- xmake/platforms/linux/xmake.lua | 2 +- xmake/toolchains/zig/xmake.lua | 2 ++ 6 files changed, 8 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 02ca64403..9f4232d50 100755 --- a/configure +++ b/configure @@ -2718,7 +2718,7 @@ Common options: - linux --arch=ARCH Compile for the given architecture. (default: '"${_target_arch_default}"') - msys: i386 x86_64 - - cross: i386 x86_64 arm arm64 mips mips64 riscv riscv64 s390x ppc ppc64 sh4 + - cross: i386 x86_64 arm arm64 mips mips64 riscv riscv64 loong64 s390x ppc ppc64 sh4 - bsd: i386 x86_64 - mingw: i386 x86_64 arm arm64 - macosx: x86_64 arm64 diff --git a/core/src/tbox/tbox b/core/src/tbox/tbox index 1ec4e9222..cf97d353c 160000 --- a/core/src/tbox/tbox +++ b/core/src/tbox/tbox @@ -1 +1 @@ -Subproject commit 1ec4e9222b0bdad8f58c90ce471d08b7cb03751f +Subproject commit cf97d353c6e407819c67c0db88f2a6841afa2d9b diff --git a/xmake/modules/private/detect/find_platform.lua b/xmake/modules/private/detect/find_platform.lua index 977f93072..e4308a90e 100644 --- a/xmake/modules/private/detect/find_platform.lua +++ b/xmake/modules/private/detect/find_platform.lua @@ -66,6 +66,8 @@ function _find_arch_from_cross() arch = "riscv64" elseif cross:find("riscv", 1, true) then arch = "riscv" + elseif cross:find("loong64", 1, true) then + arch = "loong64" elseif cross:find("s390x", 1, true) then arch = "s390x" elseif cross:find("powerpc64", 1, true) then diff --git a/xmake/platforms/cross/xmake.lua b/xmake/platforms/cross/xmake.lua index 4b65f83b7..c7f27a569 100644 --- a/xmake/platforms/cross/xmake.lua +++ b/xmake/platforms/cross/xmake.lua @@ -20,7 +20,7 @@ platform("cross") set_hosts("macosx", "linux", "windows", "bsd") - set_archs("i386", "x86_64", "arm", "arm64", "mips", "mips64", "riscv", "riscv64", "s390x", "ppc", "ppc64", "sh4") + set_archs("i386", "x86_64", "arm", "arm64", "mips", "mips64", "riscv", "riscv64", "loong64", "s390x", "ppc", "ppc64", "sh4") set_formats("static", "lib$(name).a") set_formats("object", "$(name).o") diff --git a/xmake/platforms/linux/xmake.lua b/xmake/platforms/linux/xmake.lua index 1fdea4ea7..e4d57b533 100644 --- a/xmake/platforms/linux/xmake.lua +++ b/xmake/platforms/linux/xmake.lua @@ -21,7 +21,7 @@ platform("linux") set_os("linux") set_hosts("macosx", "linux", "windows", "bsd") - set_archs("i386", "x86_64", "armv7", "armv7s", "arm64-v8a", "mips", "mips64", "mipsel", "mips64el", "loongarch64") + set_archs("i386", "x86_64", "armv7", "armv7s", "arm64-v8a", "mips", "mips64", "mipsel", "mips64el", "loong64") set_formats("static", "lib$(name).a") set_formats("object", "$(name).o") diff --git a/xmake/toolchains/zig/xmake.lua b/xmake/toolchains/zig/xmake.lua index 2cdd7cb8b..082dcba32 100644 --- a/xmake/toolchains/zig/xmake.lua +++ b/xmake/toolchains/zig/xmake.lua @@ -78,6 +78,8 @@ toolchain("zig") arch = "i386" elseif toolchain:is_arch("riscv64") then arch = "riscv64" + elseif toolchain:is_arch("loong64") then + arch = "loong64" elseif toolchain:is_arch("mips.*") then arch = toolchain:arch() elseif toolchain:is_arch("ppc64") then -- cgit v1.3.1