diff --git a/SOURCES/0004-cmd-link-use-gold-on-ARM-ARM64-only-if-gold-is-avail.patch b/SOURCES/0004-cmd-link-use-gold-on-ARM-ARM64-only-if-gold-is-avail.patch new file mode 100644 index 0000000..d0a7149 --- /dev/null +++ b/SOURCES/0004-cmd-link-use-gold-on-ARM-ARM64-only-if-gold-is-avail.patch @@ -0,0 +1,53 @@ +From 5ccf9f47bf4f5ba53e0ab7338a7fd4626714cfb2 Mon Sep 17 00:00:00 2001 +From: Jeffery To +Date: Tue, 23 Nov 2021 15:05:37 +0800 +Subject: [PATCH] cmd/link: use gold on ARM/ARM64 only if gold is available + +COPY relocation handling on ARM/ARM64 has been fixed in recent versions +of the GNU linker. This switches to gold only if gold is available. + +Fixes #22040. +--- + src/cmd/link/internal/ld/lib.go | 19 +++++++------------ + 1 file changed, 7 insertions(+), 12 deletions(-) + +diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go +index 9e13db7b71..2b379259a2 100644 +--- a/src/cmd/link/internal/ld/lib.go ++++ b/src/cmd/link/internal/ld/lib.go +@@ -1390,25 +1390,20 @@ func (ctxt *Link) hostlink() { + } + + if ctxt.Arch.InFamily(sys.ARM, sys.ARM64) && buildcfg.GOOS == "linux" { +- // On ARM, the GNU linker will generate COPY relocations +- // even with -znocopyreloc set. ++ // On ARM, older versions of 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. ++ // On ARM64, older versions of 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. ++ // In both cases, switch to gold if gold is available. + 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 bytes.Contains(out, []byte("GNU gold")) { ++ altLinker = "gold" + } + } + } +-- +2.32.0 + diff --git a/SOURCES/fedora.go b/SOURCES/fedora.go new file mode 100644 index 0000000..81b28ba --- /dev/null +++ b/SOURCES/fedora.go @@ -0,0 +1,7 @@ +// +build rpm_crashtraceback + +package runtime + +func init() { + setTraceback("crash") +} diff --git a/SOURCES/golang-gdbinit b/SOURCES/golang-gdbinit index 4ef690b..ecddca6 100644 --- a/SOURCES/golang-gdbinit +++ b/SOURCES/golang-gdbinit @@ -1 +1 @@ -add-auto-load-safe-path /usr/lib/golang/src/pkg/runtime/runtime-gdb.py +add-auto-load-safe-path /usr/lib/golang/src/runtime/runtime-gdb.py diff --git a/SPECS/golang.spec b/SPECS/golang.spec index 01bcb4f..6cd1914 100644 --- a/SPECS/golang.spec +++ b/SPECS/golang.spec @@ -80,6 +80,10 @@ Source1: powerel.go Source100: golang-gdbinit Source101: golang-prelink.conf Patch1: disable-google-proxy-and-sumdb.patch +Patch2: 0002-syscall-expose-IfInfomsg.X__ifi_pad-on-s390x.patch +Patch3: 0003-cmd-go-disable-Google-s-proxy-and-sumdb.patch +Patch4: 0004-cmd-link-use-gold-on-ARM-ARM64-only-if-gold-is-avail.patch + %if !%{golang_bootstrap} BuildRequires: gcc-go >= 5 @@ -90,15 +94,17 @@ BuildRequires: hostname BuildRequires: net-tools BuildRequires: pcre-devel, glibc-static, procps-ng Provides: go = %{version}-%{release} -Provides: bundled(golang(github.com/google/pprof)) = 0.0.0.20201203190320.1bf35d6f28c2 -Provides: bundled(golang(github.com/ianlancetaylor/demangle)) = 0.0.0.20200824232613.28f6c0f3b639 -Provides: bundled(golang(golang.org/x/arch)) = 0.0.0.20201008161808.52c3e6f60cff -Provides: bundled(golang(golang.org/x/crypto)) = 0.0.0.20201016220609.9e8e0b390897 -Provides: bundled(golang(golang.org/x/mod)) = 0.4.1 -Provides: bundled(golang(golang.org/x/net)) = 0.0.0.20201209123823.ac852fbbde11 -Provides: bundled(golang(golang.org/x/sys)) = 0.0.0.20201204225414.ed752295db88 -Provides: bundled(golang(golang.org/x/text)) = 0.3.4 -Provides: bundled(golang(golang.org/x/tools)) = 0.0.0.20210107193943.4ed967dd8eff +Provides: bundled(golang(github.com/google/pprof)) = 0.0.0.20221118152302.e6195bd50e26 +Provides: bundled(golang(github.com/ianlancetaylor/demangle)) = 0.0.0.20220319035150.800ac71e25c2 +Provides: bundled(golang(golang.org/x/arch)) = 0.1.1.0.20221116201807.1bb480fc256a +Provides: bundled(golang(golang.org/x/crypto)) = 0.3.1.0.20221117191849.2c476679df9a +Provides: bundled(golang(golang.org/x/mod)) = 0.7.0 +Provides: bundled(golang(golang.org/x/net)) = 0.3.1.0.20221206200815.1e63c2f08a10 +Provides: bundled(golang(golang.org/x/sync)) = 0.1.0 +Provides: bundled(golang(golang.org/x/sys)) = 0.3.0 +Provides: bundled(golang(golang.org/x/term)) = 0.2.0 +Provides: bundled(golang(golang.org/x/text)) = 0.5.0 +Provides: bundled(golang(golang.org/x/tools)) = 0.3.1.0.20230118190848.070db2996ebe Provides: bundled(golang(golang.org/x/xerrors)) = 0.0.0.20200804184101.5ec99f83aff1 Requires: %{name}-bin = %{version}-%{release} Requires: %{name}-src = %{version}-%{release}