diff --git a/1000-fix-build-on-riscv64.patch b/1000-fix-build-on-riscv64.patch new file mode 100644 index 0000000..37b9f64 --- /dev/null +++ b/1000-fix-build-on-riscv64.patch @@ -0,0 +1,38 @@ +From 4f467c68ee190d2f8094b0342f6c76be15071046 Mon Sep 17 00:00:00 2001 +From: misaka00251 +Date: Fri, 15 Sep 2023 20:46:15 +0800 +Subject: [PATCH] Fix build on riscv64 + +--- + Makefile | 2 +- + cmd/plugin/selinux/selinux.go | 3 +++ + 2 files changed, 4 insertions(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 858346a..6e88e24 100644 +--- a/Makefile ++++ b/Makefile +@@ -35,7 +35,7 @@ all: pav pavd + selinux: + CGO_CFLAGS_ALLOW="-ftrapv -D_FORTIFY_SOURCE=2 -O2" CGO_CFLAGS="-fstack-protector-strong -ftrapv -D_FORTIFY_SOURCE=2 -O2" \ + CGO_LDFALGS_ALLOW="-Wl,-z,-s,relro,now,noexecstack" CGO_LDFALGS="-Wl,-z,-s,relro,now,noexecstack" \ +- go build -buildmode=plugin $(BUILDFLAGS) -ldflags '$(LDFLAGS)' -o $(BUILD_DIR)/selinux.so cmd/plugin/selinux/*.go ++ go build $(BUILDFLAGS) -ldflags '$(LDFLAGS)' -o $(BUILD_DIR)/selinux.so cmd/plugin/selinux/*.go + strip $(BUILD_DIR)/selinux.so + + pav: +diff --git a/cmd/plugin/selinux/selinux.go b/cmd/plugin/selinux/selinux.go +index 819963b..94ca4ec 100644 +--- a/cmd/plugin/selinux/selinux.go ++++ b/cmd/plugin/selinux/selinux.go +@@ -32,3 +32,6 @@ func GetEngine() engine.Engine { + + return e + } ++ ++func main() { ++} +\ No newline at end of file +-- +2.39.2 (Apple Git-143) + diff --git a/secpaver.spec b/secpaver.spec index 36d5728..5f02b7e 100755 --- a/secpaver.spec +++ b/secpaver.spec @@ -2,7 +2,7 @@ Name: secpaver Summary: Security policy development tool Version: 1.0.2 -Release: 5 +Release: 6 License: MulanPSL-2.0 URL: https://gitee.com/openeuler/secpaver Source: https://gitee.com/openeuler/secpaver/repository/archive/%{name}-%{version}.tar.gz @@ -11,6 +11,9 @@ Source1: sys.tar.gz Patch0001: dont-do-daemon-reload-in-make-install.patch Patch0002: set-default-log-path.patch +%ifarch riscv64 +Patch1000: 1000-fix-build-on-riscv64.patch +%endif BuildRequires: golang make systemd Requires: %{name}-plugin = %{version}-%{release} @@ -79,6 +82,9 @@ tar -xf %{SOURCE1} -C vendor/golang.org/x/ %systemd_postun_with_restart pavd.service %changelog +* Fri Sep 15 2023 misaka00251 - 1.0.2-6 +- Fix build on riscv64 + * Tue Jul 11 2023 huajingyun - 1.0.2-5 - Add loong64 support