diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go index 1869fb5b2d..ca617e917e 100644 --- a/src/cmd/dist/test.go +++ b/src/cmd/dist/test.go @@ -894,7 +894,7 @@ func (t *tester) extLink() bool { pair := gohostos + "-" + goarch switch pair { case "aix-ppc64", - "android-arm", + "android-arm", "android-arm64", "darwin-386", "darwin-amd64", "darwin-arm", "darwin-arm64", "dragonfly-amd64", "freebsd-386", "freebsd-amd64", "freebsd-arm", @@ -937,7 +937,12 @@ func (t *tester) internalLink() bool { } func (t *tester) internalLinkPIE() bool { - return goos == "linux" && (goarch == "amd64" || goarch == "arm64") + switch goos + "-" + goarch { + case "linux-amd64", "linux-arm64", + "android-arm64": + return true + } + return false } func (t *tester) supportedBuildmode(mode string) bool { @@ -1066,7 +1071,7 @@ func (t *tester) cgoTest(dt *distTest) error { cmd = t.addCmd(dt, "misc/cgo/test", t.goTest(), "-ldflags", "-linkmode=external -s") case "aix-ppc64", - "android-arm", + "android-arm", "android-arm64", "dragonfly-amd64", "freebsd-386", "freebsd-amd64", "freebsd-arm", "linux-386", "linux-amd64", "linux-arm", "linux-ppc64le", "linux-s390x", @@ -1114,7 +1119,7 @@ func (t *tester) cgoTest(dt *distTest) error { if t.supportedBuildmode("pie") { t.addCmd(dt, "misc/cgo/test", t.goTest(), "-buildmode=pie") - if t.internalLinkPIE() { + if t.internalLink() && t.internalLinkPIE() { t.addCmd(dt, "misc/cgo/test", t.goTest(), "-buildmode=pie", "-ldflags=-linkmode=internal") } t.addCmd(dt, "misc/cgo/testtls", t.goTest(), "-buildmode=pie")