From 57777dcbc3d05c12ac2b227e7afd5435bf84128c Mon Sep 17 00:00:00 2001
From: hanchao <hanchao63@huawei.com>
Date: Mon, 3 Jul 2023 21:20:32 +0800
Subject: [PATCH] Enable go plugin support for riscv64 (based on work by
 yangjinghua)

---
 src/cmd/link/internal/ld/config.go | 2 +-
 src/internal/platform/supported.go | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/cmd/link/internal/ld/config.go b/src/cmd/link/internal/ld/config.go
index ba74b6f..836c10d 100644
--- a/src/cmd/link/internal/ld/config.go
+++ b/src/cmd/link/internal/ld/config.go
@@ -84,7 +84,7 @@ func (mode *BuildMode) Set(s string) error {
 		switch buildcfg.GOOS {
 		case "linux":
 			switch buildcfg.GOARCH {
-			case "386", "amd64", "arm", "arm64", "ppc64le", "s390x":
+			case "386", "amd64", "arm", "arm64", "riscv64", "ppc64le", "s390x":
 			default:
 				return badmode()
 			}
diff --git a/src/internal/platform/supported.go b/src/internal/platform/supported.go
index 046352f..644822f 100644
--- a/src/internal/platform/supported.go
+++ b/src/internal/platform/supported.go
@@ -180,7 +180,7 @@ func BuildModeSupported(compiler, buildmode, goos, goarch string) bool {
 
 	case "plugin":
 		switch platform {
-		case "linux/amd64", "linux/arm", "linux/arm64", "linux/386", "linux/s390x", "linux/ppc64le",
+		case "linux/amd64", "linux/arm", "linux/arm64", "linux/riscv64", "linux/386", "linux/s390x", "linux/ppc64le",
 			"android/amd64", "android/arm", "android/arm64", "android/386",
 			"darwin/amd64", "darwin/arm64",
 			"freebsd/amd64":
-- 
2.33.0

