!20 Fix build on riscv64

From: @misaka00251 
Reviewed-by: @zhujianwei001 
Signed-off-by: @zhujianwei001
This commit is contained in:
openeuler-ci-bot 2023-12-21 09:06:26 +00:00 committed by Gitee
commit 8332d97094
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 45 additions and 1 deletions

View File

@ -0,0 +1,38 @@
From 4f467c68ee190d2f8094b0342f6c76be15071046 Mon Sep 17 00:00:00 2001
From: misaka00251 <liuxin@iscas.ac.cn>
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)

View File

@ -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 <liuxin@iscas.ac.cn> - 1.0.2-6
- Fix build on riscv64
* Tue Jul 11 2023 huajingyun <huajingyun@loongson.cn> - 1.0.2-5
- Add loong64 support