]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/dist, cmd/go, misc/cgo/testshared: update testshared and run it on arm
authorMichael Hudson-Doyle <michael.hudson@canonical.com>
Wed, 2 Sep 2015 10:26:42 +0000 (22:26 +1200)
committerMichael Hudson-Doyle <michael.hudson@canonical.com>
Tue, 10 Nov 2015 19:57:30 +0000 (19:57 +0000)
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 <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

misc/cgo/testshared/shared_test.go
src/cmd/dist/test.go
src/cmd/go/build.go

index 63cdd9b9ce7707bf6b9a15d8fa59f33cf1c8cf1a..32c6b41d105e5f1eb10eb84e4049d16160b72ce0 100644 (file)
@@ -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)
index 6fa1036a13d76fdb265eae12bdd594ed258fdd29..99e0c6907808dcfc2b68d7dcb4c9465ff86a8a61 100644 (file)
@@ -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
index 4c2eea79ad41ef3c6568b5eb8e5f55287992831a..ea27ae1dd12c1a2ef4251055130070d3223df48d 100644 (file)
@@ -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)