From: Tobias Klauser Date: Wed, 13 Jun 2018 08:51:17 +0000 (+0200) Subject: cmd/dist, go/types: add support for GOARCH=riscv64 X-Git-Tag: go1.11beta1~122 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=16caec5892c67ae322be192841d9f15cb2f1c0bc;p=gostls13.git cmd/dist, go/types: add support for GOARCH=riscv64 This is needed in addition to CL 110066 in order to be able to generate Go type definitions for linux/riscv64 in the golang.org/x/sys/unix package. Change-Id: I4a27e6424aaea63283b55bd4f73b958b41f29d72 Reviewed-on: https://go-review.googlesource.com/118618 Run-TryBot: Tobias Klauser TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go index effea903e9..616e76dfe7 100644 --- a/src/cmd/dist/build.go +++ b/src/cmd/dist/build.go @@ -67,6 +67,7 @@ var okgoarch = []string{ "mips64le", "ppc64", "ppc64le", + "riscv64", "s390x", "wasm", } @@ -1393,6 +1394,7 @@ var cgoEnabled = map[string]bool{ "linux/mipsle": true, "linux/mips64": true, "linux/mips64le": true, + "linux/riscv64": true, "linux/s390x": true, "android/386": true, "android/amd64": true, diff --git a/src/cmd/vet/all/main.go b/src/cmd/vet/all/main.go index 6c56daff03..4b1df73b54 100644 --- a/src/cmd/vet/all/main.go +++ b/src/cmd/vet/all/main.go @@ -197,6 +197,11 @@ func (p platform) vet() { fmt.Println("skipping js/wasm") return } + if p.os == "linux" && p.arch == "riscv64" { + // TODO(tklauser): enable as soon as the riscv64 port has fully landed + fmt.Println("skipping linux/riscv64") + return + } var buf bytes.Buffer fmt.Fprintf(&buf, "go run main.go -p %s\n", p) diff --git a/src/go/types/sizes.go b/src/go/types/sizes.go index fda0c95469..7b5410167f 100644 --- a/src/go/types/sizes.go +++ b/src/go/types/sizes.go @@ -167,6 +167,7 @@ var gcArchSizes = map[string]*StdSizes{ "mips64le": {8, 8}, "ppc64": {8, 8}, "ppc64le": {8, 8}, + "riscv64": {8, 8}, "s390x": {8, 8}, "wasm": {8, 8}, // When adding more architectures here, @@ -178,7 +179,7 @@ var gcArchSizes = map[string]*StdSizes{ // // Supported architectures for compiler "gc": // "386", "arm", "arm64", "amd64", "amd64p32", "mips", "mipsle", -// "mips64", "mips64le", "ppc64", "ppc64le", "s390x", "wasm". +// "mips64", "mips64le", "ppc64", "ppc64le", "riscv64", "s390x", "wasm". func SizesFor(compiler, arch string) Sizes { if compiler != "gc" { return nil