Update to Go 1.21.3

- Update bundled-deps.sh to generate a proper output.
- Add 0001-Modify-go.env.patch that modifies the go.env file to change GOPROXY, GOSUMDB, and GOTOOLCHAIN settings.
- Delete 0002-syscall-expose-IfInfomsg.X__ifi_pad-on-s390x.patch.
This commit is contained in:
Alejandro Sáez 2023-10-27 09:32:35 +02:00
parent 78332dc19c
commit 0465580ff3
7 changed files with 62 additions and 96 deletions

2
.gitignore vendored
View File

@ -138,3 +138,5 @@
/go1.20.5-2-openssl-fips.tar.gz
/go1.20.6.src.tar.gz
/go1.20.6-1-openssl-fips.tar.gz
/go1.21.3.src.tar.gz
/go1.21.3-1-openssl-fips.tar.gz

30
0001-Modify-go.env.patch Normal file
View File

@ -0,0 +1,30 @@
From 52d9cfec8124a9c7382bed5284246d9b18a21eb4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20S=C3=A1ez?= <asm@redhat.com>
Date: Wed, 16 Aug 2023 07:06:38 +0200
Subject: [PATCH] Modify go.env
Change GOPROXY, GOSUMDB, and GOTOOLCHAIN
---
go.env | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/go.env b/go.env
index 6ff2b921d4..087208cd7c 100644
--- a/go.env
+++ b/go.env
@@ -4,9 +4,9 @@
# Use the Go module mirror and checksum database by default.
# See https://proxy.golang.org for details.
-GOPROXY=https://proxy.golang.org,direct
-GOSUMDB=sum.golang.org
+GOPROXY=direct
+GOSUMDB=off
# Automatically download newer toolchains as directed by go.mod files.
# See https://go.dev/doc/toolchain for details.
-GOTOOLCHAIN=auto
+GOTOOLCHAIN=local
--
2.41.0

View File

@ -1,41 +0,0 @@
From 67a4711d09c6595c17f32470c15bf471c287777d Mon Sep 17 00:00:00 2001
From: Michael Munday <munday@ca.ibm.com>
Date: Tue, 17 Jan 2017 11:33:38 -0500
Subject: [PATCH 2/3] syscall: expose IfInfomsg.X__ifi_pad on s390x
Exposing this field on s390x improves compatibility with the other
linux architectures, all of which already expose it.
Fixes #18628 and updates #18632.
Change-Id: I08e8e1eb705f898cd8822f8bee0d61ce11d514b5
---
src/syscall/ztypes_linux_s390x.go | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/syscall/ztypes_linux_s390x.go b/src/syscall/ztypes_linux_s390x.go
index 91f5ceff20..59a8b1fccd 100644
--- a/src/syscall/ztypes_linux_s390x.go
+++ b/src/syscall/ztypes_linux_s390x.go
@@ -449,12 +449,12 @@ type RtAttr struct {
}
type IfInfomsg struct {
- Family uint8
- _ uint8
- Type uint16
- Index int32
- Flags uint32
- Change uint32
+ Family uint8
+ X__ifi_pad uint8
+ Type uint16
+ Index int32
+ Flags uint32
+ Change uint32
}
type IfAddrmsg struct {
--
2.26.2

View File

@ -1,38 +1,20 @@
From 5ccf9f47bf4f5ba53e0ab7338a7fd4626714cfb2 Mon Sep 17 00:00:00 2001
From: Jeffery To <jeffery.to@gmail.com>
Date: Tue, 23 Nov 2021 15:05:37 +0800
Subject: [PATCH] cmd/link: use gold on ARM/ARM64 only if gold is available
From 7506da0af38aa307f45664f0c787b5767cc7a87f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20S=C3=A1ez?= <asm@redhat.com>
Date: Thu, 22 Jun 2023 17:19:00 +0200
Subject: [PATCH] Force gold in aarch64 until binutils 2.41 is on Fedora
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(-)
src/cmd/link/internal/ld/lib.go | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go
index 9e13db7b71..2b379259a2 100644
index 91e2d5149c..99c305530b 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() {
}
@@ -1605,15 +1605,13 @@ func (ctxt *Link) hostlink() {
// https://go.dev/issue/22040
altLinker = "gold"
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.
@ -42,12 +24,12 @@ index 9e13db7b71..2b379259a2 100644
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)
- log.Fatalf("ARM64 external linker must be gold (issue #15696, 22040), but is not: %s", out)
+ if bytes.Contains(out, []byte("GNU gold")) {
+ altLinker = "gold"
}
}
}
--
2.32.0
2.40.1

