mirror of
https://github.com/golang/go
synced 2024-11-23 07:00:05 -07:00
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 <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>
This commit is contained in:
parent
e6ceb92e1c
commit
07a6cbf58a
@ -21,6 +21,7 @@ import (
|
|||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
@ -203,11 +204,14 @@ func TestNoTextrel(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// The install command should have created a "shlibname" file for the
|
// The install command should have created a "shlibname" file for the
|
||||||
// listed packages (and runtime/cgo) indicating the name of the shared
|
// listed packages (and runtime/cgo, and math on arm) indicating the
|
||||||
// library containing it.
|
// name of the shared library containing it.
|
||||||
func TestShlibnameFiles(t *testing.T) {
|
func TestShlibnameFiles(t *testing.T) {
|
||||||
pkgs := append([]string{}, minpkgs...)
|
pkgs := append([]string{}, minpkgs...)
|
||||||
pkgs = append(pkgs, "runtime/cgo")
|
pkgs = append(pkgs, "runtime/cgo")
|
||||||
|
if runtime.GOARCH == "arm" {
|
||||||
|
pkgs = append(pkgs, "math")
|
||||||
|
}
|
||||||
for _, pkg := range pkgs {
|
for _, pkg := range pkgs {
|
||||||
shlibnamefile := filepath.Join(gorootInstallDir, pkg+".shlibname")
|
shlibnamefile := filepath.Join(gorootInstallDir, pkg+".shlibname")
|
||||||
contentsb, err := ioutil.ReadFile(shlibnamefile)
|
contentsb, err := ioutil.ReadFile(shlibnamefile)
|
||||||
|
2
src/cmd/dist/test.go
vendored
2
src/cmd/dist/test.go
vendored
@ -587,7 +587,7 @@ func (t *tester) supportedBuildmode(mode string) bool {
|
|||||||
return false
|
return false
|
||||||
case "shared":
|
case "shared":
|
||||||
switch pair {
|
switch pair {
|
||||||
case "linux-amd64":
|
case "linux-amd64", "linux-arm":
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
@ -378,7 +378,7 @@ func buildModeInit() {
|
|||||||
fatalf("-buildmode=pie not supported by gccgo")
|
fatalf("-buildmode=pie not supported by gccgo")
|
||||||
} else {
|
} else {
|
||||||
switch platform {
|
switch platform {
|
||||||
case "android/arm", "linux/amd64", "android/amd64", "linux/ppc64le":
|
case "linux/arm", "android/arm", "linux/amd64", "android/amd64", "linux/ppc64le":
|
||||||
codegenArg = "-shared"
|
codegenArg = "-shared"
|
||||||
default:
|
default:
|
||||||
fatalf("-buildmode=pie not supported on %s\n", platform)
|
fatalf("-buildmode=pie not supported on %s\n", platform)
|
||||||
|
Loading…
Reference in New Issue
Block a user