diff --git a/0006-Default-to-ld.bfd-on-ARM64.patch b/0006-Default-to-ld.bfd-on-ARM64.patch new file mode 100644 index 0000000000000000000000000000000000000000..369b4e6c04d826e0f6a6721d90aa4c786a3ec7fa --- /dev/null +++ b/0006-Default-to-ld.bfd-on-ARM64.patch @@ -0,0 +1,46 @@ +From 46ec67413008607e2150e3395668e54e538c5b6b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Alejandro=20S=C3=A1ez?= +Date: Wed, 19 Jun 2024 10:18:58 +0200 +Subject: [PATCH] Default to ld.bfd on ARM64 + +--- + src/cmd/link/internal/ld/lib.go | 20 +++++++------------- + 1 file changed, 7 insertions(+), 13 deletions(-) + +diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go +index eab74dc328..b401f58727 100644 +--- a/src/cmd/link/internal/ld/lib.go ++++ b/src/cmd/link/internal/ld/lib.go +@@ -1620,22 +1620,16 @@ func (ctxt *Link) hostlink() { + } + + if ctxt.Arch.InFamily(sys.ARM64) && buildcfg.GOOS == "linux" { +- // On ARM64, the GNU linker will fail with +- // -znocopyreloc if it thinks a COPY relocation is +- // required. Switch to gold. +- // https://sourceware.org/bugzilla/show_bug.cgi?id=19962 +- // 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. ++ // Use ld.bfd as the default linker ++ altLinker = "bfd" ++ ++ // Provide a useful error if ld.bfd is missing + name, args := flagExtld[0], flagExtld[1:] +- args = append(args, "-fuse-ld=gold", "-Wl,--version") ++ args = append(args, "-fuse-ld=bfd", "-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 ld")) { ++ log.Fatalf("ARM64 external linker must be ld.bfd, but is not: %s", out) + } + } + } +-- +2.45.1 + diff --git a/compiler-rt-18.1.8.src.tar.xz b/compiler-rt-18.1.8.src.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..7d53f90cb842624f80060650312ecac506c1c23a Binary files /dev/null and b/compiler-rt-18.1.8.src.tar.xz differ diff --git a/fedora.go b/fedora.go new file mode 100644 index 0000000000000000000000000000000000000000..60e460dbea9f902da242bca0fcfea9fa4ea918ba --- /dev/null +++ b/fedora.go @@ -0,0 +1,12 @@ +//go:build rpm_crashtraceback +// +build rpm_crashtraceback + + +// Copyright 2017 The Fedora Project Contributors. All rights reserved. +// Use of this source code is governed by the MIT license. + +package runtime + +func init() { + setTraceback("crash") +} diff --git a/go1.25.0-1-openssl-fips.tar.gz b/go1.25.0-1-openssl-fips.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..2f7786d926ef32dce21f37ba572f14ddf5a19935 Binary files /dev/null and b/go1.25.0-1-openssl-fips.tar.gz differ diff --git a/go1.25.0.src.tar.gz b/go1.25.0.src.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..8927ad6581b7afdb62c52f7d3c8c788a4737ca26 Binary files /dev/null and b/go1.25.0.src.tar.gz differ diff --git a/golang-prelink.conf b/golang-prelink.conf new file mode 100644 index 0000000000000000000000000000000000000000..471e8e64ab503f0a6fc3070f2d4ddcc914030f6e --- /dev/null +++ b/golang-prelink.conf @@ -0,0 +1,3 @@ +# there are ELF files in src which are testdata and shouldn't be modified +-b /usr/lib/golang/src +-b /usr/lib64/golang/src diff --git a/golang.spec b/golang.spec index 861a9f4a2edb3234bbdfdaaee5ec3cb2b25292b9..2de087bf9df5a558a4b121511ab9b8d38fddd88c 100644 --- a/golang.spec +++ b/golang.spec @@ -1,4 +1,4 @@ -%define anolis_release 8 +%define anolis_release 1 # Disable debuginfo packages %global debug_package %{nil} @@ -79,9 +79,13 @@ Release: %{anolis_release}%{?dist} Summary: The Go Programming Language License: BSD and Public Domain URL: https://go.dev -Source0: https://go.dev/dl/go%{go_api}%{?go_patch:.%{go_patch}}.src.tar.gz +Source0: https://go.dev/dl/go1.25.0.src.tar.gz +Source1: https://github.com/golang-fips/go/archive/refs/tags/go1.25.0-1-openssl-fips.tar.gz +Source2: fedora.go +Source3: https://github.com/llvm/llvm-project/releases/download/llvmorg-18.1.8/compiler-rt-18.1.8.src.tar.xz +Source100: golang-gdbinit +Source101: golang-prelink.conf # make possible to override default traceback level at build time by setting build tag rpm_crashtraceback -Source1: anolis.go Patch1: 0001-cmd-link-internal-add-support-for-internal-linking-o.patch Patch2: 0002-cmd-dist-internal-platform-enable-internal-linking-f.patch @@ -149,6 +153,8 @@ Patch1013: 0013-crypto-hash-math-Add-sw64-port.patch Patch1014: 0014-api-Add-sw64-port.patch Patch1015: 0015-debug-Add-sw64-port.patch Patch1016: 0016-encoding-os-sw64-add-var-NativeEndian.patch +Patch1017: revert_dwarf5.patch +Patch1018: 0006-Default-to-ld.bfd-on-ARM64.patch # The compiler is written in Go. Needs go(1.4+) compiler for build. %if %{with bootstrap} @@ -162,6 +168,9 @@ BuildRequires: pcre-devel BuildRequires: glibc-static BuildRequires: perl-interpreter BuildRequires: procps-ng +BuildRequires: clang +BuildRequires: libstdc++-devel +BuildRequires: net-tools Provides: go = %{version}-%{release} @@ -182,10 +191,8 @@ Provides: bundled(golang(golang.org/x/tools)) = 0.3.1.0.20230118190848.070db2996 Requires: %{name}-bin = %{version}-%{release} Requires: %{name}-src = %{version}-%{release} -Source100: golang-gdbinit ## git binary diffs are not supported. (Patch1051) -Source102: race_linux_loong64.syso %description The Go programming language is an open source project to make programmers more productive. @@ -624,6 +631,10 @@ fi %files docs -f go-docs.list %changelog +* Tue Sep 16 2025 zhoujiajia111 - 1.25.0-1 +- Updated to version 1.25.0 to fix CVE-2025-3010 + + * Thu Aug 15 2025 Yang Cheng - 1.24.0-8 - fix sw_64 build error diff --git a/revert_dwarf5.patch b/revert_dwarf5.patch new file mode 100644 index 0000000000000000000000000000000000000000..80a58bbdd04fe00297be2a75cf48f03c9e2e0171 --- /dev/null +++ b/revert_dwarf5.patch @@ -0,0 +1,42 @@ +From e90ae9076a108b83c645814f75a574c14a5a4b98 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Alejandro=20S=C3=A1ez?= +Date: Wed, 27 Aug 2025 16:18:09 +0200 +Subject: [PATCH] Revert DWARF5 as default, use DWARF4 + +--- + src/internal/buildcfg/exp.go | 13 +------------ + 1 file changed, 1 insertion(+), 12 deletions(-) + +diff --git a/src/internal/buildcfg/exp.go b/src/internal/buildcfg/exp.go +index 689ca8ce58..b2ea97481b 100644 +--- a/src/internal/buildcfg/exp.go ++++ b/src/internal/buildcfg/exp.go +@@ -67,24 +67,13 @@ func ParseGOEXPERIMENT(goos, goarch, goexp string) (*ExperimentFlags, error) { + regabiSupported = true + } + +- // Older versions (anything before V16) of dsymutil don't handle +- // the .debug_rnglists section in DWARF5. See +- // https://github.com/golang/go/issues/26379#issuecomment-2677068742 +- // for more context. This disables all DWARF5 on mac, which is not +- // ideal (would be better to disable just for cases where we know +- // the build will use external linking). In the GOOS=aix case, the +- // XCOFF format (as far as can be determined) doesn't seem to +- // support the necessary section subtypes for DWARF-specific +- // things like .debug_addr (needed for DWARF 5). +- dwarf5Supported := (goos != "darwin" && goos != "ios" && goos != "aix") +- + baseline := goexperiment.Flags{ + RegabiWrappers: regabiSupported, + RegabiArgs: regabiSupported, + AliasTypeParams: true, + SwissMap: true, + SyncHashTrieMap: true, +- Dwarf5: dwarf5Supported, ++ Dwarf5: false, + } + + // Start with the statically enabled set of experiments. +-- +2.51.0 +