go1.21/dont-force-gold-on-arm64.patch
Jeff Kowalczyk 5997ad119b Accepting request 1094489 from home:jfkw:branches:devel:languages:go
- go1.21rc2 (released 2023-06-21) is a release candidate version of
  go1.21 cut from the master branch at the revision tagged
  go1.21rc2. https://go.dev/blog/go1.21rc
  Refs boo#1212475 go1.21 release tracking

OBS-URL: https://build.opensuse.org/request/show/1094489
OBS-URL: https://build.opensuse.org/package/show/devel:languages:go/go1.21?expand=0&rev=1
2023-06-21 21:28:27 +00:00

31 lines
1.1 KiB
Diff

--- go/src/cmd/link/internal/ld/lib.go
+++ go/src/cmd/link/internal/ld/lib.go
@@ -1596,27 +1596,6 @@
// Use lld to avoid errors from default linker (issue #38838)
altLinker = "lld"
}
-
- if ctxt.Arch.InFamily(sys.ARM64) && buildcfg.GOOS == "linux" {
- // On ARM64, the GNU linker will fail with
- // -znocopyreloc if it thinks a COPY relocation is
- // required. Switch to gold.
- // https://sourceware.org/bugzilla/show_bug.cgi?id=19962
- // https://go.dev/issue/22040
- altLinker = "gold"
-
- // If gold is not installed, gcc will silently switch
- // back to ld.bfd. So we parse the version information
- // and provide a useful error if gold is missing.
- name, args := flagExtld[0], flagExtld[1:]
- args = append(args, "-fuse-ld=gold", "-Wl,--version")
- cmd := exec.Command(name, args...)
- if out, err := cmd.CombinedOutput(); err == nil {
- if !bytes.Contains(out, []byte("GNU gold")) {
- log.Fatalf("ARM64 external linker must be gold (issue #15696, 22040), but is not: %s", out)
- }
- }
- }
}
if ctxt.Arch.Family == sys.ARM64 && buildcfg.GOOS == "freebsd" {
// Switch to ld.bfd on freebsd/arm64.