Skip to content

Commit a3a69af

Browse files
Clément Chigotianlancetaylor
Clément Chigot
authored andcommitted
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>
1 parent 8919fe9 commit a3a69af

File tree

5 files changed

+20
-0
lines changed

5 files changed

+20
-0
lines changed

src/cmd/dist/build.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ var okgoos = []string{
8787
"openbsd",
8888
"plan9",
8989
"windows",
90+
"aix",
9091
}
9192

9293
// find reports the first index of p in l[0:n], or else -1.
@@ -1388,6 +1389,7 @@ func checkNotStale(goBinary string, targets ...string) {
13881389
// single point of truth for supported platforms. This list is used
13891390
// by 'go tool dist list'.
13901391
var cgoEnabled = map[string]bool{
1392+
"aix/ppc64": false,
13911393
"darwin/386": true,
13921394
"darwin/amd64": true,
13931395
"darwin/arm": true,

src/cmd/dist/buildruntime.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ func mkzbootstrap(file string) {
8787
// stack guard size. Larger multipliers are used for non-optimized
8888
// builds that have larger stack frames.
8989
func stackGuardMultiplier() int {
90+
// On AIX, a larger stack is needed for syscalls
91+
if goos == "aix" {
92+
return 2
93+
}
9094
for _, s := range strings.Split(os.Getenv("GO_GCFLAGS"), " ") {
9195
if s == "-N" {
9296
return 2

src/cmd/dist/main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ func main() {
8181
}
8282
case "windows":
8383
exe = ".exe"
84+
case "aix":
85+
// uname -m doesn't work under AIX
86+
gohostarch = "ppc64"
8487
}
8588

8689
sysinit()

src/cmd/internal/objabi/head.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,13 @@ const (
4848
Hplan9
4949
Hsolaris
5050
Hwindows
51+
Haix
5152
)
5253

5354
func (h *HeadType) Set(s string) error {
5455
switch s {
56+
case "aix":
57+
*h = Haix
5558
case "darwin":
5659
*h = Hdarwin
5760
case "dragonfly":
@@ -82,6 +85,8 @@ func (h *HeadType) Set(s string) error {
8285

8386
func (h *HeadType) String() string {
8487
switch *h {
88+
case Haix:
89+
return "aix"
8590
case Hdarwin:
8691
return "darwin"
8792
case Hdragonfly:

src/cmd/vet/all/main.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,12 @@ func (p platform) vet() {
204204
return
205205
}
206206

207+
if p.os == "aix" && p.arch == "ppc64" {
208+
// TODO(aix): enable as soon as the aix/ppc64 port has fully landed
209+
fmt.Println("skipping aix/ppc64")
210+
return
211+
}
212+
207213
var buf bytes.Buffer
208214
fmt.Fprintf(&buf, "go run main.go -p %s\n", p)
209215

0 commit comments

Comments
 (0)