View File

@ -19,5 +19,4 @@ provides=""
for bundle in $(find -name modules.txt); do
provides="$provides\n$(cat "$bundle" | grep "^# " | grep -v "# explicit" | sed -r s/"^#.* => "// | sed -r "s/# //" | sed -r "s:(.*) v(.*):Provides\: bundled(golang(\1)) = \2:")"
done
#TODO replace - with . in version per packaging guidelines
echo -e "$provides" | sort -u
echo -e "$provides" | sed 's/-/./g' | sort -u

View File

@ -73,12 +73,8 @@
%global fail_on_tests 1
%endif
# Build golang shared objects for stdlib
%ifarch %{ix86} x86_64 ppc64le %{arm} aarch64
%global shared 1
%else
# shared mode is breaks Go 1.21 in ELN
%global shared 0
%endif
# Fedora GOROOT
%global goroot /usr/lib/%{name}
@ -105,17 +101,17 @@
%global gohostarch s390x
%endif
%global go_api 1.20
%global go_api 1.21
# Use only for prerelease versions
#global go_prerelease rc3
%global go_patch 6
%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}
# Go FIPS package release
%global pkg_release 1
# For rpmdev-bumpspec and releng automation.
%global baserelease 3
%global baserelease 1
Name: golang
Version: %{go_version}
@ -172,26 +168,24 @@ Provides: go = %{version}-%{release}
%if 0%{?fedora}
# 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.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.4.1.0.20230214201333.88ed8ca3307d
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/arch)) = 0.4.0
Provides: bundled(golang(golang.org/x/crypto)) = 0.11.1.0.20230711161743.2e82bdd1719d
Provides: bundled(golang(golang.org/x/mod)) = 0.12.0
Provides: bundled(golang(golang.org/x/net)) = 0.12.1.0.20230712162946.57553cbff163
Provides: bundled(golang(golang.org/x/sync)) = 0.3.0
Provides: bundled(golang(golang.org/x/sys)) = 0.10.0
Provides: bundled(golang(golang.org/x/term)) = 0.10.0
Provides: bundled(golang(golang.org/x/text)) = 0.11.0
Provides: bundled(golang(golang.org/x/tools)) = 0.11.1.0.20230712164437.1ca21856af7b
%endif
Requires: %{name}-bin = %{version}-%{release}
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
Patch1: 0001-Modify-go.env.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

View File

@ -1,2 +1,2 @@
SHA512 (go1.20.6.src.tar.gz) = 509ade7c2a76bd46b26dda4522692ceef5023aae21461b866006341f98544e7ea755aee230a9fea789ed7afb1c49a693c34c8337892e308dfb051aef2b08c975
SHA512 (go1.20.6-1-openssl-fips.tar.gz) = 7e1f9a61b8d419233b41d4592e8741a9d3039120c1fb444cfd7ac229d65a8031ecf1644e1161bc6cf5739ac7ec84e6405eb101f63b5a972ecb6b2ea69cea39e2
SHA512 (go1.21.3.src.tar.gz) = c98d31b9c477c0ac4b6f6933adefb40fdce5cdbb171e5236e3b694fec9e5b04695487af734259eab304dd42e86341240621a781f54b60c719627fd7b5efe4742
SHA512 (go1.21.3-1-openssl-fips.tar.gz) = 869cd8d20ecd2c81ca4ae184fd1f73c124ee479334a002bda2135cb60ce919b0185f203f9d78f08c9616b32339f588aec6f9bc609d458e29dedcdab13dc985d3