diff --git a/.gitignore b/.gitignore index ca2c17d..820acc9 100644 --- a/.gitignore +++ b/.gitignore @@ -66,3 +66,6 @@ /go1.21.4-1-openssl-fips.tar.gz /go1.21.7.tar.gz /go1.21.7-1-openssl-fips.tar.gz +/go1.22.1.tar.gz +/go1.22.1-1-openssl-fips.tar.gz +/go1.22.1-2-openssl-fips.tar.gz diff --git a/disable_static_tests_part1.patch b/disable_static_tests_part1.patch deleted file mode 100644 index 5b99e48..0000000 --- a/disable_static_tests_part1.patch +++ /dev/null @@ -1,288 +0,0 @@ -diff --git a/src/crypto/internal/backend/nobackend.go b/src/crypto/internal/backend/nobackend.go -index 5f258a2..5dbbc42 100644 ---- a/src/crypto/internal/backend/nobackend.go -+++ b/src/crypto/internal/backend/nobackend.go -@@ -2,8 +2,8 @@ - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. - --//go:build !linux || !cgo || android || cmd_go_bootstrap || msan || no_openssl --// +build !linux !cgo android cmd_go_bootstrap msan no_openssl -+//go:build !linux || !cgo || android || cmd_go_bootstrap || msan || no_openssl || static -+// +build !linux !cgo android cmd_go_bootstrap msan no_openssl static - - package backend - -diff --git a/src/crypto/internal/boring/goboringcrypto.h b/src/crypto/internal/boring/goboringcrypto.h -index d6d99b1..f2fe332 100644 ---- a/src/crypto/internal/boring/goboringcrypto.h -+++ b/src/crypto/internal/boring/goboringcrypto.h -@@ -1,4 +1,5 @@ - // Copyright 2017 The Go Authors. All rights reserved. -+// +build !static - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. - -diff --git a/src/crypto/internal/boring/syso/syso.go b/src/crypto/internal/boring/syso/syso.go -index b338754..db5ea1e 100644 ---- a/src/crypto/internal/boring/syso/syso.go -+++ b/src/crypto/internal/boring/syso/syso.go -@@ -2,7 +2,7 @@ - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. - --//go:build boringcrypto -+//go:build boringcrypto && !static - - // This package only exists with GOEXPERIMENT=boringcrypto. - // It provides the actual syso file. -diff --git a/src/vendor/github.com/golang-fips/openssl-fips/openssl/aes.go b/src/vendor/github.com/golang-fips/openssl-fips/openssl/aes.go -index 079fc3c..e826d0b 100644 ---- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/aes.go -+++ b/src/vendor/github.com/golang-fips/openssl-fips/openssl/aes.go -@@ -2,8 +2,8 @@ - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. - --//go:build linux && !android && !cmd_go_bootstrap && !msan && !no_openssl --// +build linux,!android,!cmd_go_bootstrap,!msan,!no_openssl -+//go:build linux && !android && !cmd_go_bootstrap && !msan && !no_openssl && !static -+// +build linux,!android,!cmd_go_bootstrap,!msan,!no_openssl,!static - - package openssl - -diff --git a/src/vendor/github.com/golang-fips/openssl-fips/openssl/ecdh.go b/src/vendor/github.com/golang-fips/openssl-fips/openssl/ecdh.go -index 0b61e79..94d0c98 100644 ---- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/ecdh.go -+++ b/src/vendor/github.com/golang-fips/openssl-fips/openssl/ecdh.go -@@ -2,8 +2,8 @@ - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. - --//go:build linux && !android && !cmd_go_bootstrap && !msan && !no_openssl --// +build linux,!android,!cmd_go_bootstrap,!msan,!no_openssl -+//go:build linux && !android && !cmd_go_bootstrap && !msan && !no_openssl && !static -+// +build linux,!android,!cmd_go_bootstrap,!msan,!no_openssl,!static - - package openssl - -diff --git a/src/vendor/github.com/golang-fips/openssl-fips/openssl/ecdsa.go b/src/vendor/github.com/golang-fips/openssl-fips/openssl/ecdsa.go -index afec529..d822152 100644 ---- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/ecdsa.go -+++ b/src/vendor/github.com/golang-fips/openssl-fips/openssl/ecdsa.go -@@ -2,8 +2,8 @@ - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. - --//go:build linux && !android && !cmd_go_bootstrap && !msan && !no_openssl --// +build linux,!android,!cmd_go_bootstrap,!msan,!no_openssl -+//go:build linux && !android && !cmd_go_bootstrap && !msan && !no_openssl && !static -+// +build linux,!android,!cmd_go_bootstrap,!msan,!no_openssl,!static - - package openssl - -diff --git a/src/vendor/github.com/golang-fips/openssl-fips/openssl/goopenssl.h b/src/vendor/github.com/golang-fips/openssl-fips/openssl/goopenssl.h -index 6d6a562..17cc314 100644 ---- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/goopenssl.h -+++ b/src/vendor/github.com/golang-fips/openssl-fips/openssl/goopenssl.h -@@ -1,4 +1,5 @@ - // Copyright 2017 The Go Authors. All rights reserved. -+// +build !static - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. - // +build linux -diff --git a/src/vendor/github.com/golang-fips/openssl-fips/openssl/hkdf.go b/src/vendor/github.com/golang-fips/openssl-fips/openssl/hkdf.go -index ae40b93..17bc075 100644 ---- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/hkdf.go -+++ b/src/vendor/github.com/golang-fips/openssl-fips/openssl/hkdf.go -@@ -2,8 +2,8 @@ - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. - --//go:build linux && !android && !cmd_go_bootstrap && !msan && !no_openssl --// +build linux,!android,!cmd_go_bootstrap,!msan,!no_openssl -+//go:build linux && !android && !cmd_go_bootstrap && !msan && !no_openssl && !static -+// +build linux,!android,!cmd_go_bootstrap,!msan,!no_openssl,!static - - package openssl - -diff --git a/src/vendor/github.com/golang-fips/openssl-fips/openssl/hmac.go b/src/vendor/github.com/golang-fips/openssl-fips/openssl/hmac.go -index 6f00177..f466b18 100644 ---- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/hmac.go -+++ b/src/vendor/github.com/golang-fips/openssl-fips/openssl/hmac.go -@@ -2,8 +2,8 @@ - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. - --//go:build linux && !android && !cmd_go_bootstrap && !msan && !no_openssl --// +build linux,!android,!cmd_go_bootstrap,!msan,!no_openssl -+//go:build linux && !android && !cmd_go_bootstrap && !msan && !no_openssl && !static -+// +build linux,!android,!cmd_go_bootstrap,!msan,!no_openssl,!static - - package openssl - -diff --git a/src/vendor/github.com/golang-fips/openssl-fips/openssl/notboring.go b/src/vendor/github.com/golang-fips/openssl-fips/openssl/notboring.go -index 7c0b5d6..262af07 100644 ---- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/notboring.go -+++ b/src/vendor/github.com/golang-fips/openssl-fips/openssl/notboring.go -@@ -2,8 +2,8 @@ - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. - --//go:build !linux || !cgo || android || cmd_go_bootstrap || msan || no_openssl --// +build !linux !cgo android cmd_go_bootstrap msan no_openssl -+//go:build !linux || !cgo || android || cmd_go_bootstrap || msan || no_openssl || static -+// +build !linux !cgo android cmd_go_bootstrap msan no_openssl static - - package openssl - -diff --git a/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl.go b/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl.go -index d49194d..ff15054 100644 ---- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl.go -+++ b/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl.go -@@ -2,8 +2,8 @@ - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. - --//go:build linux && !android && !cmd_go_bootstrap && !msan && !no_openssl --// +build linux,!android,!cmd_go_bootstrap,!msan,!no_openssl -+//go:build linux && !android && !cmd_go_bootstrap && !msan && !no_openssl && !static -+// +build linux,!android,!cmd_go_bootstrap,!msan,!no_openssl,!static - - package openssl - -diff --git a/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_ecdsa_signature.c b/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_ecdsa_signature.c -index 2349db1..57fbb04 100644 ---- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_ecdsa_signature.c -+++ b/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_ecdsa_signature.c -@@ -1,4 +1,5 @@ - // +build linux -+// +build !static - // +build !android - // +build !no_openssl - // +build !cmd_go_bootstrap -diff --git a/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_evp.c b/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_evp.c -index 4379019..5034c46 100644 ---- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_evp.c -+++ b/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_evp.c -@@ -1,4 +1,5 @@ - // +build linux -+// +build !static - // +build !android - // +build !no_openssl - // +build !cmd_go_bootstrap -diff --git a/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_lock_setup.c b/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_lock_setup.c -index 49d40a7..3b3dbf8 100644 ---- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_lock_setup.c -+++ b/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_lock_setup.c -@@ -1,4 +1,5 @@ - // +build linux -+// +build !static - // +build !android - // +build !no_openssl - // +build !cmd_go_bootstrap -diff --git a/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_port_aead_gcm.c b/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_port_aead_gcm.c -index 7eb645e..1c3225a 100644 ---- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_port_aead_gcm.c -+++ b/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_port_aead_gcm.c -@@ -1,4 +1,5 @@ - // This file contains a port of the BoringSSL AEAD interface. -+// +build !static - // +build linux - // +build !android - // +build !no_openssl -diff --git a/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_port_ctr128.c b/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_port_ctr128.c -index df4ebe3..876393b 100644 ---- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_port_ctr128.c -+++ b/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_port_ctr128.c -@@ -1,4 +1,5 @@ - // +build linux -+// +build !static - // +build !android - // +build !no_openssl - // +build !cmd_go_bootstrap -diff --git a/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_port_evp_md5_sha1.c b/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_port_evp_md5_sha1.c -index 2eedd5b..04510d3 100644 ---- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_port_evp_md5_sha1.c -+++ b/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_port_evp_md5_sha1.c -@@ -1,4 +1,5 @@ - // This file contains a backport of the EVP_md5_sha1 method. -+// +build !static - // +build linux - // +build !android - // +build !no_openssl -diff --git a/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_port_hmac.c b/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_port_hmac.c -index 362d9e5..bebafef 100644 ---- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_port_hmac.c -+++ b/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_port_hmac.c -@@ -1,4 +1,5 @@ - // This file contains HMAC portability wrappers. -+// +build !static - // +build linux - // +build !android - // +build !no_openssl -diff --git a/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_port_rsa.c b/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_port_rsa.c -index 2824147..8bc1d85 100644 ---- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_port_rsa.c -+++ b/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_port_rsa.c -@@ -1,4 +1,5 @@ - // This file contains RSA portability wrappers. -+// +build !static - // +build linux - // +build !android - // +build !no_openssl -diff --git a/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_stub_rand.c b/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_stub_rand.c -index 22bd865..b7aa26b 100644 ---- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_stub_rand.c -+++ b/src/vendor/github.com/golang-fips/openssl-fips/openssl/openssl_stub_rand.c -@@ -1,4 +1,5 @@ - // +build linux -+// +build !static - // +build !android - // +build !no_openssl - // +build !cmd_go_bootstrap -diff --git a/src/vendor/github.com/golang-fips/openssl-fips/openssl/rand.go b/src/vendor/github.com/golang-fips/openssl-fips/openssl/rand.go -index b3668b8..dcdae70 100644 ---- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/rand.go -+++ b/src/vendor/github.com/golang-fips/openssl-fips/openssl/rand.go -@@ -2,8 +2,8 @@ - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. - --//go:build linux && !android && !cmd_go_bootstrap && !msan && !no_openssl --// +build linux,!android,!cmd_go_bootstrap,!msan,!no_openssl -+//go:build linux && !android && !cmd_go_bootstrap && !msan && !no_openssl && !static -+// +build linux,!android,!cmd_go_bootstrap,!msan,!no_openssl,!static - - package openssl - -diff --git a/src/vendor/github.com/golang-fips/openssl-fips/openssl/rsa.go b/src/vendor/github.com/golang-fips/openssl-fips/openssl/rsa.go -index 915c840..8623d9d 100644 ---- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/rsa.go -+++ b/src/vendor/github.com/golang-fips/openssl-fips/openssl/rsa.go -@@ -2,8 +2,8 @@ - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. - --//go:build linux && !android && !cmd_go_bootstrap && !msan && !no_openssl --// +build linux,!android,!cmd_go_bootstrap,!msan,!no_openssl -+//go:build linux && !android && !cmd_go_bootstrap && !msan && !no_openssl && !static -+// +build linux,!android,!cmd_go_bootstrap,!msan,!no_openssl,!static - - package openssl - -diff --git a/src/vendor/github.com/golang-fips/openssl-fips/openssl/sha.go b/src/vendor/github.com/golang-fips/openssl-fips/openssl/sha.go -index 0b55ced..57309c0 100644 ---- a/src/vendor/github.com/golang-fips/openssl-fips/openssl/sha.go -+++ b/src/vendor/github.com/golang-fips/openssl-fips/openssl/sha.go -@@ -2,8 +2,8 @@ - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. - --//go:build linux && !android && !cmd_go_bootstrap && !msan && !no_openssl --// +build linux,!android,!cmd_go_bootstrap,!msan,!no_openssl -+//go:build linux && !android && !cmd_go_bootstrap && !msan && !no_openssl && !static -+// +build linux,!android,!cmd_go_bootstrap,!msan,!no_openssl,!static - - package openssl - diff --git a/disable_static_tests_part2.patch b/disable_static_tests_part2.patch deleted file mode 100644 index 494de22..0000000 --- a/disable_static_tests_part2.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go -index 36a20e8b2a..8c2dd1b44b 100644 ---- a/src/cmd/dist/test.go -+++ b/src/cmd/dist/test.go -@@ -1125,7 +1125,7 @@ func (t *tester) registerCgoTests(heading string) { - } else { - panic("unknown linkmode with static build: " + linkmode) - } -- gt.tags = append(gt.tags, "static") -+ gt.tags = append(gt.tags, "static", "no_openssl") - } - gt.ldflags = strings.Join(ldflags, " ") - diff --git a/golang.spec b/golang.spec index c91325e..9090bdb 100644 --- a/golang.spec +++ b/golang.spec @@ -92,10 +92,10 @@ %global gohostarch s390x %endif -%global go_api 1.21 -%global go_version 1.21.7 +%global go_api 1.22 +%global go_version 1.22.1 %global version %{go_version} -%global pkg_release 1 +%global pkg_release 2 Name: golang Version: %{version} @@ -143,11 +143,9 @@ Patch221: fix_TestScript_list_std.patch Patch1939923: skip_test_rhbz1939923.patch -# Disables libc static linking tests which -# are incompatible with dlopen in golang-fips -Patch2: disable_static_tests_part1.patch -Patch3: disable_static_tests_part2.patch Patch4: modify_go.env.patch +Patch5: re-enable-cgo.patch +Patch6: skip_TestCrashDumpsAllThreads.patch # Having documentation separate was broken Obsoletes: %{name}-docs < 1.1-4 @@ -254,9 +252,11 @@ This is the main package for go-toolset. pushd .. tar -xf %{SOURCE1} popd -patch -p1 < ../go-go%{version}-%{pkg_release}-openssl-fips/patches/000-initial-setup.patch -patch -p1 < ../go-go%{version}-%{pkg_release}-openssl-fips/patches/001-initial-openssl-for-fips.patch -patch -p1 < ../go-go%{version}-%{pkg_release}-openssl-fips/patches/002-strict-fips-runtime-detection.patch +patch_dir="../go-go%{version}-%{pkg_release}-openssl-fips/patches" +for p in "$patch_dir"/*.patch; do + echo "Applying $p" + patch -p1 < $p +done # Configure crypto tests pushd ../go-go%{version}-%{pkg_release}-openssl-fips @@ -529,6 +529,12 @@ cd .. %files -n go-toolset %changelog +* Tue Mar 19 2024 Alejandro Sáez - 1.22.1-1 +- Rebase to Go 1.22.1 +- Re-enable CGO +- Resolves: RHEL-29527 +- Resolves: RHEL-28175 + * Fri Feb 09 2024 Alejandro Sáez - 1.21.7-1 - Rebase to Go 1.21.7 - Set GOTOOLCHAIN to local diff --git a/re-enable-cgo.patch b/re-enable-cgo.patch new file mode 100644 index 0000000..062a295 --- /dev/null +++ b/re-enable-cgo.patch @@ -0,0 +1,30 @@ +From 09ff18f22def1766faa746df87e57d5b68454246 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Alejandro=20S=C3=A1ez?= +Date: Tue, 5 Mar 2024 10:03:13 +0100 +Subject: [PATCH] Re-enable CGO in cmd/go and cmd/pprof + +--- + src/cmd/dist/build.go | 7 ------- + 1 file changed, 7 deletions(-) + +diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go +index 32e59b446a..941abdcebd 100644 +--- a/src/cmd/dist/build.go ++++ b/src/cmd/dist/build.go +@@ -1304,13 +1304,6 @@ func timelog(op, name string) { + // to switch between the host and target configurations when cross-compiling. + func toolenv() []string { + var env []string +- if !mustLinkExternal(goos, goarch, false) { +- // Unless the platform requires external linking, +- // we disable cgo to get static binaries for cmd/go and cmd/pprof, +- // so that they work on systems without the same dynamic libraries +- // as the original build system. +- env = append(env, "CGO_ENABLED=0") +- } + if isRelease || os.Getenv("GO_BUILDER_NAME") != "" { + // Add -trimpath for reproducible builds of releases. + // Include builders so that -trimpath is well-tested ahead of releases. +-- +2.43.2 + diff --git a/skip_TestCrashDumpsAllThreads.patch b/skip_TestCrashDumpsAllThreads.patch new file mode 100644 index 0000000..92e7eca --- /dev/null +++ b/skip_TestCrashDumpsAllThreads.patch @@ -0,0 +1,27 @@ +From fdcaf4e6876cfd910c3da672564be4a6e829047c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Alejandro=20S=C3=A1ez?= +Date: Wed, 27 Mar 2024 17:15:48 +0100 +Subject: [PATCH] Skip TestCrashDumpsAllThreads + +--- + src/runtime/crash_unix_test.go | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/runtime/crash_unix_test.go b/src/runtime/crash_unix_test.go +index 123a462423..a0034d6455 100644 +--- a/src/runtime/crash_unix_test.go ++++ b/src/runtime/crash_unix_test.go +@@ -74,6 +74,10 @@ func TestCrashDumpsAllThreads(t *testing.T) { + t.Skip("skipping; SIGQUIT is blocked, see golang.org/issue/19196") + } + ++ if runtime.GOOS == "linux" && runtime.GOARCH == "s390x" { ++ t.Skip("skipping; frequent TestCrashDumpsAllThreads failures on linux/s390x, see golang.org/issue/64650") ++ } ++ + testenv.MustHaveGoBuild(t) + + if strings.Contains(os.Getenv("GOFLAGS"), "mayMoreStackPreempt") { +-- +2.44.0 + diff --git a/sources b/sources index 4571540..1a07f6b 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (go1.21.7.tar.gz) = 367fdc64475b2c7f639fdc74b2934594ae787def78048897159b42275adb11bee7169cda12d87dd62b3fc66e2d6fdf96c6fe6afa39c700c6e398117a7c82bbf2 -SHA512 (go1.21.7-1-openssl-fips.tar.gz) = 6dba839d045a7f820cef25c638b7b4545779af46a855916027d28d3014b06f481271ebebe34ee33d4a9506f376c13cf8ee03e78d8b71764f3c6676f46dc82e11 +SHA512 (go1.22.1.tar.gz) = f7f1dd59bb6b47f9b0dfbe6c1a248c144eb6cd75e6957d859290f8a505cd922e992410fe1740d0cac7873885423776c79c82a232d2e5fa8a2d0edbef70de784e +SHA512 (go1.22.1-2-openssl-fips.tar.gz) = 8a9abca30748f162b3199e35ea1755b0b89cd8d0f2efa680479cfe572a3b75438d7ae5bcea982d29eeefa3964d380fd61d43090902d2c98b31d360e9ecfb2268