From fd8ecd035feba951ff7e7567093ad0d23b253033 Mon Sep 17 00:00:00 2001 From: Mike Rochefort Date: Sun, 6 Nov 2022 19:25:07 -0500 Subject: [PATCH 1/3] Update to go1.19.3 Resolves: rhbz#2139548 --- .gitignore | 1 + golang.spec | 10 +++++++--- sources | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 8d13034..c8cdd86 100644 --- a/.gitignore +++ b/.gitignore @@ -122,3 +122,4 @@ /go1.19.src.tar.gz /go1.19.1.src.tar.gz /go1.19.2.src.tar.gz +/go1.19.3.src.tar.gz diff --git a/golang.spec b/golang.spec index ee816d7..0925957 100644 --- a/golang.spec +++ b/golang.spec @@ -108,7 +108,7 @@ # Comment out go_prerelease and go_patch as needed %global go_api 1.19 #global go_prerelease rc2 -%global go_patch 2 +%global go_patch 3 %global go_version %{go_api}%{?go_patch:.%{go_patch}}%{?go_prerelease:~%{go_prerelease}} %global go_source %{go_api}%{?go_patch:.%{go_patch}}%{?go_prerelease} @@ -145,12 +145,12 @@ Provides: go = %{version}-%{release} # Bundled/Vendored provides generated by bundled-deps.sh based on the in tree module data # - in version filed substituted with . per versioning guidelines -Provides: bundled(golang(github.com/google/pprof)) = 0.0.0.20220517023622.154dc81eb7b0 +Provides: bundled(golang(github.com/google/pprof)) = 0.0.0.20220729232143.a41b82acbcb1 Provides: bundled(golang(github.com/ianlancetaylor/demangle)) = 0.0.0.20220319035150.800ac71e25c2 Provides: bundled(golang(golang.org/x/arch)) = 0.0.0.20220412001346.fc48f9fe4c15 Provides: bundled(golang(golang.org/x/crypto)) = 0.0.0.20220516162934.403b01795ae8 Provides: bundled(golang(golang.org/x/mod)) = 0.6.0.dev.0.20220419223038.86c51ed26bb4 -Provides: bundled(golang(golang.org/x/net)) = 0.0.0.20220517181318.183a9ca12b87 +Provides: bundled(golang(golang.org/x/net)) = 0.0.0.20220907013720.d52c520e3766 Provides: bundled(golang(golang.org/x/sync)) = 0.0.0.20220513210516.0976fa681c29 Provides: bundled(golang(golang.org/x/sys)) = 0.0.0.20220614162138.6c1b26c55098 Provides: bundled(golang(golang.org/x/term)) = 0.0.0.20220411215600.e5f449aeb171 @@ -537,6 +537,10 @@ fi %endif %changelog +* Sun Nov 06 2022 Mike Rochefort - 1.19.3-1 +- Update to go1.19.3 +- Resolves: rhbz#2139548 + * Tue Oct 04 2022 Alejandro Sáez - 1.19.2-1 - Update to go1.19.2 diff --git a/sources b/sources index 4546c34..52f1bf2 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (go1.19.2.src.tar.gz) = 72901e5eaf1857b22bf62a82690579aa4bd8b8130f16416313d249600c99e1ae3c1451ac5c53138ce41dd39dd72dcf8d0f3592b98f4239754efcf4f8b0103cb4 +SHA512 (go1.19.3.src.tar.gz) = 9aa8548597d52455afad8bf3b882eeeb9992814721ff2b9d8ed1f0e1ee0fec74aecd9d4e8c9c00eafbfe690bcdc50f3ad0b00bc4818b87e9d584cce7df97ee76 From c874af597b615c9c411b433943b637efcffe4e1f Mon Sep 17 00:00:00 2001 From: Amit Shah Date: Tue, 8 Nov 2022 22:09:11 +0000 Subject: [PATCH 2/3] Fix build without the gold linker The Go runtime silently chose the gold linker on arm and aarch64 build targets to work around a binutils bug. That bug was from 2016, and has been fixed in binutils for a while. But the Go workaround was still in place. The workaround to choose gold was supposed to error out during the configure phase if gold wasn't found - but that doesn't happen. This leads to builds on aarch64 failing if attempting to compile without gold. Just removing the special condition in the Go source code: https://go-review.googlesource.com/c/go/+/391115/ works, but that patch is unlikely to be merged upstream. A patch fixing the build is more likely to be merged: https://go-review.googlesource.com/c/go/+/366279/ which updates the linker selection to use gold only if available. References to this bug in upstream Go and Binutils: https://github.com/golang/go/issues/22040 https://sourceware.org/bugzilla/show_bug.cgi?id=19962 Including the likely-to-be-merged patch here. --- ...d-on-ARM-ARM64-only-if-gold-is-avail.patch | 53 +++++++++++++++++++ golang.spec | 6 ++- 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 0004-cmd-link-use-gold-on-ARM-ARM64-only-if-gold-is-avail.patch diff --git a/0004-cmd-link-use-gold-on-ARM-ARM64-only-if-gold-is-avail.patch b/0004-cmd-link-use-gold-on-ARM-ARM64-only-if-gold-is-avail.patch new file mode 100644 index 0000000..d0a7149 --- /dev/null +++ b/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/golang.spec b/golang.spec index 0925957..07fa653 100644 --- a/golang.spec +++ b/golang.spec @@ -114,7 +114,7 @@ %global go_source %{go_api}%{?go_patch:.%{go_patch}}%{?go_prerelease} # For rpmdev-bumpspec and releng automation -%global baserelease 1 +%global baserelease 2 Name: golang Version: %{go_version} @@ -162,6 +162,7 @@ Requires: %{name}-src = %{version}-%{release} 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 # Having documentation separate was broken Obsoletes: %{name}-docs < 1.1-4 @@ -537,6 +538,9 @@ fi %endif %changelog +* Tue Nov 8 2022 Amit Shah - 1.19.3-2 +- Fix build without binutils-gold + * Sun Nov 06 2022 Mike Rochefort - 1.19.3-1 - Update to go1.19.3 - Resolves: rhbz#2139548 From 67a51aa259eea7f853f3b9d72b88139ec85bfb55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20S=C3=A1ez?= Date: Wed, 7 Dec 2022 13:29:48 +0100 Subject: [PATCH 3/3] Update to go1.19.4 Resolves: rhbz#2151595 --- .gitignore | 1 + golang.spec | 8 ++++++-- sources | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index c8cdd86..d1e91fb 100644 --- a/.gitignore +++ b/.gitignore @@ -123,3 +123,4 @@ /go1.19.1.src.tar.gz /go1.19.2.src.tar.gz /go1.19.3.src.tar.gz +/go1.19.4.src.tar.gz diff --git a/golang.spec b/golang.spec index 07fa653..0637584 100644 --- a/golang.spec +++ b/golang.spec @@ -108,13 +108,13 @@ # Comment out go_prerelease and go_patch as needed %global go_api 1.19 #global go_prerelease rc2 -%global go_patch 3 +%global go_patch 4 %global go_version %{go_api}%{?go_patch:.%{go_patch}}%{?go_prerelease:~%{go_prerelease}} %global go_source %{go_api}%{?go_patch:.%{go_patch}}%{?go_prerelease} # For rpmdev-bumpspec and releng automation -%global baserelease 2 +%global baserelease 1 Name: golang Version: %{go_version} @@ -538,6 +538,10 @@ fi %endif %changelog +* Wed Dec 07 2022 Alejandro Sáez - 1.19.4-1 +- Update to go1.19.4 +- Resolves: rhbz#2151595 + * Tue Nov 8 2022 Amit Shah - 1.19.3-2 - Fix build without binutils-gold diff --git a/sources b/sources index 52f1bf2..d696cac 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (go1.19.3.src.tar.gz) = 9aa8548597d52455afad8bf3b882eeeb9992814721ff2b9d8ed1f0e1ee0fec74aecd9d4e8c9c00eafbfe690bcdc50f3ad0b00bc4818b87e9d584cce7df97ee76 +SHA512 (go1.19.4.src.tar.gz) = 00866e171d73170583e292439beecdaaee1b8fa907b6ab03013390b0cd7eaebfbe8cb9f9222f1af86933b50602e584677bc3aa25993c02d07a11625a62db263b