]> Cypherpunks.ru repositories - gostls13.git/commitdiff
cmd/link: fix GCC startfiles names on AIX
authorClément Chigot <clement.chigot@atos.net>
Tue, 9 Nov 2021 09:01:05 +0000 (10:01 +0100)
committerIan Lance Taylor <iant@golang.org>
Tue, 9 Nov 2021 18:37:32 +0000 (18:37 +0000)
Since GCC version 11, the 64-bit version of GCC starting files are
now suffixed by "_64" instead of being stored without suffix under
"ppc64" multilib directory.

Change-Id: Ibe53521ed24d36e5f6282e3574849b9ae11a1e9a
Reviewed-on: https://go-review.googlesource.com/c/go/+/362594
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Ian Lance Taylor <iant@golang.org>

src/cmd/link/internal/ld/lib.go

index 01ab6474b8f240e349c505846e054df29f8980b5..91665b2ebb41944672525edaff7ed162fd0ad4f5 100644 (file)
@@ -1499,8 +1499,19 @@ func (ctxt *Link) hostlink() {
                        }
                        return strings.Trim(string(out), "\n")
                }
-               argv = append(argv, getPathFile("crtcxa.o"))
-               argv = append(argv, getPathFile("crtdbase.o"))
+               // Since GCC version 11, the 64-bit version of GCC starting files
+               // are now suffixed by "_64". Even under "-maix64" multilib directory
+               // "crtcxa.o" is 32-bit.
+               crtcxa := getPathFile("crtcxa_64.o")
+               if !filepath.IsAbs(crtcxa) {
+                       crtcxa = getPathFile("crtcxa.o")
+               }
+               crtdbase := getPathFile("crtdbase_64.o")
+               if !filepath.IsAbs(crtdbase) {
+                       crtdbase = getPathFile("crtdbase.o")
+               }
+               argv = append(argv, crtcxa)
+               argv = append(argv, crtdbase)
        }
 
        if ctxt.linkShared {