diff options
| author | Joel Sing <joel@sing.id.au> | 2020-11-04 00:26:15 +1100 |
|---|---|---|
| committer | Joel Sing <joel@sing.id.au> | 2020-11-04 06:12:33 +0000 |
| commit | 8eb846fd37eb7bded8a1cf6932be2c59069863e5 (patch) | |
| tree | da9fd86af15056194c461b3aed68107a0f43397e /src | |
| parent | e1b305af028544e00a22c905e68049c98c10a1cc (diff) | |
| download | go-8eb846fd37eb7bded8a1cf6932be2c59069863e5.tar.xz | |
cmd/compile,cmd/dist,cmd/go: enable pie buildmode for linux/riscv64
Enable pie as a buildmode for linux/riscv64, along with associated tests.
Change-Id: I3fb0234d534dbeb96aa6cee6ae872304fbe02cf4
Reviewed-on: https://go-review.googlesource.com/c/go/+/267317
Trust: Joel Sing <joel@sing.id.au>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd/compile/internal/gc/main.go | 2 | ||||
| -rw-r--r-- | src/cmd/dist/test.go | 2 | ||||
| -rw-r--r-- | src/cmd/go/go_test.go | 2 | ||||
| -rw-r--r-- | src/cmd/internal/sys/supported.go | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/src/cmd/compile/internal/gc/main.go b/src/cmd/compile/internal/gc/main.go index 8b94c7f71b..d1097e8236 100644 --- a/src/cmd/compile/internal/gc/main.go +++ b/src/cmd/compile/internal/gc/main.go @@ -130,7 +130,7 @@ func hidePanic() { // supportsDynlink reports whether or not the code generator for the given // architecture supports the -shared and -dynlink flags. func supportsDynlink(arch *sys.Arch) bool { - return arch.InFamily(sys.AMD64, sys.ARM, sys.ARM64, sys.I386, sys.PPC64, sys.S390X) + return arch.InFamily(sys.AMD64, sys.ARM, sys.ARM64, sys.I386, sys.PPC64, sys.RISCV64, sys.S390X) } // timing data for compiler phases diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go index d12a52b1cc..f087aba2b9 100644 --- a/src/cmd/dist/test.go +++ b/src/cmd/dist/test.go @@ -1021,7 +1021,7 @@ func (t *tester) supportedBuildmode(mode string) bool { case "pie": switch pair { case "aix/ppc64", - "linux-386", "linux-amd64", "linux-arm", "linux-arm64", "linux-ppc64le", "linux-s390x", + "linux-386", "linux-amd64", "linux-arm", "linux-arm64", "linux-ppc64le", "linux-riscv64", "linux-s390x", "android-amd64", "android-arm", "android-arm64", "android-386": return true case "darwin-amd64", "darwin-arm64": diff --git a/src/cmd/go/go_test.go b/src/cmd/go/go_test.go index 7bbadd3974..91d5884036 100644 --- a/src/cmd/go/go_test.go +++ b/src/cmd/go/go_test.go @@ -2022,7 +2022,7 @@ func TestBuildmodePIE(t *testing.T) { platform := fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH) switch platform { - case "linux/386", "linux/amd64", "linux/arm", "linux/arm64", "linux/ppc64le", "linux/s390x", + case "linux/386", "linux/amd64", "linux/arm", "linux/arm64", "linux/ppc64le", "linux/riscv64", "linux/s390x", "android/amd64", "android/arm", "android/arm64", "android/386", "freebsd/amd64", "windows/386", "windows/amd64", "windows/arm": diff --git a/src/cmd/internal/sys/supported.go b/src/cmd/internal/sys/supported.go index 69d7591440..ef7c017bd4 100644 --- a/src/cmd/internal/sys/supported.go +++ b/src/cmd/internal/sys/supported.go @@ -86,7 +86,7 @@ func BuildModeSupported(compiler, buildmode, goos, goarch string) bool { case "pie": switch platform { - case "linux/386", "linux/amd64", "linux/arm", "linux/arm64", "linux/ppc64le", "linux/s390x", + case "linux/386", "linux/amd64", "linux/arm", "linux/arm64", "linux/ppc64le", "linux/riscv64", "linux/s390x", "android/amd64", "android/arm", "android/arm64", "android/386", "freebsd/amd64", "darwin/amd64", "darwin/arm64", |
