diff --git a/0017-Add-loongarch64-support.patch b/0017-Add-loongarch64-support.patch new file mode 100644 index 0000000000000000000000000000000000000000..399bf10c118eef2d247b4dacfa20dca27537d084 --- /dev/null +++ b/0017-Add-loongarch64-support.patch @@ -0,0 +1,166 @@ +diff --git a/config/bash/_lxc.in b/config/bash/_lxc.in +index 6672bf0..8a7ce16 100644 +--- a/config/bash/_lxc.in ++++ b/config/bash/_lxc.in +@@ -285,7 +285,7 @@ _lxc_attach() { + ;; + --arch | -a ) + # https://github.com/lxc/lxc/blob/stable-4.0/src/tests/arch_parse.c#L37 +- COMPREPLY=( $( compgen -W 'arm armel armhf armv7l athlon i386 i486 i586 i686 linux32 mips mipsel ppc powerpc x86 aarch64 amd64 arm64 linux64 mips64 mips64el ppc64 ppc64el ppc64le powerpc64 riscv64 s390x x86_64' -- "${cur}" ) ) ++ COMPREPLY=( $( compgen -W 'arm armel armhf armv7l athlon i386 i486 i586 i686 linux32 mips mipsel ppc powerpc x86 aarch64 amd64 arm64 linux64 loongarch64 mips64 mips64el ppc64 ppc64el ppc64le powerpc64 riscv64 s390x x86_64' -- "${cur}" ) ) + return + ;; + --elevated-privileges | -e ) +diff --git a/src/lxc/confile.c b/src/lxc/confile.c +index d0984b0..b089b65 100644 +--- a/src/lxc/confile.c ++++ b/src/lxc/confile.c +@@ -3397,6 +3397,7 @@ int lxc_config_parse_arch(const char *arch, signed long *persona) + { "amd64", PER_LINUX }, + { "arm64", PER_LINUX }, + { "linux64", PER_LINUX }, ++ { "loongarch64", PER_LINUX }, + { "mips64", PER_LINUX }, + { "mips64el", PER_LINUX }, + { "ppc64", PER_LINUX }, +diff --git a/src/lxc/syscall_numbers.h b/src/lxc/syscall_numbers.h +index ae5fdd0..58840a5 100644 +--- a/src/lxc/syscall_numbers.h ++++ b/src/lxc/syscall_numbers.h +@@ -50,6 +50,8 @@ + #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ + #define __NR_keyctl 5241 + #endif ++ #elif defined __loongarch64 ++ #define __NR_keyctl 219 + #else + #define -1 + #warning "__NR_keyctl not defined for your architecture" +@@ -87,6 +89,8 @@ + #if _MIPS_SIM == _MIPS_SIM_ABI64 + #define __NR_memfd_create 5314 + #endif ++ #elif defined __loongarch64 ++ #define __NR_memfd_create 279 + #else + #define -1 + #warning "__NR_memfd_create not defined for your architecture" +@@ -122,6 +126,8 @@ + #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ + #define __NR_pivot_root 5151 + #endif ++ #elif defined __loongarch64 ++ #define __NR_pivot_root 41 + #else + #define -1 + #warning "__NR_pivot_root not defined for your architecture" +@@ -157,6 +163,8 @@ + #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ + #define __NR_setns 5303 + #endif ++ #elif defined __loongarch64 ++ #define __NR_setns 268 + #else + #define -1 + #warning "__NR_setns not defined for your architecture" +@@ -192,6 +200,8 @@ + #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ + #define __NR_sethostname 5165 + #endif ++ #elif defined __loongarch64 ++ #define __NR_sethostname 161 + #else + #define -1 + #warning "__NR_sethostname not defined for your architecture" +@@ -259,6 +269,8 @@ + #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ + #define __NR_signalfd4 5283 + #endif ++ #elif defined __loongarch64 ++ #define __NR_signalfd4 74 + #else + #define -1 + #warning "__NR_signalfd4 not defined for your architecture" +@@ -294,6 +306,8 @@ + #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ + #define __NR_unshare 5262 + #endif ++ #elif defined __loongarch64 ++ #define __NR_unshare 97 + #else + #define -1 + #warning "__NR_unshare not defined for your architecture" +@@ -329,6 +343,8 @@ + #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ + #define __NR_bpf 5315 + #endif ++ #elif defined __loongarch64 ++ #define __NR_bpf 280 + #else + #define -1 + #warning "__NR_bpf not defined for your architecture" +@@ -364,6 +380,8 @@ + #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ + #define __NR_faccessat 5259 + #endif ++ #elif defined __loongarch64 ++ #define __NR_faccessat 48 + #else + #define -1 + #warning "__NR_faccessat not defined for your architecture" +@@ -419,6 +437,8 @@ + #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ + #define __NR_seccomp 5312 + #endif ++ #elif defined __loongarch64 ++ #define __NR_seccomp 277 + #else + #define -1 + #warning "__NR_seccomp not defined for your architecture" +@@ -454,6 +474,8 @@ + #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ + #define __NR_gettid 5178 + #endif ++ #elif defined __loongarch64 ++ #define __NR_gettid 178 + #else + #define -1 + #warning "__NR_gettid not defined for your architecture" +@@ -493,6 +515,8 @@ + #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ + #define __NR_execveat 5316 + #endif ++ #elif defined __loongarch64 ++ #define __NR_execveat 281 + #else + #define -1 + #warning "__NR_execveat not defined for your architecture" +@@ -732,6 +756,8 @@ + #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ + #define __NR_personality (132 + 5000) + #endif ++ #elif defined __loongarch64 ++ #define __NR_personality 92 + #else + #define -1 + #warning "__NR_personality not defined for your architecture" +diff --git a/src/tests/arch_parse.c b/src/tests/arch_parse.c +index 6d72d66..f8b4d8a 100644 +--- a/src/tests/arch_parse.c ++++ b/src/tests/arch_parse.c +@@ -37,10 +37,11 @@ + #endif + + static const char *const arches[] = { +- "arm", "armel", "armhf", "armv7l", "athlon", "i386", "i486", +- "i586", "i686", "linux32", "mips", "mipsel", "ppc", "powerpc", +- "x86", "aarch64", "amd64", "arm64", "linux64", "mips64", "mips64el", +- "ppc64", "ppc64el", "ppc64le", "powerpc64", "riscv64", "s390x", "x86_64", ++ "arm", "armel", "armhf", "armv7l", "athlon", "i386", "i486", ++ "i586", "i686", "linux32", "mips", "mipsel", "ppc", "powerpc", ++ "x86", "aarch64", "amd64", "arm64", "linux64", "loongarch64", "mips64", ++ "mips64el", "ppc64", "ppc64el", "ppc64le", "powerpc64", "riscv64", "s390x", ++ "x86_64", + }; + + static bool parse_valid_architectures(void) diff --git a/lxc.spec b/lxc.spec index 761d59401b15179586e84262318a7af71112f5e1..4b8573b67a240e46338b4ba0ee138159c3a1c817 100644 --- a/lxc.spec +++ b/lxc.spec @@ -1,4 +1,4 @@ -%global _release 14 +%global _release 15 %bcond isulad 1 Name: lxc @@ -25,6 +25,7 @@ Patch0013: 0013-ensure-cpuset-cgroup-built-while-writing-cgroup.proc.patch Patch0014: 0014-fix-cpuset-cgroup-error.patch Patch0015: 0015-append-mntopt-to-mntdata-if-not-found-in-mount_opt.patch Patch0016: 0016-unfreeze-freezing-container-and-bugfix-for-files.lim.patch +Patch0017: 0017-Add-loongarch64-support.patch BuildRequires: systemd-units git libtool graphviz docbook2X doxygen chrpath BuildRequires: pkgconfig(libseccomp) @@ -214,6 +215,12 @@ meson test -C build %endif %changelog +* Tue Jun 11 2024 zhaixiaojuan - 5.0.2-15 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC: add loongarch64 support + * Mon Mar 11 2024 jchzhou - 5.0.2-14 - Type: bugfix - ID:NA