Add RISC-V support by David Abdurachmanov <davidlt@rivosinc.com>
This commit is contained in:
parent
462e46a444
commit
d80308e620
63
0001-Add-support-for-riscv64.patch
Normal file
63
0001-Add-support-for-riscv64.patch
Normal file
@ -0,0 +1,63 @@
|
||||
From 762363d2cb5de264973f08453279400cd570935c Mon Sep 17 00:00:00 2001
|
||||
From: David Abdurachmanov <davidlt@rivosinc.com>
|
||||
Date: Thu, 21 Aug 2025 15:47:31 +0000
|
||||
Subject: [PATCH] Add support for riscv64
|
||||
|
||||
Signed-off-by: Andrew Lukoshko <alukoshko@almalinux.org>
|
||||
---
|
||||
Makefile | 11 ++++++++++-
|
||||
src/stalld.h | 2 +-
|
||||
2 files changed, 11 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 2027791..e70d8e0 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -33,6 +33,11 @@ ifeq ($(ARCH),powerpc)
|
||||
USE_BPF := 0
|
||||
MTUNE := -mtune=powerpc
|
||||
endif
|
||||
+ifeq ($(ARCH),riscv64)
|
||||
+FCF_PROTECTION := "-fcf-protection=none"
|
||||
+M64 :=
|
||||
+MTUNE := -mtune=generic-ooo
|
||||
+endif
|
||||
|
||||
$(info USE_BPF=$(USE_BPF))
|
||||
$(info FCF_PROTECTION=$(FCF_PROTECTION))
|
||||
@@ -134,6 +139,10 @@ endif
|
||||
ifeq ($(ARCH),s390x)
|
||||
CLANGARCH=-D__s390x__
|
||||
endif
|
||||
+ifeq ($(ARCH),riscv64)
|
||||
+CLANGARCH="-D__riscv"
|
||||
+CLANGFLAGS="-D__riscv_xlen=64"
|
||||
+endif
|
||||
|
||||
.PHONY: all tests
|
||||
|
||||
@@ -154,7 +163,7 @@ bpf/vmlinux.h:
|
||||
# The .bpf.c needs to be transformed into the .bpf.o.
|
||||
# The .bpf.o is then required to build the .skel.h.
|
||||
bpf/stalld.bpf.o: bpf/vmlinux.h bpf/stalld.bpf.c
|
||||
- @$(CLANG) -g -O2 -target bpf $(CLANGARCH) -DDEBUG_STALLD=$(DEBUG) -D__TARGET_ARCH_$(ARCH) \
|
||||
+ @$(CLANG) -g -O2 -target bpf $(CLANGARCH) $(CLANGFLAGS) -DDEBUG_STALLD=$(DEBUG) -D__TARGET_ARCH_$(ARCH) \
|
||||
$(INCLUDES) $(CLANG_BPF_SYS_INCLUDES) -c $(filter %.c,$^) -o $@
|
||||
@$(LLVM_STRIP) -g $@ # strip useless DWARF info
|
||||
|
||||
diff --git a/src/stalld.h b/src/stalld.h
|
||||
index 68a89a0..1350bb8 100644
|
||||
--- a/src/stalld.h
|
||||
+++ b/src/stalld.h
|
||||
@@ -122,7 +122,7 @@ struct stalld_backend {
|
||||
#elif __arm__
|
||||
# define __NR_sched_setattr 380
|
||||
# define __NR_sched_getattr 381
|
||||
-#elif __aarch64__ || __loongarch64
|
||||
+#elif __aarch64__ || __loongarch64 || __riscv
|
||||
# define __NR_sched_setattr 274
|
||||
# define __NR_sched_getattr 275
|
||||
#elif __powerpc__
|
||||
--
|
||||
2.43.7
|
||||
|
||||
@ -1,12 +1,15 @@
|
||||
Name: stalld
|
||||
Version: 1.20.4
|
||||
Release: 1%{?dist}
|
||||
Release: 1%{?dist}.alma.1
|
||||
Summary: Daemon that finds starving tasks and gives them a temporary boost
|
||||
|
||||
License: GPL-2.0-or-later AND GPL-2.0-only
|
||||
URL: https://git.kernel.org/pub/scm/utils/%{name}/%{name}.git
|
||||
Source0: https://git.kernel.org/pub/scm/utils/%{name}/%{name}.git/snapshot/%{name}-%{version}.tar.gz
|
||||
|
||||
# AlmaLinux Patch
|
||||
Patch1001: 0001-Add-support-for-riscv64.patch
|
||||
|
||||
BuildRequires: glibc-devel
|
||||
BuildRequires: gcc
|
||||
BuildRequires: make
|
||||
@ -64,6 +67,9 @@ allow 10 microseconds of runtime for 1 second of clock time.
|
||||
%systemd_postun_with_restart %{name}.service
|
||||
|
||||
%changelog
|
||||
* Thu Aug 21 2025 Andrew Lukoshko <alukoshko@almalinux.org> - 1.20.4-1.alma.1
|
||||
- Add RISC-V support by David Abdurachmanov <davidlt@rivosinc.com>
|
||||
|
||||
* Tue Aug 19 2025 Wander Lairson Costa <wander@redhat.com> - 1.20.4-1
|
||||
- Rebase to stalld-1.20.4
|
||||
- Remove duplicated ExecStart entry from the stalld.service file
|
||||
|
||||
Loading…
Reference in New Issue
Block a user