From 6c167fc6f6fa0ab23f9c479357cd4096fb60308a420d40dcd6242f0513cf7391 Mon Sep 17 00:00:00 2001 From: Jeff Kowalczyk Date: Wed, 16 Mar 2022 18:18:10 +0000 Subject: [PATCH] Accepting request 962202 from home:dirkmueller:Factory - add dont-force-gold-on-arm64.patch (bsc#1183043) - drop binutils-gold dependency OBS-URL: https://build.opensuse.org/request/show/962202 OBS-URL: https://build.opensuse.org/package/show/devel:languages:go/go1.18?expand=0&rev=7 --- dont-force-gold-on-arm64.patch | 33 +++++++++++++++++++++++++++++++++ go1.18.changes | 6 ++++++ go1.18.spec | 17 +++-------------- 3 files changed, 42 insertions(+), 14 deletions(-) create mode 100644 dont-force-gold-on-arm64.patch diff --git a/dont-force-gold-on-arm64.patch b/dont-force-gold-on-arm64.patch new file mode 100644 index 0000000..0b370e7 --- /dev/null +++ b/dont-force-gold-on-arm64.patch @@ -0,0 +1,33 @@ +--- go/src/cmd/link/internal/ld/lib.go ++++ go/src/cmd/link/internal/ld/lib.go +@@ -1391,30 +1391,6 @@ + // Use lld to avoid errors from default linker (issue #38838) + altLinker = "lld" + } +- +- if ctxt.Arch.InFamily(sys.ARM, sys.ARM64) && buildcfg.GOOS == "linux" { +- // On ARM, the GNU linker will generate COPY relocations +- // even with -znocopyreloc set. +- // https://sourceware.org/bugzilla/show_bug.cgi?id=19962 +- // +- // On ARM64, the GNU linker will fail instead of +- // generating COPY relocations. +- // +- // In both cases, switch to gold. +- 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("ARM external linker must be gold (issue #15696), but is not: %s", out) +- } +- } +- } + } + if ctxt.Arch.Family == sys.ARM64 && buildcfg.GOOS == "freebsd" { + // Switch to ld.bfd on freebsd/arm64. diff --git a/go1.18.changes b/go1.18.changes index 0a15c8a..821c58e 100644 --- a/go1.18.changes +++ b/go1.18.changes @@ -268,6 +268,12 @@ Tue Mar 15 17:42:07 UTC 2022 - Jeff Kowalczyk As a result, Syscall, Syscall6, Syscall9, Syscall12, Syscall15, and Syscall18 are deprecated in favor of SyscallN. +------------------------------------------------------------------- +Wed Mar 9 17:03:28 UTC 2022 - Dirk Müller + +- add dont-force-gold-on-arm64.patch (bsc#1183043) +- drop binutils-gold dependency + ------------------------------------------------------------------- Fri Feb 18 02:10:17 UTC 2022 - Jeff Kowalczyk diff --git a/go1.18.spec b/go1.18.spec index bcfcc52..66ffc49 100644 --- a/go1.18.spec +++ b/go1.18.spec @@ -147,6 +147,8 @@ Source4: README.SUSE Source6: go.gdbinit # We have to compile TSAN ourselves. boo#1052528 Source100: llvm-%{tsan_commit}.tar.xz +# PATCH-FIX-OPENSUSE: https://go-review.googlesource.com/c/go/+/391115 +Patch7: dont-force-gold-on-arm64.patch # PATCH-FIX-UPSTREAM marguerite@opensuse.org - find /usr/bin/go-5 when bootstrapping with gcc5-go Patch8: gcc6-go.patch Patch9: gcc7-go.patch @@ -169,22 +171,8 @@ BuildRequires: gcc-c++ %endif #BNC#818502 debug edit tool of rpm fails on i586 builds BuildRequires: rpm >= 4.11.1 -# Needed on arm aarch64 to avoid -# collect2: fatal error: cannot find 'ld'- -%ifarch %arm aarch64 -BuildRequires: binutils-gold -%endif Requires(post): update-alternatives Requires(postun):update-alternatives -# Needed on arm aarch64 to avoid -# collect2: fatal error: cannot find 'ld'- -%ifarch %arm aarch64 -%if 0%{?is_opensuse} -Requires: binutils-gold -%else -Recommends: binutils-gold -%endif -%endif Requires: gcc Provides: go = %{version} Provides: go-devel = go%{version} @@ -234,6 +222,7 @@ Go runtime race detector libraries. Install this package if you wish to use the %endif # go %setup -q -n go +%patch7 -p1 %if %{with gccgo} %if 0%{?gcc_go_version} == 6 %patch8 -p1