Patch for LoongArch
by liuxiang@loongson.cn
diff -ruN libguestfs-1.52.0-bk/generator/actions_core.ml libguestfs-1.52.0/generator/actions_core.ml
--- libguestfs-1.52.0-bk/generator/actions_core.ml 2023-11-16 10:48:23.470064099 +0000
+++ libguestfs-1.52.0/generator/actions_core.ml 2024-02-18 07:41:58.633573217 +0000
@@ -9377,6 +9377,8 @@
InitISOFS, Always, TestResultString (
[["file_architecture"; "/bin-riscv64-dynamic"]], "riscv64"), [];
InitISOFS, Always, TestResultString (
+ [["file_architecture"; "/bin-loongarch64-dynamic"]], "loongarch64"), [];
+ InitISOFS, Always, TestResultString (
[["file_architecture"; "/bin-s390x-dynamic"]], "s390x"), [];
InitISOFS, Always, TestResultString (
[["file_architecture"; "/bin-sparc-dynamic"]], "sparc"), [];
@@ -9399,6 +9401,8 @@
InitISOFS, Always, TestResultString (
[["file_architecture"; "/lib-riscv64.so"]], "riscv64"), [];
InitISOFS, Always, TestResultString (
+ [["file_architecture"; "/lib-loongarch64.so"]], "loongarch64"), [];
+ InitISOFS, Always, TestResultString (
[["file_architecture"; "/lib-s390x.so"]], "s390x"), [];
InitISOFS, Always, TestResultString (
[["file_architecture"; "/lib-sparc.so"]], "sparc"), [];
@@ -9457,6 +9461,10 @@
64 bit Power PC (little endian).
+=item \"loongarch64\"
+
+64 bit LoongArch64 (little endian).
+
=item \"riscv32\"
=item \"riscv64\"
diff -ruN libguestfs-1.52.0-bk/lib/appliance-cpu.c libguestfs-1.52.0/lib/appliance-cpu.c
--- libguestfs-1.52.0-bk/lib/appliance-cpu.c 2023-11-16 10:48:23.479064013 +0000
+++ libguestfs-1.52.0/lib/appliance-cpu.c 2024-02-18 07:45:40.668965101 +0000
@@ -87,6 +87,9 @@
#elif defined(__riscv)
/* qemu-system-riscv64 (7.0) doesn't yet support -cpu max */
return NULL;
+#elif defined(__loongarch64)
+ /* qemu-system-loongarch64 doesn't yet support -cpu max */
+ return NULL;
#else
/* On most architectures we can use "max" to get the best possible CPU.
* For recent qemu this should work even on TCG.
二进制文件 libguestfs-1.52.0-bk/test-data/binaries/bin-loongarch64-dynamic 和 libguestfs-1.52.0/test-data/binaries/bin-loongarch64-dynamic 不同
二进制文件 libguestfs-1.52.0-bk/test-data/binaries/lib-loongarch64.so 和 libguestfs-1.52.0/test-data/binaries/lib-loongarch64.so 不同
diff -ruN libguestfs-1.52.0-bk/test-data/binaries/Makefile.am libguestfs-1.52.0/test-data/binaries/Makefile.am
--- libguestfs-1.52.0-bk/test-data/binaries/Makefile.am 2023-11-16 10:48:23.680062088 +0000
+++ libguestfs-1.52.0/test-data/binaries/Makefile.am 2024-02-18 07:52:12.736828137 +0000
@@ -27,6 +27,7 @@
bin-ppc64-dynamic \
bin-ppc64le-dynamic \
bin-riscv64-dynamic \
+ bin-loongarch64-dynamic \
bin-s390x-dynamic \
bin-sparc-dynamic \
bin-win32.exe \
@@ -40,6 +41,7 @@
lib-ppc64le.so \
lib-mipsel.so \
lib-riscv64.so \
+ lib-loongarch64.so \
lib-s390x.so \
lib-sparc.so \
lib-win32.dll \
diff -ruN libguestfs-1.52.0-bk/test-data/Makefile.am libguestfs-1.52.0/test-data/Makefile.am
--- libguestfs-1.52.0-bk/test-data/Makefile.am 2023-11-16 10:48:23.680062088 +0000
+++ libguestfs-1.52.0/test-data/Makefile.am 2024-02-18 07:51:07.614179690 +0000
@@ -38,6 +38,7 @@
$(srcdir)/binaries/bin-ppc64-dynamic \
$(srcdir)/binaries/bin-ppc64le-dynamic \
$(srcdir)/binaries/bin-riscv64-dynamic \
+ $(srcdir)/binaries/bin-loongarch64-dynamic \
$(srcdir)/binaries/bin-s390x-dynamic \
$(srcdir)/binaries/bin-sparc-dynamic \
$(srcdir)/binaries/bin-win32.exe \
@@ -51,6 +52,7 @@
$(srcdir)/binaries/lib-ppc64.so \
$(srcdir)/binaries/lib-ppc64le.so \
$(srcdir)/binaries/lib-riscv64.so \
+ $(srcdir)/binaries/lib-loongarch64.so \
$(srcdir)/binaries/lib-s390x.so \
$(srcdir)/binaries/lib-sparc.so \
$(srcdir)/binaries/lib-win32.dll \
10 months