Fix riscv64 support

This commit is contained in:
misaka00251 2023-04-09 15:57:14 +08:00
parent da040ad6a5
commit a3e755af10
No known key found for this signature in database
GPG Key ID: 4AA100DC964EDE26
2 changed files with 57 additions and 1 deletions

View File

@ -0,0 +1,45 @@
From dee36494daeb90328b2f1cab8dbd542ef886952e Mon Sep 17 00:00:00 2001
From: misaka00251 <liuxin@iscas.ac.cn>
Date: Sun, 9 Apr 2023 15:56:16 +0800
Subject: [PATCH] Fix riscv64 support
---
Makefile | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 2592752..a576db0 100644
--- a/Makefile
+++ b/Makefile
@@ -6,12 +6,19 @@ ifndef ARCH
ARCH = amd64
ifeq ($(shell uname -p), aarch64)
ARCH = arm64
+else ifeq ($(shell uname -p), riscv64)
+ARCH = riscv64
endif
endif
TMP_PATH := /tmp/xxeggo
EXTRALDFLAGS :=
+ifeq ($(shell uname -p), riscv64)
+EXTLDFLAGS := -Wl,-z,now
+else
+EXTLDFLAGS := -static-pie -Wl,-z,now
+endif
LDFLAGS := -X isula.org/eggo/cmd.Version=$(VERSION) \
-X isula.org/eggo/cmd.Commit=$(GIT_COMMIT) \
-X isula.org/eggo/cmd.BuildTime=$(SOURCE_DATE_EPOCH) \
@@ -21,7 +28,7 @@ STATIC_LDFLAGS := -extldflags=-static -linkmode=external
SAFEBUILDFLAGS := -buildmode=pie \
-extldflags=-ftrapv -extldflags=-zrelro -extldflags=-znow \
-linkmode=external \
- -extldflags "-static-pie -Wl,-z,now" \
+ -extldflags "$(EXTRALDFLAGS)" \
-tmpdir=$(TMP_PATH) \
$(LDFLAGS)
--
2.37.1 (Apple Git-137.1)

View File

@ -1,6 +1,6 @@
Name: eggo
Version: 0.9.4
Release: 9
Release: 10
Summary: Eggo is a tool built to provide standard multi-ways for creating Kubernetes clusters.
License: Mulan PSL V2
URL: https://gitee.com/openeuler/eggo
@ -31,6 +31,7 @@ Patch0022: 0022-add-golangci-check.patch
Patch0023: 0023-add-golang-static-code-check.patch
Patch0024: 0024-modify-dependency-install-command.patch
Patch0025: 0025-fix-panic-in-os-user.Current.patch
Patch0026: 0026-fix-riscv64-support.patch
BuildRequires: make
BuildRequires: git
@ -51,7 +52,11 @@ cp -rf vendor src
mkdir -p src/isula.org/eggo
cp -rf cmd pkg src/isula.org/eggo/
export GOPATH=$(pwd):$GOPATH
%ifarch riscv64
ARCH=riscv64 %{make_build} safe
%else
%{make_build} safe
%endif
strip bin/eggo
%install
@ -72,6 +77,12 @@ rm -rf src
%attr(551,root,root) %{_bindir}/eggo
%changelog
* Sun Apr 09 2023 misaka00251 <liuxin@iscas.ac.cn> - 0.9.4-10
- Type:feature
- CVE:NA
- SUG:NA
- DESC:Fix riscv64 support
* Tue Feb 07 2023 zhangxiaoyu <zhangxiaoyu58@huawei.com> - 0.9.4-9
- Type:bugfix
- CVE:NA