eggo/0026-fix-riscv64-support.patch

46 lines
1.2 KiB
Diff
Raw Normal View History

2023-04-09 15:57:14 +08:00
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)