From 0bbd50ab498939cdfcae2435e57bf68ddcd42dc0 Mon Sep 17 00:00:00 2001 From: CattySteve Date: Mon, 9 Dec 2024 22:14:09 +0800 Subject: [PATCH 1/4] feat: add loongarch64 build --- bld/cb.cs | 8 ++++++++ bld/setup_linux.sh | 2 ++ 2 files changed, 10 insertions(+) diff --git a/bld/cb.cs b/bld/cb.cs index eb496e35..1ee3d884 100644 --- a/bld/cb.cs +++ b/bld/cb.cs @@ -181,6 +181,10 @@ IList libs compiler = "riscv64-linux-gnu-gcc"; break; + case "loongarch64": + compiler = "loongarch64-unknown-linux-gnu-gcc"; + break; + case "musl-x64": compiler = "musl-gcc"; tw.Write(" -m64\n"); @@ -1406,6 +1410,7 @@ static void write_e_sqlite3( new linux_target("s390x"), new linux_target("ppc64le"), new linux_target("riscv64"), + new linux_target("loongarch64"), }; write_linux_multi( @@ -1691,6 +1696,7 @@ static void write_e_sqlite3mc() new linux_target("s390x"), new linux_target("ppc64le"), new linux_target("riscv64"), + new linux_target("loongarch64"), }; write_linux_multi( @@ -2498,6 +2504,7 @@ static void write_e_sqlcipher() new linux_target("s390x"), new linux_target("ppc64le"), new linux_target("riscv64"), + new linux_target("loongarch64"), }; write_linux_multi( @@ -2842,6 +2849,7 @@ static void write_sqlite3mc() new linux_target("s390x"), new linux_target("ppc64le"), new linux_target("riscv64"), + new linux_target("loongarch64"), }; write_linux_multi( diff --git a/bld/setup_linux.sh b/bld/setup_linux.sh index 1369cd08..a3993703 100755 --- a/bld/setup_linux.sh +++ b/bld/setup_linux.sh @@ -26,4 +26,6 @@ wget https://musl.cc/s390x-linux-musl-cross.tgz tar --strip-components=1 -zxf s390x-linux-musl-cross.tgz wget https://musl.cc/riscv64-linux-musl-cross.tgz tar --strip-components=1 -zxf riscv64-linux-musl-cross.tgz +wget https://github.com/loongson/build-tools/releases/download/2024.11.01/x86_64-cross-tools-loongarch64-binutils_2.43.1-gcc_14.2.0-glibc_2.40.tar.xz +tar --strip-components=1 -zxf x86_64-cross-tools-loongarch64-binutils_2.43.1-gcc_14.2.0-glibc_2.40.tar.xz cd .. From 5c34fad1c88d37749532d61e3a8afaf1707b6cf7 Mon Sep 17 00:00:00 2001 From: CattySteve Date: Tue, 10 Dec 2024 18:46:46 +0800 Subject: [PATCH 2/4] chore: trigger actions From a8167896db9f7b6e8a91dfeeeda605e7524fdfa9 Mon Sep 17 00:00:00 2001 From: CattySteve Date: Tue, 10 Dec 2024 19:01:39 +0800 Subject: [PATCH 3/4] chore: modify some code to trigger action --- bld/cb.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bld/cb.cs b/bld/cb.cs index 1ee3d884..9282311a 100644 --- a/bld/cb.cs +++ b/bld/cb.cs @@ -181,9 +181,9 @@ IList libs compiler = "riscv64-linux-gnu-gcc"; break; - case "loongarch64": - compiler = "loongarch64-unknown-linux-gnu-gcc"; - break; + case "loongarch64": + compiler = "loongarch64-unknown-linux-gnu-gcc"; + break; case "musl-x64": compiler = "musl-gcc"; From f8e4e850bc360dc20004fdb15eb9c73ff17d4985 Mon Sep 17 00:00:00 2001 From: CattySteve Date: Tue, 10 Dec 2024 19:08:38 +0800 Subject: [PATCH 4/4] chore: fix build process Remove -z from build script due to loongarch cross-build tool is in xz format. --- bld/setup_linux.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/setup_linux.sh b/bld/setup_linux.sh index a3993703..8c4afe50 100755 --- a/bld/setup_linux.sh +++ b/bld/setup_linux.sh @@ -27,5 +27,5 @@ tar --strip-components=1 -zxf s390x-linux-musl-cross.tgz wget https://musl.cc/riscv64-linux-musl-cross.tgz tar --strip-components=1 -zxf riscv64-linux-musl-cross.tgz wget https://github.com/loongson/build-tools/releases/download/2024.11.01/x86_64-cross-tools-loongarch64-binutils_2.43.1-gcc_14.2.0-glibc_2.40.tar.xz -tar --strip-components=1 -zxf x86_64-cross-tools-loongarch64-binutils_2.43.1-gcc_14.2.0-glibc_2.40.tar.xz +tar --strip-components=1 -xf x86_64-cross-tools-loongarch64-binutils_2.43.1-gcc_14.2.0-glibc_2.40.tar.xz cd ..