Skip to content

Commit 8bf4c22

Browse files
tklauserdna2github
authored andcommitted
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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent 385785f commit 8bf4c22

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

src/cmd/dist/build.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ var okgoarch = []string{
6767
"mips64le",
6868
"ppc64",
6969
"ppc64le",
70+
"riscv64",
7071
"s390x",
7172
"wasm",
7273
}
@@ -1393,6 +1394,7 @@ var cgoEnabled = map[string]bool{
13931394
"linux/mipsle": true,
13941395
"linux/mips64": true,
13951396
"linux/mips64le": true,
1397+
"linux/riscv64": true,
13961398
"linux/s390x": true,
13971399
"android/386": true,
13981400
"android/amd64": true,

src/cmd/vet/all/main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,11 @@ func (p platform) vet() {
197197
fmt.Println("skipping js/wasm")
198198
return
199199
}
200+
if p.os == "linux" && p.arch == "riscv64" {
201+
// TODO(tklauser): enable as soon as the riscv64 port has fully landed
202+
fmt.Println("skipping linux/riscv64")
203+
return
204+
}
200205

201206
var buf bytes.Buffer
202207
fmt.Fprintf(&buf, "go run main.go -p %s\n", p)

src/go/types/sizes.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ var gcArchSizes = map[string]*StdSizes{
167167
"mips64le": {8, 8},
168168
"ppc64": {8, 8},
169169
"ppc64le": {8, 8},
170+
"riscv64": {8, 8},
170171
"s390x": {8, 8},
171172
"wasm": {8, 8},
172173
// When adding more architectures here,
@@ -178,7 +179,7 @@ var gcArchSizes = map[string]*StdSizes{
178179
//
179180
// Supported architectures for compiler "gc":
180181
// "386", "arm", "arm64", "amd64", "amd64p32", "mips", "mipsle",
181-
// "mips64", "mips64le", "ppc64", "ppc64le", "s390x", "wasm".
182+
// "mips64", "mips64le", "ppc64", "ppc64le", "riscv64", "s390x", "wasm".
182183
func SizesFor(compiler, arch string) Sizes {
183184
if compiler != "gc" {
184185
return nil

0 commit comments

Comments
 (0)