mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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>
This commit is contained in:
parent
e1b305af02
commit
8eb846fd37
4 changed files with 4 additions and 4 deletions
|
|
@ -130,7 +130,7 @@ func hidePanic() {
|
||||||
// supportsDynlink reports whether or not the code generator for the given
|
// supportsDynlink reports whether or not the code generator for the given
|
||||||
// architecture supports the -shared and -dynlink flags.
|
// architecture supports the -shared and -dynlink flags.
|
||||||
func supportsDynlink(arch *sys.Arch) bool {
|
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
|
// timing data for compiler phases
|
||||||
|
|
|
||||||
2
src/cmd/dist/test.go
vendored
2
src/cmd/dist/test.go
vendored
|
|
@ -1021,7 +1021,7 @@ func (t *tester) supportedBuildmode(mode string) bool {
|
||||||
case "pie":
|
case "pie":
|
||||||
switch pair {
|
switch pair {
|
||||||
case "aix/ppc64",
|
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":
|
"android-amd64", "android-arm", "android-arm64", "android-386":
|
||||||
return true
|
return true
|
||||||
case "darwin-amd64", "darwin-arm64":
|
case "darwin-amd64", "darwin-arm64":
|
||||||
|
|
|
||||||
|
|
@ -2022,7 +2022,7 @@ func TestBuildmodePIE(t *testing.T) {
|
||||||
|
|
||||||
platform := fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH)
|
platform := fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH)
|
||||||
switch platform {
|
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",
|
"android/amd64", "android/arm", "android/arm64", "android/386",
|
||||||
"freebsd/amd64",
|
"freebsd/amd64",
|
||||||
"windows/386", "windows/amd64", "windows/arm":
|
"windows/386", "windows/amd64", "windows/arm":
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@ func BuildModeSupported(compiler, buildmode, goos, goarch string) bool {
|
||||||
|
|
||||||
case "pie":
|
case "pie":
|
||||||
switch platform {
|
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",
|
"android/amd64", "android/arm", "android/arm64", "android/386",
|
||||||
"freebsd/amd64",
|
"freebsd/amd64",
|
||||||
"darwin/amd64", "darwin/arm64",
|
"darwin/amd64", "darwin/arm64",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue