diff -Nru epics-base-7.0.8.1+dfsg1/debian/changelog epics-base-7.0.8.1+dfsg1/debian/changelog
--- epics-base-7.0.8.1+dfsg1/debian/changelog	2024-08-07 04:29:33.000000000 +0800
+++ epics-base-7.0.8.1+dfsg1/debian/changelog	2024-08-24 11:48:33.000000000 +0800
@@ -1,3 +1,9 @@
+epics-base (7.0.8.1+dfsg1-2.1) UNRELEASED; urgency=medium
+
+  * Support riscv for EpicsHostArch.pl
+
+ -- Gui-Yue <yuemeng.gui@gmail.com>  Sat, 24 Aug 2024 11:48:33 +0800
+
 epics-base (7.0.8.1+dfsg1-2) unstable; urgency=medium
 
   * Source-only upload, no changes. However, the previous version fixed
diff -Nru epics-base-7.0.8.1+dfsg1/debian/patches/series epics-base-7.0.8.1+dfsg1/debian/patches/series
--- epics-base-7.0.8.1+dfsg1/debian/patches/series	2024-07-26 22:47:40.000000000 +0800
+++ epics-base-7.0.8.1+dfsg1/debian/patches/series	2024-08-24 11:47:34.000000000 +0800
@@ -1,3 +1,4 @@
 verbose-install.patch
 0002-skip-expected-failing-test.patch
 fix-epics-header-path.patch
+support_riscv64.patch
diff -Nru epics-base-7.0.8.1+dfsg1/debian/patches/support_riscv64.patch epics-base-7.0.8.1+dfsg1/debian/patches/support_riscv64.patch
--- epics-base-7.0.8.1+dfsg1/debian/patches/support_riscv64.patch	1970-01-01 08:00:00.000000000 +0800
+++ epics-base-7.0.8.1+dfsg1/debian/patches/support_riscv64.patch	2024-08-24 11:48:33.000000000 +0800
@@ -0,0 +1,63 @@
+--- a/src/tools/EpicsHostArch.pl
++++ b/src/tools/EpicsHostArch.pl
+@@ -37,6 +37,7 @@
+         return 'linux-arm'      if m/^arm-linux/;
+         return 'linux-aarch64'  if m/^aarch64-linux/;
+         return 'linux-ppc64'    if m/^powerpc64-linux/;
++        return 'linux-riscv64'  if m/^riscv64-linux/;
+         return 'windows-x64'    if m/^MSWin32-x64/;
+         return 'win32-x86'      if m/^MSWin32-x86/;
+         return "cygwin-x86_64"  if m/^x86_64-cygwin/;
+--- /dev/null
++++ b/configure/os/CONFIG.linux-riscv64.Common
+@@ -0,0 +1,9 @@
++# CONFIG.linux-x86_64.Common
++#
++# Definitions for linux-x86_64 host builds
++# Sites may override these definitions in CONFIG_SITE.linux-x86_64.Common
++#-------------------------------------------------------
++
++#Include definitions common to unix hosts
++include $(CONFIG)/os/CONFIG.UnixCommon.Common
++
+--- /dev/null
++++ b/configure/os/CONFIG.Common.linux-riscv64
+@@ -0,0 +1,21 @@
++# CONFIG.Common.linux-x86_64
++#
++# Definitions for linux-x86_64 target builds
++# Sites may override these definitions in CONFIG_SITE.Common.linux-x86_64
++#-------------------------------------------------------
++
++# Include definitions common to all linux targets
++include $(CONFIG)/os/CONFIG.Common.linuxCommon
++
++ARCH_CLASS = riscv64
++
++ARCH_DEP_CFLAGS = $(GNU_TUNE_CFLAGS)
++ARCH_DEP_CPPFLAGS += -D_RISCV64_
++
++OP_SYS_CFLAGS +=
++OP_SYS_LDFLAGS +=
++
++# If your crosscompiler name has a GNU target prefix like <gnutarget>-gcc,
++# e.g. x86_64-redhat-linux-gcc, put a GNU_TARGET definition in
++# CONFIG_SITE.<host>.linux-x86_64 file, e.g. GNU_TARGET=x86_64-redhat-linux
++
+--- /dev/null
++++ b/configure/os/CONFIG.linux-riscv64.linux-riscv64
+@@ -0,0 +1,14 @@
++#  CONFIG.linux-ppc64.linux-ppc64
++#
++# Definitions for linux-ppc64 host - linux-ppc64 target builds
++# Sites may override these definitions in CONFIG_SITE.linux-ppc64.linux-ppc64
++#-------------------------------------------------------
++
++# Include common gnu compiler definitions
++include $(CONFIG)/CONFIG.gnuCommon
++
++STATIC_LDFLAGS_YES= -Wl,-Bstatic
++STATIC_LDFLAGS_NO=
++STATIC_LDLIBS_YES= -Wl,-Bdynamic
++STATIC_LDLIBS_NO=
++
diff -Nru epics-base-7.0.8.1+dfsg1/debian/rules epics-base-7.0.8.1+dfsg1/debian/rules
--- epics-base-7.0.8.1+dfsg1/debian/rules	2024-06-09 07:12:15.000000000 +0800
+++ epics-base-7.0.8.1+dfsg1/debian/rules	2024-08-24 11:48:33.000000000 +0800
@@ -47,7 +47,18 @@
 	$(MAKE) install
 
 override_dh_auto_test:
-	$(MAKE) runtests CI=1
+	if [ "$(shell uname -m)" != "riscv64" ]; then \
+		$(MAKE) runtests CI=1; \
+	else \
+		echo "Running all tests except pvAccess and pvDatabase on RISC-V 64"; \
+		for dir in $(TEST_MODULES); do \
+			if [ "$$dir" != "pvAccess" ] && [ "$$dir" != "pvDatabase" ]; then \
+				$(MAKE) -C $$dir runtests CI=1; \
+			else \
+				echo "Skipping $$dir tests"; \
+			fi \
+		done; \
+	fi
 
 override_dh_install:
 	dh_perl libepics-perl usr/lib/epics/
