From: Michael Hudson-Doyle Date: Wed, 2 Sep 2015 10:26:42 +0000 (+1200) Subject: cmd/dist, cmd/go, misc/cgo/testshared: update testshared and run it on arm X-Git-Tag: go1.6beta1~570 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=07a6cbf58acd812dd935ef6373d567fd75e5ca3f;p=gostls13.git cmd/dist, cmd/go, misc/cgo/testshared: update testshared and run it on arm And enable PIE in cmd/go because that's all it seems to take. Change-Id: Ie017f427ace5e91de333a9f7cba9684c4641dfd5 Reviewed-on: https://go-review.googlesource.com/14222 Reviewed-by: Brad Fitzpatrick Reviewed-by: Ian Lance Taylor Run-TryBot: Michael Hudson-Doyle TryBot-Result: Gobot Gobot --- diff --git a/misc/cgo/testshared/shared_test.go b/misc/cgo/testshared/shared_test.go index 63cdd9b9ce..32c6b41d10 100644 --- a/misc/cgo/testshared/shared_test.go +++ b/misc/cgo/testshared/shared_test.go @@ -21,6 +21,7 @@ import ( "os/exec" "path/filepath" "regexp" + "runtime" "strings" "testing" "time" @@ -203,11 +204,14 @@ func TestNoTextrel(t *testing.T) { } // The install command should have created a "shlibname" file for the -// listed packages (and runtime/cgo) indicating the name of the shared -// library containing it. +// listed packages (and runtime/cgo, and math on arm) indicating the +// name of the shared library containing it. func TestShlibnameFiles(t *testing.T) { pkgs := append([]string{}, minpkgs...) pkgs = append(pkgs, "runtime/cgo") + if runtime.GOARCH == "arm" { + pkgs = append(pkgs, "math") + } for _, pkg := range pkgs { shlibnamefile := filepath.Join(gorootInstallDir, pkg+".shlibname") contentsb, err := ioutil.ReadFile(shlibnamefile) diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go index 6fa1036a13..99e0c69078 100644 --- a/src/cmd/dist/test.go +++ b/src/cmd/dist/test.go @@ -587,7 +587,7 @@ func (t *tester) supportedBuildmode(mode string) bool { return false case "shared": switch pair { - case "linux-amd64": + case "linux-amd64", "linux-arm": return true } return false diff --git a/src/cmd/go/build.go b/src/cmd/go/build.go index 4c2eea79ad..ea27ae1dd1 100644 --- a/src/cmd/go/build.go +++ b/src/cmd/go/build.go @@ -378,7 +378,7 @@ func buildModeInit() { fatalf("-buildmode=pie not supported by gccgo") } else { switch platform { - case "android/arm", "linux/amd64", "android/amd64", "linux/ppc64le": + case "linux/arm", "android/arm", "linux/amd64", "android/amd64", "linux/ppc64le": codegenArg = "-shared" default: fatalf("-buildmode=pie not supported on %s\n", platform)