diff --git a/0001-cmd-go-disable-Google-s-proxy-and-sumdb.patch b/0001-cmd-go-use-aliyun-proxy-and-disable-sumdb.patch similarity index 92% rename from 0001-cmd-go-disable-Google-s-proxy-and-sumdb.patch rename to 0001-cmd-go-use-aliyun-proxy-and-disable-sumdb.patch index fba971319a072e18f6dc93880a7554b4c3a01ebb..acdcdf1ec914be7f8256545c14f56b92b4848b35 100644 --- a/0001-cmd-go-disable-Google-s-proxy-and-sumdb.patch +++ b/0001-cmd-go-use-aliyun-proxy-and-disable-sumdb.patch @@ -18,7 +18,7 @@ index 57a3c1ff6f..e56c60e591 100644 - GOPROXY = envOr("GOPROXY", "https://proxy.golang.org,direct") - GOSUMDB = envOr("GOSUMDB", "sum.golang.org") -+ GOPROXY = envOr("GOPROXY", "direct") ++ GOPROXY = envOr("GOPROXY", "https://mirrors.aliyun.com/goproxy/,direct") + GOSUMDB = envOr("GOSUMDB", "off") GOPRIVATE = Getenv("GOPRIVATE") GONOPROXY = envOr("GONOPROXY", GOPRIVATE) @@ -32,7 +32,7 @@ index becd88b52e..b2a1250372 100644 env GOSUMDB= go env GOPROXY -stdout '^https://proxy.golang.org,direct$' -+stdout '^direct$' ++stdout '^https://mirrors.aliyun.com/goproxy/,direct$' go env GOSUMDB -stdout '^sum.golang.org$' +stdout '^off$' 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 0000000000000000000000000000000000000000..d0a714976dc42f63c3f301321883dfc6444213f4 --- /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/bundled-deps.sh b/bundled-deps.sh new file mode 100755 index 0000000000000000000000000000000000000000..bdcbd306f3a952559b028da8e75844504d6c0c96 --- /dev/null +++ b/bundled-deps.sh @@ -0,0 +1,23 @@ +#! /bin/bash +# Copyright (C) 2021 Jakub Čajka jcajka@redhat.com +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +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 diff --git a/go1.19.4.src.tar.gz b/go1.20.3.src.tar.gz similarity index 71% rename from go1.19.4.src.tar.gz rename to go1.20.3.src.tar.gz index 2a2e59ad1bfbb74899a287646577eabc395ad68f..521521608995cad9586634ad076252261915dbf2 100644 Binary files a/go1.19.4.src.tar.gz and b/go1.20.3.src.tar.gz differ diff --git a/golang.spec b/golang.spec index 7f85c41f34c843537c290f7a21c3529f12b10a12..1d4a80a51b238d9585e617eb30ed97bde9c284d7 100644 --- a/golang.spec +++ b/golang.spec @@ -54,11 +54,8 @@ %global shared 1 # Pre build std lib with -race enabled -%ifarch x86_64 -%global race 1 -%else +# Disabled due to 1.20 new cache usage, see 1.20 upstream release notes %global race 0 -%endif %global goroot /usr/lib/%{name} @@ -68,10 +65,13 @@ %ifarch aarch64 %global gohostarch arm64 %endif +%ifarch loongarch64 +%global gohostarch loong64 +%endif # Comment out go_patch as needed -%global go_api 1.19 -%global go_patch 4 +%global go_api 1.20 +%global go_patch 3 %global go_version %{go_api}%{?go_patch:.%{go_patch}} %global go_source %{go_api}%{?go_patch:.%{go_patch}} @@ -100,22 +100,23 @@ Provides: go = %{version}-%{release} # Bundled/Vendored provides can be found in `find . -name modules.txt` on the in tree module data # - in version filed substituted with . per versioning guidelines -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.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 -Provides: bundled(golang(golang.org/x/text)) = 0.3.8.0.20220509174342.b4bca84b0361 -Provides: bundled(golang(golang.org/x/tools)) = 0.1.11.0.20220516163903.1e55371df567 +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 Requires: %{name}-bin = %{version}-%{release} Requires: %{name}-src = %{version}-%{release} -Patch3: 0001-cmd-go-disable-Google-s-proxy-and-sumdb.patch +Patch3: 0001-cmd-go-use-aliyun-proxy-and-disable-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 @@ -426,8 +427,6 @@ export GO_TEST_TIMEOUT_SCALE=2 %endif cd .. -%generate_compatibility_deps - %post bin %{_sbindir}/update-alternatives --install %{_bindir}/go \ go %{goroot}/bin/go 90 \ @@ -479,7 +478,6 @@ fi %if %{shared} %files shared -f go-shared.list -%{abidir}/libstd.dump %endif %if %{race} @@ -487,6 +485,11 @@ fi %endif %changelog +* Thu Apr 06 2023 Funda Wang - 1.20.3-1 +- New version 1.20.3 +- Disable race package due go 1.20 new feature +- Drop abi generation, it produces unexpanded provides for this package + * Tue Jan 3 2023 Kun(llfl) - 1.19.4-1 - update version to 1.19.4