aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/link
diff options
context:
space:
mode:
authorClément Chigot <clement.chigot@atos.net>2021-11-09 10:01:05 +0100
committerIan Lance Taylor <iant@golang.org>2021-11-09 18:37:32 +0000
commit01103d533a086afd6c06f3eec5057d46f117d2ff (patch)
treefc5d8a7eba0cb35608f660430f11c03a5b55aec9 /src/cmd/link
parent55e6e825d4c90544248c3a725b4dee9fb45848e7 (diff)
downloadgo-01103d533a086afd6c06f3eec5057d46f117d2ff.tar.gz
go-01103d533a086afd6c06f3eec5057d46f117d2ff.zip
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>
Diffstat (limited to 'src/cmd/link')
-rw-r--r--src/cmd/link/internal/ld/lib.go15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go
index 01ab6474b8..91665b2ebb 100644
--- a/src/cmd/link/internal/ld/lib.go
+++ b/src/cmd/link/internal/ld/lib.go
@@ -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 {