cmd: add -maix32 to gcc calls for aix/ppc
authorClément Chigot <clement.chigot@atos.net>
Wed, 26 Aug 2020 08:19:23 +0000 (10:19 +0200)
committerIan Lance Taylor <iant@golang.org>
Wed, 26 Aug 2020 23:29:03 +0000 (16:29 -0700)
As gcc might now be compiled in 64bit, -maix32 must always be added
to ensure that created objects will be 32bit.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/250778

gcc/go/gofrontend/MERGE
libgo/go/cmd/cgo/gcc.go
libgo/go/cmd/go/internal/work/exec.go

index 2f0865b7c80ae7a5d6b3e08551c81a4164afbe4f..780588aabc56bedf79f87ea289d4ea3301da2890 100644 (file)
@@ -1,4 +1,4 @@
-aac2b382839154d74eeef160522c0a5c1ea8aadf
+9aed2d2c5e9c69aa530bf09d72d33c66e497d720
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
index 249cfe4675db0ce6023774afd8247ade849a481f..f774cbb9353d9ae0689b0de23d29a55ca0fa0d16 100644 (file)
@@ -1573,6 +1573,10 @@ func (p *Package) gccMachine() []string {
                if goos == "aix" {
                        return []string{"-maix64"}
                }
+       case "ppc":
+               if goos == "aix" {
+                       return []string{"-maix32"}
+               }
        }
        return nil
 }
@@ -1615,7 +1619,6 @@ func (p *Package) gccCmd() []string {
        c = append(c, p.GccOptions...)
        c = append(c, p.gccMachine()...)
        if goos == "aix" {
-               c = append(c, "-maix64")
                c = append(c, "-mcmodel=large")
        }
        c = append(c, "-") //read input from standard input
index d610410a72cb8fee67476660d84ee2bc6c68662e..65f3011adfa4fd0e6a96a7a5259c68b3a5f9c8e0 100644 (file)
@@ -2503,6 +2503,10 @@ func (b *Builder) gccArchArgs() []string {
                if cfg.Goos == "aix" {
                        return []string{"-maix64"}
                }
+       case "ppc":
+               if cfg.Goos == "aix" {
+                       return []string{"-maix32"}
+               }
        }
        return nil
 }