cmd/link: fix GCC startfiles names on AIX

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>
This commit is contained in:
Clément Chigot 2021-11-09 10:01:05 +01:00 committed by Ian Lance Taylor
parent 55e6e825d4
commit 01103d533a
1 changed files with 13 additions and 2 deletions

View 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 {