diff options
author | Paul D. Weber <x0bdev@gmail.com> | 2020-05-26 07:00:30 +0000 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2020-05-26 19:10:28 +0000 |
commit | e5a6a94aeb98fbfd2a046bd75042cbcbc2a529d4 (patch) | |
tree | eada4b4546e81f60b67f3141369da0e70a67ce2f /src/cmd/link/internal/ld/lib.go | |
parent | 20160b37c6b7d12e25987baf2d95ba861b327a3b (diff) | |
download | go-e5a6a94aeb98fbfd2a046bd75042cbcbc2a529d4.tar.gz go-e5a6a94aeb98fbfd2a046bd75042cbcbc2a529d4.zip |
cmd/link/internal/ld/lib.go: use lld on Android
Set linker explicitly to lld because the default does not work on NDK
versions r19c, r20, r20b and r21. NDK 18b (or earlier) based builds
will need to specify -fuse-ld=gold.
Fixes #38838
Change-Id: Ib75f71fb9896b843910f41bd12aa1e36868fa9b3
GitHub-Last-Rev: eeaa171604b59d8ad3d86944ebf21ee758e92f95
GitHub-Pull-Request: golang/go#39217
Reviewed-on: https://go-review.googlesource.com/c/go/+/235017
Reviewed-by: Elias Naur <mail@eliasnaur.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Elias Naur <mail@eliasnaur.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/cmd/link/internal/ld/lib.go')
-rw-r--r-- | src/cmd/link/internal/ld/lib.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go index 523a7992bb..707e664bd0 100644 --- a/src/cmd/link/internal/ld/lib.go +++ b/src/cmd/link/internal/ld/lib.go @@ -1478,6 +1478,11 @@ func (ctxt *Link) hostlink() { // from the beginning of the section (like sym.STYPE). argv = append(argv, "-Wl,-znocopyreloc") + if objabi.GOOS == "android" { + // Use lld to avoid errors from default linker (issue #38838) + altLinker = "lld" + } + if ctxt.Arch.InFamily(sys.ARM, sys.ARM64) && objabi.GOOS == "linux" { // On ARM, the GNU linker will generate COPY relocations // even with -znocopyreloc set. |