]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/dist: enable cgo and PIE tests on android/arm64
authorCherry Zhang <cherryyz@google.com>
Wed, 26 Feb 2020 15:24:39 +0000 (10:24 -0500)
committerCherry Zhang <cherryyz@google.com>
Thu, 27 Feb 2020 01:41:50 +0000 (01:41 +0000)
Now that android/arm64 supports internal linking PIE, enable the
test. While here, I realized that some cgo tests are also not
enabled on android/arm64. Enable them as well. Let's see if it
works.

Change-Id: Ibf186fe402ebf0bbec82873fd56d0eb752b48180
Reviewed-on: https://go-review.googlesource.com/c/go/+/221099
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Elias Naur <mail@eliasnaur.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/dist/test.go

index 1869fb5b2d1d847310d6e66f6aea73c8b0f4180d..ca617e917eff0a682cbcdd15e5e5c9b72ee81ab1 100644 (file)
@@ -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")