diff options
author | Clément Chigot <clement.chigot@atos.net> | 2021-11-09 10:01:05 +0100 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2021-11-09 18:37:32 +0000 |
commit | 01103d533a086afd6c06f3eec5057d46f117d2ff (patch) | |
tree | fc5d8a7eba0cb35608f660430f11c03a5b55aec9 /src/cmd/link | |
parent | 55e6e825d4c90544248c3a725b4dee9fb45848e7 (diff) | |
download | go-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.go | 15 |
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 { |