summaryrefslogtreecommitdiff
path: root/dev-lang/go
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2025-04-10 08:43:23 +0100
committerV3n3RiX <venerix@koprulu.sector>2025-04-10 08:43:23 +0100
commit3cd09a18bad26aad2645241b868755cfdf41b6ae (patch)
treeb7cf88e82bfe5ff802cf44d7eb7b58001a825067 /dev-lang/go
parentce375651e01b2f8fe2470091862de020c1b4420a (diff)
gentoo auto-resync : 10:04:2025 - 08:43:23
Diffstat (limited to 'dev-lang/go')
-rw-r--r--dev-lang/go/Manifest4
-rw-r--r--dev-lang/go/files/go-1.24-dont-force-gold-arm.patch55
-rw-r--r--dev-lang/go/go-1.24.2-r1.ebuild132
-rw-r--r--dev-lang/go/go-9999.ebuild4
4 files changed, 191 insertions, 4 deletions
diff --git a/dev-lang/go/Manifest b/dev-lang/go/Manifest
index 070e6527c968..4bb09ae03aaa 100644
--- a/dev-lang/go/Manifest
+++ b/dev-lang/go/Manifest
@@ -1,3 +1,4 @@
+AUX go-1.24-dont-force-gold-arm.patch 2151 BLAKE2B 1a2a16464d0fffdd78b195346cb7e8ddd9077c2e2e8472a8ca16de3c3b8468c4662f68398ada29463cc6b83869a8cdcab0f8ef0d0807fecf3f03bcc4becba03e SHA512 75eb534c214e9ba2ed7667d04c8007131b34dbae8b6e3e6ad0b8b7fe9ccee90fdb1c3bafe2f7e2bdd3270dc4a1cf3bcac789b03625f0eead9b51ce471bd294eb
AUX go-1.24-skip-gdb-tests.patch 408 BLAKE2B 062d5ee7bda4e4891a3098e4a9328136b128ac029cf4613d13dcc062a0af03d687f67a4c35bd3b130aad6af8661371b48408df471760eceb76d4e757a60189c2 SHA512 311e45c7fa8f0c32f7c2b3cd017af126a1781fbfddc5d62c5fbd6a2f2b4bc9f9d7492a6ba231bd97806821b1c75b0e096e1e7e526ea9c2d8bbe6108e5a907ca2
AUX go-never-download-newer-toolchains.patch 368 BLAKE2B 0c90f46492af80622f430b2d506b143f3b553b5276085f78f41b93fee8219745179038302462603b5b1677554d92911eb4865084d0488aaa4c71ae1abc307f71 SHA512 b5acf97ccf96c6a353fcb7bd97113c38562defd82338828124fcc72c71334feda9c4e839d2aae5b66b809bc8a692eac96396c54a478e17a7ffd8d2c68fea95e6
AUX go-sets.conf 256 BLAKE2B 670afd72a2fa961e2b3882ac48d10e9d047af7a68f47bc8c8985b2de7a84022410fb1acfe2c710f8b3804ec3b043bf18c948478cf7d31c982cff47714b309cdf SHA512 028fba72c2d82ef893416970c27cb277be15f7c5c67773c0a62cd8ce2c192813ba851339596f10a6f5394c479e67b62dd4e4520379cc03f764ed4a4ab834fba6
@@ -6,6 +7,7 @@ DIST go1.23.8.src.tar.gz 28182772 BLAKE2B 568b9fcc7ed12cb19e10b458fc1890a5977c97
DIST go1.24.2.src.tar.gz 30787666 BLAKE2B bb5f998a87e6527def304347b854c4addb0860a03da82e711f60e2af460bd43c36273b25126c643a679ae22fca226e6a4fc5ba55967d21965ffdc8f564781e35 SHA512 6366a32f6678e7908b138f62dafeed96f7144b3b93505e75fba374b33727da8b1d087c1f979f493382b319758ebfcbeb30e9d7dadcb2923b628c8abe7db41c6f
EBUILD go-1.23.7.ebuild 4219 BLAKE2B 5d42a222a7aab58bba44ba7504c1785260547e0a61adbd7801fef84a69308929d2b90fe941993ef6b6b4df6df7f2e2d2b532e6749e7b32a999f760180f4b72c8 SHA512 f78e742f821b52dcff9d0edd6dd27629b0d691a868b0d35eac4b46025163b6d33174554d730999182ae3721ae45ef97fa18709b05203bb005b7e7ec5711a33d2
EBUILD go-1.23.8.ebuild 4220 BLAKE2B a5bf3912f35bdf251e9168b3ad6a7e90c9017c6f4054f7d1ae6fd13ece2040f448076957d8e10c706d509955c08cd8f91f08143db377435f64bd24dee36af1b6 SHA512 cb33910362e7913ca692c62e63e1ef075ef7762dc9103914a651c3d071aadb8401736874444033046f8c3c586a910a8977a2163de4ea184ab6d49e21abe6dfc4
+EBUILD go-1.24.2-r1.ebuild 3368 BLAKE2B 4124a02284437def9edfe9daea363d64c96d1943713aab0449a290740cdb9f98162c5fd54890e12575fb4bf2200eedb417d369822b381b1810796902e75fec3b SHA512 1a735e35d2d3bada964a1cfe2d0ad40dec00e82c3b665d72b96f3f7a015f9b6bbd09a13f31458f14f4d3354378cc76937ed3c8843076ca32808dc72e59e146d2
EBUILD go-1.24.2.ebuild 3401 BLAKE2B 2ea55f57bad1c6970c494fe110f1d5c57af9db310d3d4071763f91594cae0ae838627d1e691b5ec8f3087c3a790f91e946a8ca299e0d8748fcc10ec7e5c3696e SHA512 7ea5b4533b6a7a46f26d8c447c1a8afd47efaaa263fe37c26684cb9fe1880f077e1e4562de05c85686769913568ed71b3e786e54170e184dad9aa89dbb8f4e79
-EBUILD go-9999.ebuild 3363 BLAKE2B 49672850d9c2e09b4263d4fa7211608251a080be138abeef75fd4602db68e346f7591832e18ef3248a37519af5c9126f192c908549bbcb62d1e09a764aaacd7f SHA512 99ed1c3388e560e851213dc6239a2da268818fa6fc74f068e912af05f3794b49d1bc26de8d6047a961d7596dbe46a2aaacdf97a15e792dece609bbfa9403ff19
+EBUILD go-9999.ebuild 3325 BLAKE2B 44e91a7a333928cf9776903747221b227951d35cafee81b4df3ce8cc3fc847b21503cd34b339cdade49de5a4c810aee5a2f00698542615a42efb189b9bf26208 SHA512 f7cb4aa003edf37bfc89ebd3269e16049a1a33345d2aa779a32029c6c7fbdff3e6d051e499676dbaee0eb061fccc27de9d5e5413b8ffb676ee6a8f237955d858
MISC metadata.xml 589 BLAKE2B 341e4c0e91d73ca668c1795035e1223eed60f85c724afd989ef1f8fb69649f7f6eaaf8a5228f6c8f587ffcc40a438c47d332fbe6866839f5a0829872a983f642 SHA512 fe58ddddfbd4d0d060516cb035592a80c0f48e125bb59c95d3c6fac0c182271e2a9ec9bd055b9cc8e6cb8c449e6c483bff4a23c362f532c24255febfdefc273a
diff --git a/dev-lang/go/files/go-1.24-dont-force-gold-arm.patch b/dev-lang/go/files/go-1.24-dont-force-gold-arm.patch
new file mode 100644
index 000000000000..4869b38593c4
--- /dev/null
+++ b/dev-lang/go/files/go-1.24-dont-force-gold-arm.patch
@@ -0,0 +1,55 @@
+Don't default to -fuse-ld=gold on arm64. The gold linker is deprecated in
+GNU Binutils and the referenced bfd bug which led to this default being
+added is long-fixed.
+
+https://src.fedoraproject.org/rpms/golang/raw/rawhide/f/0006-Default-to-ld.bfd-on-ARM64.patch
+https://bugs.gentoo.org/893956
+https://github.com/golang/go/issues/22040
+https://github.com/golang/go/pull/49748
+https://sourceware.org/PR19962
+
+From 46ec67413008607e2150e3395668e54e538c5b6b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Alejandro=20S=C3=A1ez?= <asm@redhat.com>
+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/dev-lang/go/go-1.24.2-r1.ebuild b/dev-lang/go/go-1.24.2-r1.ebuild
new file mode 100644
index 000000000000..2be24178ea79
--- /dev/null
+++ b/dev-lang/go/go-1.24.2-r1.ebuild
@@ -0,0 +1,132 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+
+# See "Bootstrap" in release notes
+GO_BOOTSTRAP_MIN=1.22.12
+MY_PV=${PV/_/}
+
+inherit go-env toolchain-funcs
+
+case ${PV} in
+*9999*)
+ EGIT_REPO_URI="https://github.com/golang/go.git"
+ inherit git-r3
+ ;;
+*)
+ SRC_URI="https://storage.googleapis.com/golang/go${MY_PV}.src.tar.gz "
+ S="${WORKDIR}"/go
+ KEYWORDS="-* ~amd64 ~arm ~arm64 ~loong ~mips ~ppc64 ~riscv ~s390 ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x64-solaris"
+ ;;
+esac
+
+DESCRIPTION="A concurrent garbage collected and typesafe programming language"
+HOMEPAGE="https://go.dev"
+
+LICENSE="BSD"
+SLOT="0/${PV}"
+IUSE="cpu_flags_x86_sse2"
+
+BDEPEND="|| (
+ >=dev-lang/go-${GO_BOOTSTRAP_MIN}
+ >=dev-lang/go-bootstrap-${GO_BOOTSTRAP_MIN} )"
+
+# the *.syso files have writable/executable stacks
+QA_EXECSTACK='*.syso'
+
+# Do not complain about CFLAGS, etc, since Go doesn't use them.
+QA_FLAGS_IGNORED='.*'
+
+# The tools in /usr/lib/go should not cause the multilib-strict check to fail.
+QA_MULTILIB_PATHS="usr/lib/go/pkg/tool/.*/.*"
+
+# This package triggers "unrecognized elf file(s)" notices on riscv.
+# https://bugs.gentoo.org/794046
+QA_PREBUILT='.*'
+
+# Do not strip this package. Stripping is unsupported upstream and may
+# fail.
+RESTRICT=" strip"
+
+DOCS=(
+ CONTRIBUTING.md
+ PATENTS
+ README.md
+ SECURITY.md
+)
+
+go_tuple() {
+ echo "$(go-env_goos $@)_$(go-env_goarch $@)"
+}
+
+go_cross_compile() {
+ [[ $(go_tuple ${CBUILD}) != $(go_tuple) ]]
+}
+
+PATCHES=(
+ "${FILESDIR}"/go-1.24-skip-gdb-tests.patch
+ "${FILESDIR}"/go-1.24-dont-force-gold-arm.patch
+ "${FILESDIR}"/go-never-download-newer-toolchains.patch
+)
+
+src_compile() {
+ if has_version -b ">=dev-lang/go-${GO_BOOTSTRAP_MIN}"; then
+ export GOROOT_BOOTSTRAP="${BROOT}/usr/lib/go"
+ elif has_version -b ">=dev-lang/go-bootstrap-${GO_BOOTSTRAP_MIN}"; then
+ export GOROOT_BOOTSTRAP="${BROOT}/usr/lib/go-bootstrap"
+ else
+ eerror "Go cannot be built without go or go-bootstrap installed"
+ die "Should not be here, please report a bug"
+ fi
+
+ # Go's build script does not use BUILD/HOST/TARGET consistently. :(
+ export GOHOSTARCH=$(go-env_goarch ${CBUILD})
+ export GOHOSTOS=$(go-env_goos ${CBUILD})
+ export CC=$(tc-getBUILD_CC)
+
+ export GOARCH=$(go-env_goarch)
+ export GOOS=$(go-env_goos)
+ export CC_FOR_TARGET=$(tc-getCC)
+ export CXX_FOR_TARGET=$(tc-getCXX)
+ use arm && export GOARM=$(go-env_goarm)
+ use x86 && export GO386=$(go-env_go386)
+
+ cd src
+ bash -x ./make.bash || die "build failed"
+}
+
+src_test() {
+ go_cross_compile && return 0
+ cd src
+ PATH="${GOBIN}:${PATH}" \
+ ./run.bash -no-rebuild -k || die "tests failed"
+}
+
+src_install() {
+ dodir /usr/lib/go
+ # The use of cp is deliberate in order to retain permissions
+ cp -R . "${ED}"/usr/lib/go
+ einstalldocs
+
+ # testdata directories are not needed on the installed system
+ # The other files we remove are installed by einstalldocs
+ rm -r $(find "${ED}"/usr/lib/go -iname testdata -type d -print) || die
+ rm "${ED}"/usr/lib/go/{CONTRIBUTING.md,PATENTS,README.md} || die
+ rm "${ED}"/usr/lib/go/{SECURITY.md,codereview.cfg,LICENSE} || die
+
+ local bin_path
+ if go_cross_compile; then
+ bin_path="bin/$(go_tuple)"
+ else
+ bin_path=bin
+ fi
+ local f x
+ for x in ${bin_path}/*; do
+ f=${x##*/}
+ dosym ../lib/go/${bin_path}/${f} /usr/bin/${f}
+ done
+}
diff --git a/dev-lang/go/go-9999.ebuild b/dev-lang/go/go-9999.ebuild
index f371daa2831b..923732906b23 100644
--- a/dev-lang/go/go-9999.ebuild
+++ b/dev-lang/go/go-9999.ebuild
@@ -31,9 +31,6 @@ LICENSE="BSD"
SLOT="0/${PV}"
IUSE="cpu_flags_x86_sse2"
-RDEPEND="
-arm? ( sys-devel/binutils[gold(-)] )
-arm64? ( sys-devel/binutils[gold(-)] )"
BDEPEND="|| (
>=dev-lang/go-${GO_BOOTSTRAP_MIN}
>=dev-lang/go-bootstrap-${GO_BOOTSTRAP_MIN} )"
@@ -71,6 +68,7 @@ go_cross_compile() {
}
PATCHES=(
+ "${FILESDIR}"/go-1.24-dont-force-gold-arm.patch
"${FILESDIR}"/go-never-download-newer-toolchains.patch
)