Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0266671

Browse files
aclementsgopherbot
authored andcommittedNov 16, 2022
cmd/dist: add curiously missing GOOS/GOARCH combinations
The cmd/dist cgo_test enumerates a large number of platforms in various special cases. Some combinations are suspiciously absent. This CL completes the combinations. I've confirmed using trybots that the newly-enabled tests pass on android/* (this is not surprising because the gohostos is never "android" anyway), windows/arm64, linux/ppc64 (no cgo), linux/loong64 (except for one test, filed #56623), linux/mips*, netbsd/arm (except for one test, filed #56629), and netbsd/arm64. The windows/arm builder is out to lunch, so I'm assuming that works. Since netbsd/arm and arm64 mostly passed these tests, I've also enabled them on netbsd/386 and netbsd/amd64, where they seem to work fine as well. Preparation for #37486. Change-Id: I04c3348e4f422d74d51e714647ca3db379e6e919 Reviewed-on: https://go-review.googlesource.com/c/go/+/448016 Run-TryBot: Austin Clements <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Auto-Submit: Austin Clements <[email protected]> Reviewed-by: Cherry Mui <[email protected]>
1 parent 38218f3 commit 0266671

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed
 

‎src/cmd/dist/test.go

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,7 +1183,7 @@ func (t *tester) cgoTest(dt *distTest) error {
11831183
pair := gohostos + "-" + goarch
11841184
switch pair {
11851185
case "darwin-amd64", "darwin-arm64",
1186-
"windows-386", "windows-amd64":
1186+
"windows-386", "windows-amd64", "windows-arm", "windows-arm64":
11871187
// test linkmode=external, but __thread not supported, so skip testtls.
11881188
if !t.extLink() {
11891189
break
@@ -1201,11 +1201,11 @@ func (t *tester) cgoTest(dt *distTest) error {
12011201
}
12021202

12031203
case "aix-ppc64",
1204-
"android-arm", "android-arm64",
1204+
"android-386", "android-amd64", "android-arm", "android-arm64",
12051205
"dragonfly-amd64",
12061206
"freebsd-386", "freebsd-amd64", "freebsd-arm", "freebsd-riscv64",
1207-
"linux-386", "linux-amd64", "linux-arm", "linux-arm64", "linux-ppc64le", "linux-riscv64", "linux-s390x",
1208-
"netbsd-386", "netbsd-amd64",
1207+
"linux-386", "linux-amd64", "linux-arm", "linux-arm64", "linux-loong64", "linux-mips", "linux-mipsle", "linux-mips64", "linux-mips64le", "linux-ppc64", "linux-ppc64le", "linux-riscv64", "linux-s390x",
1208+
"netbsd-386", "netbsd-amd64", "netbsd-arm", "netbsd-arm64",
12091209
"openbsd-386", "openbsd-amd64", "openbsd-arm", "openbsd-arm64", "openbsd-mips64":
12101210

12111211
cmd := t.addCmd(dt, "misc/cgo/test", t.goTest(), "-ldflags=-linkmode=external", ".")
@@ -1217,7 +1217,7 @@ func (t *tester) cgoTest(dt *distTest) error {
12171217
t.addCmd(dt, "misc/cgo/testtls", t.goTest(), "-ldflags", "-linkmode=external", ".")
12181218

12191219
switch pair {
1220-
case "aix-ppc64", "netbsd-386", "netbsd-amd64":
1220+
case "aix-ppc64":
12211221
// no static linking
12221222
case "freebsd-arm":
12231223
// -fPIC compiled tls code will use __tls_get_addr instead
@@ -1232,7 +1232,8 @@ func (t *tester) cgoTest(dt *distTest) error {
12321232
if err := cmd.Run(); err != nil {
12331233
fmt.Println("No support for static linking found (lacks libc.a?), skip cgo static linking test.")
12341234
} else {
1235-
if goos != "android" {
1235+
if goos != "android" && pair != "netbsd-arm" {
1236+
// TODO(#56629): Why does this fail on netbsd-arm?
12361237
t.addCmd(dt, "misc/cgo/testtls", t.goTest(), "-ldflags", `-linkmode=external -extldflags "-static -pthread"`, ".")
12371238
}
12381239
t.addCmd(dt, "misc/cgo/nocgo", t.goTest(), ".")
@@ -1243,8 +1244,11 @@ func (t *tester) cgoTest(dt *distTest) error {
12431244
// -static in CGO_LDFLAGS triggers a different code path
12441245
// than -static in -extldflags, so test both.
12451246
// See issue #16651.
1246-
cmd := t.addCmd(dt, "misc/cgo/test", t.goTest(), "-tags=static", ".")
1247-
setEnv(cmd, "CGO_LDFLAGS", "-static -pthread")
1247+
if goarch != "loong64" {
1248+
// TODO(#56623): Why does this fail on loong64?
1249+
cmd := t.addCmd(dt, "misc/cgo/test", t.goTest(), "-tags=static", ".")
1250+
setEnv(cmd, "CGO_LDFLAGS", "-static -pthread")
1251+
}
12481252
}
12491253
}
12501254

0 commit comments

Comments
 (0)
Please sign in to comment.