Accepting request 962203 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/962203
OBS-URL: https://build.opensuse.org/package/show/devel:languages:go/go1.17?expand=0&rev=15
This commit is contained in:
Jeff Kowalczyk 2022-03-16 18:17:17 +00:00 committed by Git OBS Bridge
parent 659d48e4e2
commit 791b4ef6d1
3 changed files with 42 additions and 14 deletions

View File

@ -0,0 +1,33 @@
Index: go/src/cmd/link/internal/ld/lib.go
===================================================================
--- go.orig/src/cmd/link/internal/ld/lib.go
+++ go/src/cmd/link/internal/ld/lib.go
@@ -1389,28 +1389,6 @@ func (ctxt *Link) hostlink() {
// 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.
- cmd := exec.Command(*flagExtld, "-fuse-ld=gold", "-Wl,--version")
- 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.

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Mar 9 17:03:28 UTC 2022 - Dirk Müller <dmueller@suse.com>
- add dont-force-gold-on-arm64.patch (bsc#1183043)
- drop binutils-gold dependency
-------------------------------------------------------------------
Thu Mar 3 21:51:40 UTC 2022 - Jeff Kowalczyk <jkowalczyk@suse.com>

View File

@ -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