From 168ca2ca15b9052318ed19ef72ad0ec8ded7e66e Mon Sep 17 00:00:00 2001 From: lvgenggeng Date: Thu, 20 Jul 2023 10:28:24 +0800 Subject: [PATCH] add support for loongarch64 Signed-off-by: lvgenggeng (cherry picked from commit 27d2e16a654ff505d3e27fbf16d347c383cebbba) --- 0001-Add-support-for-loongarch.patch | 12 ++++++++++++ stalld.spec | 8 ++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 0001-Add-support-for-loongarch.patch diff --git a/0001-Add-support-for-loongarch.patch b/0001-Add-support-for-loongarch.patch new file mode 100644 index 0000000..3b52709 --- /dev/null +++ b/0001-Add-support-for-loongarch.patch @@ -0,0 +1,12 @@ +diff -up ./src/stalld.h.old ./src/stalld.h +--- ./src/stalld.h.old 2023-07-20 10:28:58.525933347 +0800 ++++ ./src/stalld.h 2023-07-20 10:29:25.674132507 +0800 +@@ -83,7 +83,7 @@ struct cpu_info { + #elif __arm__ + # define __NR_sched_setattr 380 + # define __NR_sched_getattr 381 +-#elif __aarch64__ ++#elif __aarch64__ || __loongarch64 + # define __NR_sched_setattr 274 + # define __NR_sched_getattr 275 + #elif __powerpc__ diff --git a/stalld.spec b/stalld.spec index bab5090..ae16fe2 100644 --- a/stalld.spec +++ b/stalld.spec @@ -1,11 +1,12 @@ Name: stalld Version: 1.16 -Release: 1 +Release: 2 Summary: Daemon that finds starving tasks and gives them a temporary boost License: GPLv2 URL: https://gitlab.com/rt-linux-tools/%{name} Source0: https://gitlab.com/rt-linux-tools/%{name}/-/archive/v%{version}/%{name}-%{version}.tar.bz2 +Patch0: 0001-Add-support-for-loongarch.patch BuildRequires: glibc-devel BuildRequires: gcc @@ -23,7 +24,7 @@ boost using the SCHED_DEADLINE policy. The default is to allow 10 microseconds of runtime for 1 second of clock time. %prep -%autosetup +%autosetup -p1 %build %make_build CFLAGS="%{optflags} %{build_cflags} -DVERSION="\\\"%{version}\\\""" LDFLAGS="%{build_ldflags}" @@ -51,6 +52,9 @@ allow 10 microseconds of runtime for 1 second of clock time. %systemd_postun_with_restart %{name}.service %changelog +* Thu Jul 20 2023 lvgenggeng - 1.16-2 +- add support for loongarch64 + * Mon Nov 07 2022 duyiwei - 1.16-1 - upgrade version to 1.16 -- Gitee