1
0
mirror of https://github.com/golang/go synced 2024-11-23 20:20:01 -07:00

cmd/dist: enable cgo and PIE tests on android/arm64

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>
This commit is contained in:
Cherry Zhang 2020-02-26 10:24:39 -05:00
parent c70f069902
commit af1f3b0082

13
src/cmd/dist/test.go vendored
View 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")