aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorClément Chigot <clement.chigot@atos.net>2018-09-28 14:34:00 +0200
committerIan Lance Taylor <iant@golang.org>2018-10-03 13:38:38 +0000
commita3a69afff85c94be8b6419b03efd5dc14f2425f9 (patch)
treed68578102485e410eac05d38f7f371eb17deb770 /src
parent8919fe9e4d00aec34cfb8e3a0e5c7f629c9e1fc5 (diff)
downloadgo-a3a69afff85c94be8b6419b03efd5dc14f2425f9.tar.xz
cmd/dist: add AIX operating system.
This commit adds AIX operating system to cmd/dist package for ppc64 architecture. The stack guard is increased because of syscalls made inside the runtime which need a larger stack. Disable cmd/vet/all tests until aix/ppc64 is fully available. Change-Id: I7e3caf86724249ae564a152d90c1cbd4de288814 Reviewed-on: https://go-review.googlesource.com/c/138715 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src')
-rw-r--r--src/cmd/dist/build.go2
-rw-r--r--src/cmd/dist/buildruntime.go4
-rw-r--r--src/cmd/dist/main.go3
-rw-r--r--src/cmd/internal/objabi/head.go5
-rw-r--r--src/cmd/vet/all/main.go6
5 files changed, 20 insertions, 0 deletions
diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go
index b27d3aac4d..49f4a5e6a7 100644
--- a/src/cmd/dist/build.go
+++ b/src/cmd/dist/build.go
@@ -87,6 +87,7 @@ var okgoos = []string{
"openbsd",
"plan9",
"windows",
+ "aix",
}
// find reports the first index of p in l[0:n], or else -1.
@@ -1388,6 +1389,7 @@ func checkNotStale(goBinary string, targets ...string) {
// single point of truth for supported platforms. This list is used
// by 'go tool dist list'.
var cgoEnabled = map[string]bool{
+ "aix/ppc64": false,
"darwin/386": true,
"darwin/amd64": true,
"darwin/arm": true,
diff --git a/src/cmd/dist/buildruntime.go b/src/cmd/dist/buildruntime.go
index acf2230cb4..10d1552c94 100644
--- a/src/cmd/dist/buildruntime.go
+++ b/src/cmd/dist/buildruntime.go
@@ -87,6 +87,10 @@ func mkzbootstrap(file string) {
// stack guard size. Larger multipliers are used for non-optimized
// builds that have larger stack frames.
func stackGuardMultiplier() int {
+ // On AIX, a larger stack is needed for syscalls
+ if goos == "aix" {
+ return 2
+ }
for _, s := range strings.Split(os.Getenv("GO_GCFLAGS"), " ") {
if s == "-N" {
return 2
diff --git a/src/cmd/dist/main.go b/src/cmd/dist/main.go
index 37e37e2733..bf08869afb 100644
--- a/src/cmd/dist/main.go
+++ b/src/cmd/dist/main.go
@@ -81,6 +81,9 @@ func main() {
}
case "windows":
exe = ".exe"
+ case "aix":
+ // uname -m doesn't work under AIX
+ gohostarch = "ppc64"
}
sysinit()
diff --git a/src/cmd/internal/objabi/head.go b/src/cmd/internal/objabi/head.go
index 23c7b62daf..db2221d6b1 100644
--- a/src/cmd/internal/objabi/head.go
+++ b/src/cmd/internal/objabi/head.go
@@ -48,10 +48,13 @@ const (
Hplan9
Hsolaris
Hwindows
+ Haix
)
func (h *HeadType) Set(s string) error {
switch s {
+ case "aix":
+ *h = Haix
case "darwin":
*h = Hdarwin
case "dragonfly":
@@ -82,6 +85,8 @@ func (h *HeadType) Set(s string) error {
func (h *HeadType) String() string {
switch *h {
+ case Haix:
+ return "aix"
case Hdarwin:
return "darwin"
case Hdragonfly:
diff --git a/src/cmd/vet/all/main.go b/src/cmd/vet/all/main.go
index 24dfafd7bf..7e4a68101f 100644
--- a/src/cmd/vet/all/main.go
+++ b/src/cmd/vet/all/main.go
@@ -204,6 +204,12 @@ func (p platform) vet() {
return
}
+ if p.os == "aix" && p.arch == "ppc64" {
+ // TODO(aix): enable as soon as the aix/ppc64 port has fully landed
+ fmt.Println("skipping aix/ppc64")
+ return
+ }
+
var buf bytes.Buffer
fmt.Fprintf(&buf, "go run main.go -p %s\n", p)