From 78f1906b42dcf60e2c1fc24ca7607cd6100d777f Mon Sep 17 00:00:00 2001 From: gongwen Date: Sun, 29 Aug 2021 10:56:49 +0800 Subject: [PATCH] support loongarch --- 1015-systemd-anolis-support-loongarch64.patch | 56 +++++++++++++++++++ systemd.spec | 6 +- 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 1015-systemd-anolis-support-loongarch64.patch diff --git a/1015-systemd-anolis-support-loongarch64.patch b/1015-systemd-anolis-support-loongarch64.patch new file mode 100644 index 0000000..8f23b97 --- /dev/null +++ b/1015-systemd-anolis-support-loongarch64.patch @@ -0,0 +1,56 @@ +From bd646124c244f6de65cd829b33f5912c1d540bb4 Mon Sep 17 00:00:00 2001 +From: rpm-build +Date: Fri, 6 Aug 2021 08:15:19 +0000 +Subject: [PATCH] support loongarch64 for systemd + +--- + src/basic/architecture.c | 3 +++ + src/basic/architecture.h | 4 ++++ + 2 files changed, 7 insertions(+) + +diff --git a/src/basic/architecture.c b/src/basic/architecture.c +index 85837b5..3807ea5 100644 +--- a/src/basic/architecture.c ++++ b/src/basic/architecture.c +@@ -118,6 +118,8 @@ int uname_architecture(void) { + #elif defined(__arc__) + { "arc", ARCHITECTURE_ARC }, + { "arceb", ARCHITECTURE_ARC_BE }, ++#elif defined(__loongarch64) ++ { "loongarch64", ARCHITECTURE_LOONGARCH64 }, + #else + #error "Please register your architecture here!" + #endif +@@ -173,6 +175,7 @@ static const char *const architecture_table[_ARCHITECTURE_MAX] = { + [ARCHITECTURE_RISCV64] = "riscv64", + [ARCHITECTURE_ARC] = "arc", + [ARCHITECTURE_ARC_BE] = "arc-be", ++ [ARCHITECTURE_LOONGARCH64] = "loongarch64", + }; + + DEFINE_STRING_TABLE_LOOKUP(architecture, int); +diff --git a/src/basic/architecture.h b/src/basic/architecture.h +index 443e890..935622c 100644 +--- a/src/basic/architecture.h ++++ b/src/basic/architecture.h +@@ -44,6 +44,7 @@ enum { + ARCHITECTURE_RISCV64, + ARCHITECTURE_ARC, + ARCHITECTURE_ARC_BE, ++ ARCHITECTURE_LOONGARCH64, + _ARCHITECTURE_MAX, + _ARCHITECTURE_INVALID = -1 + }; +@@ -229,6 +230,9 @@ int uname_architecture(void); + # define native_architecture() ARCHITECTURE_ARC + # define LIB_ARCH_TUPLE "arc-linux" + # endif ++#elif defined(__loongarch64) ++# define native_architecture() ARCHITECTURE_LOONGARCH64 ++# define LIB_ARCH_TUPLE "loongarch64-linux-gnu" + #else + # error "Please register your architecture here!" + #endif +-- +2.27.0 + diff --git a/systemd.spec b/systemd.spec index fdff055..e1bd3e8 100644 --- a/systemd.spec +++ b/systemd.spec @@ -1,4 +1,4 @@ -%define anolis_release .0.1 +%define anolis_release .0.2 #global gitcommit 10e465b5321bd53c1fc59ffab27e724535c6bc0f %{?gitcommit:%global gitcommitshort %(c=%{gitcommit}; echo ${c:0:7})} @@ -724,6 +724,7 @@ Patch1011: 1011-mount-don-t-propagate-errors-from-mount_setup_unit-f.patch Patch1012: 1012-cgroup-util-make-definition-of-CGROUP_CONTROLLER_TO_.patch Patch1013: 1013-cgroup-update-only-siblings-that-got-realized-once.patch Patch1014: 1014-core-add-a-config-item-to-support-setting-the-value-.patch +Patch1015: 1015-systemd-anolis-support-loongarch64.patch %ifarch %{ix86} x86_64 aarch64 %global have_gnu_efi 1 @@ -1350,6 +1351,9 @@ fi %files tests -f .file-list-tests %changelog +* Tue Jan 25 2022 zhangwenlong - 239-51.0.2 +- support loongarch for systemd + * Tue Jan 18 2022 Yuanhong Peng - 239-51.0.1 - core: fix a null reference case in load_from_path() - sysctl: Don't pass null directive argument to '%s' -- Gitee