diff options
| author | Joel Sing <joel@sing.id.au> | 2020-05-19 18:56:01 +1000 |
|---|---|---|
| committer | Joel Sing <joel@sing.id.au> | 2020-11-03 12:59:51 +0000 |
| commit | 393f2bb067088cdbdb8d5848e6880b2ce65ddaf9 (patch) | |
| tree | 91d346ce5c6d3019b935a5f5c511338556009c65 /src/cmd | |
| parent | 974def803ee9fd03a755014dcb62d55105c846f1 (diff) | |
| download | go-393f2bb067088cdbdb8d5848e6880b2ce65ddaf9.tar.xz | |
cmd/dist,cmd/go,runtime: add support for cgo on linux/riscv64
Fixes #36641
Change-Id: I51868d83ce341d78d33b221d184c5a5110c60d14
Reviewed-on: https://go-review.googlesource.com/c/go/+/263598
Trust: Joel Sing <joel@sing.id.au>
Run-TryBot: Joel Sing <joel@sing.id.au>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/cmd')
| -rw-r--r-- | src/cmd/dist/build.go | 2 | ||||
| -rw-r--r-- | src/cmd/dist/test.go | 6 | ||||
| -rw-r--r-- | src/cmd/go/testdata/script/build_plugin_non_main.txt | 3 | ||||
| -rw-r--r-- | src/cmd/nm/nm_cgo_test.go | 2 |
4 files changed, 7 insertions, 6 deletions
diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go index d822a83e44..20cb04d797 100644 --- a/src/cmd/dist/build.go +++ b/src/cmd/dist/build.go @@ -1549,7 +1549,7 @@ var cgoEnabled = map[string]bool{ "linux/mipsle": true, "linux/mips64": true, "linux/mips64le": true, - "linux/riscv64": false, // Issue 36641 + "linux/riscv64": true, "linux/s390x": true, "linux/sparc64": true, "android/386": true, diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go index 9c25392cc0..d12a52b1cc 100644 --- a/src/cmd/dist/test.go +++ b/src/cmd/dist/test.go @@ -953,7 +953,7 @@ func (t *tester) internalLink() bool { // Internally linking cgo is incomplete on some architectures. // https://golang.org/issue/10373 // https://golang.org/issue/14449 - if goarch == "mips64" || goarch == "mips64le" || goarch == "mips" || goarch == "mipsle" { + if goarch == "mips64" || goarch == "mips64le" || goarch == "mips" || goarch == "mipsle" || goarch == "riscv64" { return false } if goos == "aix" { @@ -1117,8 +1117,8 @@ func (t *tester) cgoTest(dt *distTest) error { "android-arm", "android-arm64", "dragonfly-amd64", "freebsd-386", "freebsd-amd64", "freebsd-arm", - "linux-386", "linux-amd64", "linux-arm", "linux-ppc64le", "linux-s390x", - "netbsd-386", "netbsd-amd64", "linux-arm64": + "linux-386", "linux-amd64", "linux-arm", "linux-arm64", "linux-ppc64le", "linux-riscv64", "linux-s390x", + "netbsd-386", "netbsd-amd64": cmd := t.addCmd(dt, "misc/cgo/test", t.goTest()) cmd.Env = append(os.Environ(), "GOFLAGS=-ldflags=-linkmode=external") diff --git a/src/cmd/go/testdata/script/build_plugin_non_main.txt b/src/cmd/go/testdata/script/build_plugin_non_main.txt index dba80c29ad..3c82dced73 100644 --- a/src/cmd/go/testdata/script/build_plugin_non_main.txt +++ b/src/cmd/go/testdata/script/build_plugin_non_main.txt @@ -1,5 +1,6 @@ -# Plugins are only supported on linux,cgo and darwin,cgo. +# Plugins are only supported on linux,cgo (!riscv64) and darwin,cgo. [!linux] [!darwin] skip +[linux] [riscv64] skip [!cgo] skip go build -n testdep diff --git a/src/cmd/nm/nm_cgo_test.go b/src/cmd/nm/nm_cgo_test.go index 9a257e0ed2..e0414e6b22 100644 --- a/src/cmd/nm/nm_cgo_test.go +++ b/src/cmd/nm/nm_cgo_test.go @@ -24,7 +24,7 @@ func canInternalLink() bool { } case "linux": switch runtime.GOARCH { - case "arm64", "mips64", "mips64le", "mips", "mipsle", "ppc64", "ppc64le": + case "arm64", "mips64", "mips64le", "mips", "mipsle", "ppc64", "ppc64le", "riscv64": return false } case "openbsd": |
