From 841d33d1e7b28784d046989ab0e773d620717367 Mon Sep 17 00:00:00 2001 From: brandonlester Date: Wed, 18 Sep 2024 20:43:06 -0700 Subject: [PATCH] add new golang package patches --- golang/0001-Modify-go.env.patch | 30 ++++++++++++++++ ...d-on-ARM-ARM64-only-if-gold-is-avail.patch | 35 +++++++++++++++++++ .../0005-Skip-TestCrashDumpsAllThreads.patch | 28 +++++++++++++++ 3 files changed, 93 insertions(+) create mode 100644 golang/0001-Modify-go.env.patch create mode 100644 golang/0004-cmd-link-use-gold-on-ARM-ARM64-only-if-gold-is-avail.patch create mode 100644 golang/0005-Skip-TestCrashDumpsAllThreads.patch diff --git a/golang/0001-Modify-go.env.patch b/golang/0001-Modify-go.env.patch new file mode 100644 index 000000000..d0b18c78d --- /dev/null +++ b/golang/0001-Modify-go.env.patch @@ -0,0 +1,30 @@ +From 52d9cfec8124a9c7382bed5284246d9b18a21eb4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Alejandro=20S=C3=A1ez?= +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 + diff --git a/golang/0004-cmd-link-use-gold-on-ARM-ARM64-only-if-gold-is-avail.patch b/golang/0004-cmd-link-use-gold-on-ARM-ARM64-only-if-gold-is-avail.patch new file mode 100644 index 000000000..5341d6d6a --- /dev/null +++ b/golang/0004-cmd-link-use-gold-on-ARM-ARM64-only-if-gold-is-avail.patch @@ -0,0 +1,35 @@ +From 7506da0af38aa307f45664f0c787b5767cc7a87f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Alejandro=20S=C3=A1ez?= +Date: Thu, 22 Jun 2023 17:19:00 +0200 +Subject: [PATCH] Force gold in aarch64 until binutils 2.41 is on Fedora + +--- + 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 91e2d5149c..99c305530b 100644 +--- a/src/cmd/link/internal/ld/lib.go ++++ b/src/cmd/link/internal/ld/lib.go +@@ -1605,15 +1605,13 @@ func (ctxt *Link) hostlink() { + // https://go.dev/issue/22040 + 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("ARM64 external linker must be gold (issue #15696, 22040), but is not: %s", out) ++ if bytes.Contains(out, []byte("GNU gold")) { ++ altLinker = "gold" + } + } + } +-- +2.40.1 + diff --git a/golang/0005-Skip-TestCrashDumpsAllThreads.patch b/golang/0005-Skip-TestCrashDumpsAllThreads.patch new file mode 100644 index 000000000..34a84b319 --- /dev/null +++ b/golang/0005-Skip-TestCrashDumpsAllThreads.patch @@ -0,0 +1,28 @@ +From c0c22e2aa7d1901c97da04f834ce9c7b9e38be80 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Alejandro=20S=C3=A1ez?= +Date: Sun, 11 Feb 2024 12:08:35 +0100 +Subject: [PATCH] Skip TestCrashDumpsAllThreads + +See golang.org/issues/64650 +--- + 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.43.0 +