summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/go
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/go')
-rw-r--r--meta/recipes-devtools/go/go-1.24.4.inc (renamed from meta/recipes-devtools/go/go-1.22.2.inc)6
-rw-r--r--meta/recipes-devtools/go/go-binary-native_1.24.4.bb (renamed from meta/recipes-devtools/go/go-binary-native_1.22.2.bb)11
-rw-r--r--meta/recipes-devtools/go/go-common.inc4
-rw-r--r--meta/recipes-devtools/go/go-cross-canadian.inc5
-rw-r--r--meta/recipes-devtools/go/go-cross-canadian_1.24.4.bb (renamed from meta/recipes-devtools/go/go-cross-canadian_1.22.2.bb)0
-rw-r--r--meta/recipes-devtools/go/go-cross_1.24.4.bb (renamed from meta/recipes-devtools/go/go-cross_1.22.2.bb)0
-rw-r--r--meta/recipes-devtools/go/go-crosssdk.inc2
-rw-r--r--meta/recipes-devtools/go/go-crosssdk_1.24.4.bb (renamed from meta/recipes-devtools/go/go-crosssdk_1.22.2.bb)0
-rw-r--r--meta/recipes-devtools/go/go-native_1.22.2.bb58
-rw-r--r--meta/recipes-devtools/go/go-runtime.inc2
-rw-r--r--meta/recipes-devtools/go/go-runtime_1.24.4.bb (renamed from meta/recipes-devtools/go/go-runtime_1.22.2.bb)0
-rw-r--r--meta/recipes-devtools/go/go/0001-cmd-go-make-content-based-hash-generation-less-pedan.patch38
-rw-r--r--meta/recipes-devtools/go/go/0002-cmd-go-Allow-GOTOOLDIR-to-be-overridden-in-the-envir.patch14
-rw-r--r--meta/recipes-devtools/go/go/0003-ld-add-soname-to-shareable-objects.patch14
-rw-r--r--meta/recipes-devtools/go/go/0004-make.bash-override-CC-when-building-dist-and-go_boot.patch31
-rw-r--r--meta/recipes-devtools/go/go/0005-cmd-dist-separate-host-and-target-builds.patch37
-rw-r--r--meta/recipes-devtools/go/go/0006-cmd-go-make-GOROOT-precious-by-default.patch22
-rw-r--r--meta/recipes-devtools/go/go/0007-exec.go-filter-out-build-specific-paths-from-linker-.patch12
-rw-r--r--meta/recipes-devtools/go/go/0008-src-cmd-dist-buildgo.go-do-not-hardcode-host-compile.patch6
-rw-r--r--meta/recipes-devtools/go/go/0009-go-Filter-build-paths-on-staticly-linked-arches.patch14
-rw-r--r--meta/recipes-devtools/go/go/0010-cmd-go-clear-GOROOT-for-func-ldShared-when-trimpath-.patch51
-rw-r--r--meta/recipes-devtools/go/go/6d265b008e3d106b2706645e5a88cd8e2fb98953.patch54
-rw-r--r--meta/recipes-devtools/go/go_1.24.4.bb (renamed from meta/recipes-devtools/go/go_1.22.2.bb)0
23 files changed, 221 insertions, 160 deletions
diff --git a/meta/recipes-devtools/go/go-1.22.2.inc b/meta/recipes-devtools/go/go-1.24.4.inc
index b399207311..eff3f2f605 100644
--- a/meta/recipes-devtools/go/go-1.22.2.inc
+++ b/meta/recipes-devtools/go/go-1.24.4.inc
@@ -2,7 +2,7 @@ require go-common.inc
2 2
3FILESEXTRAPATHS:prepend := "${FILE_DIRNAME}/go:" 3FILESEXTRAPATHS:prepend := "${FILE_DIRNAME}/go:"
4 4
5LIC_FILES_CHKSUM = "file://LICENSE;md5=5d4950ecb7b26d2c5e4e7b4e0dd74707" 5LIC_FILES_CHKSUM = "file://LICENSE;md5=7998cb338f82d15c0eff93b7004d272a"
6 6
7SRC_URI += "\ 7SRC_URI += "\
8 file://0001-cmd-go-make-content-based-hash-generation-less-pedan.patch \ 8 file://0001-cmd-go-make-content-based-hash-generation-less-pedan.patch \
@@ -14,5 +14,7 @@ SRC_URI += "\
14 file://0007-exec.go-filter-out-build-specific-paths-from-linker-.patch \ 14 file://0007-exec.go-filter-out-build-specific-paths-from-linker-.patch \
15 file://0008-src-cmd-dist-buildgo.go-do-not-hardcode-host-compile.patch \ 15 file://0008-src-cmd-dist-buildgo.go-do-not-hardcode-host-compile.patch \
16 file://0009-go-Filter-build-paths-on-staticly-linked-arches.patch \ 16 file://0009-go-Filter-build-paths-on-staticly-linked-arches.patch \
17 file://0010-cmd-go-clear-GOROOT-for-func-ldShared-when-trimpath-.patch \
18 file://6d265b008e3d106b2706645e5a88cd8e2fb98953.patch \
17" 19"
18SRC_URI[main.sha256sum] = "374ea82b289ec738e968267cac59c7d5ff180f9492250254784b2044e90df5a9" 20SRC_URI[main.sha256sum] = "5a86a83a31f9fa81490b8c5420ac384fd3d95a3e71fba665c7b3f95d1dfef2b4"
diff --git a/meta/recipes-devtools/go/go-binary-native_1.22.2.bb b/meta/recipes-devtools/go/go-binary-native_1.24.4.bb
index 0f00509f03..ae85d3e266 100644
--- a/meta/recipes-devtools/go/go-binary-native_1.22.2.bb
+++ b/meta/recipes-devtools/go/go-binary-native_1.24.4.bb
@@ -3,22 +3,23 @@
3SUMMARY = "Go programming language compiler (upstream binary for bootstrap)" 3SUMMARY = "Go programming language compiler (upstream binary for bootstrap)"
4HOMEPAGE = " http://golang.org/" 4HOMEPAGE = " http://golang.org/"
5LICENSE = "BSD-3-Clause" 5LICENSE = "BSD-3-Clause"
6LIC_FILES_CHKSUM = "file://LICENSE;md5=5d4950ecb7b26d2c5e4e7b4e0dd74707" 6LIC_FILES_CHKSUM = "file://LICENSE;md5=7998cb338f82d15c0eff93b7004d272a"
7 7
8PROVIDES = "go-native" 8PROVIDES = "go-native"
9 9
10# Checksums available at https://go.dev/dl/ 10# Checksums available at https://go.dev/dl/
11SRC_URI = "https://dl.google.com/go/go${PV}.${BUILD_GOOS}-${BUILD_GOARCH}.tar.gz;name=go_${BUILD_GOTUPLE}" 11SRC_URI = "https://dl.google.com/go/go${PV}.${BUILD_GOOS}-${BUILD_GOARCH}.tar.gz;name=go_${BUILD_GOTUPLE}"
12SRC_URI[go_linux_amd64.sha256sum] = "5901c52b7a78002aeff14a21f93e0f064f74ce1360fce51c6ee68cd471216a17" 12SRC_URI[go_linux_amd64.sha256sum] = "77e5da33bb72aeaef1ba4418b6fe511bc4d041873cbf82e5aa6318740df98717"
13SRC_URI[go_linux_arm64.sha256sum] = "36e720b2d564980c162a48c7e97da2e407dfcc4239e1e58d98082dfa2486a0c1" 13SRC_URI[go_linux_arm64.sha256sum] = "d5501ee5aca0f258d5fe9bfaed401958445014495dc115f202d43d5210b45241"
14SRC_URI[go_linux_ppc64le.sha256sum] = "251a8886c5113be6490bdbb955ddee98763b49c9b1bf4c8364c02d3b482dab00" 14SRC_URI[go_linux_ppc64le.sha256sum] = "9ca4afef813a2578c23843b640ae0290aa54b2e3c950a6cc4c99e16a57dec2ec"
15 15
16UPSTREAM_CHECK_URI = "https://golang.org/dl/" 16UPSTREAM_CHECK_URI = "https://golang.org/dl/"
17UPSTREAM_CHECK_REGEX = "go(?P<pver>\d+(\.\d+)+)\.linux" 17UPSTREAM_CHECK_REGEX = "go(?P<pver>\d+(\.\d+)+)\.linux"
18 18
19CVE_PRODUCT = "golang:go" 19CVE_PRODUCT = "golang:go"
20CVE_STATUS[CVE-2024-3566] = "not-applicable-platform: Issue only applies on Windows"
20 21
21S = "${WORKDIR}/go" 22S = "${UNPACKDIR}/go"
22 23
23inherit goarch native 24inherit goarch native
24 25
diff --git a/meta/recipes-devtools/go/go-common.inc b/meta/recipes-devtools/go/go-common.inc
index db165792dc..061db4296c 100644
--- a/meta/recipes-devtools/go/go-common.inc
+++ b/meta/recipes-devtools/go/go-common.inc
@@ -15,12 +15,13 @@ LICENSE = "BSD-3-Clause"
15inherit goarch 15inherit goarch
16 16
17SRC_URI = "https://golang.org/dl/go${PV}.src.tar.gz;name=main" 17SRC_URI = "https://golang.org/dl/go${PV}.src.tar.gz;name=main"
18S = "${WORKDIR}/go" 18S = "${UNPACKDIR}/go"
19B = "${S}" 19B = "${S}"
20UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)\.src\.tar" 20UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)\.src\.tar"
21 21
22# all recipe variants are created from the same product 22# all recipe variants are created from the same product
23CVE_PRODUCT = "golang:go" 23CVE_PRODUCT = "golang:go"
24CVE_STATUS[CVE-2024-3566] = "not-applicable-platform: Issue only applies on Windows"
24 25
25INHIBIT_PACKAGE_DEBUG_SPLIT = "1" 26INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
26SSTATE_SCAN_CMD = "true" 27SSTATE_SCAN_CMD = "true"
@@ -38,7 +39,6 @@ export GOARCH ?= "${TARGET_GOARCH}"
38export GOARM ?= "${TARGET_GOARM}" 39export GOARM ?= "${TARGET_GOARM}"
39export GO386 ?= "${TARGET_GO386}" 40export GO386 ?= "${TARGET_GO386}"
40export GOMIPS ?= "${TARGET_GOMIPS}" 41export GOMIPS ?= "${TARGET_GOMIPS}"
41export GOROOT_FINAL ?= "${libdir}/go"
42 42
43export GODEBUG = "gocachehash=1" 43export GODEBUG = "gocachehash=1"
44 44
diff --git a/meta/recipes-devtools/go/go-cross-canadian.inc b/meta/recipes-devtools/go/go-cross-canadian.inc
index dd485b6799..39330fc98b 100644
--- a/meta/recipes-devtools/go/go-cross-canadian.inc
+++ b/meta/recipes-devtools/go/go-cross-canadian.inc
@@ -1,8 +1,8 @@
1inherit cross-canadian 1inherit cross-canadian
2 2
3DEPENDS = "go-native virtual/${HOST_PREFIX}go virtual/nativesdk-${HOST_PREFIX}go-runtime \ 3DEPENDS = "go-native virtual/${HOST_PREFIX}go virtual/nativesdk-${HOST_PREFIX}go-runtime \
4 virtual/${HOST_PREFIX}gcc virtual/nativesdk-libc \ 4 virtual/nativesdk-cross-cc virtual/nativesdk-libc \
5 virtual/nativesdk-${HOST_PREFIX}compilerlibs" 5 virtual/nativesdk-compilerlibs"
6PN = "go-cross-canadian-${TRANSLATED_TARGET_ARCH}" 6PN = "go-cross-canadian-${TRANSLATED_TARGET_ARCH}"
7 7
8# it uses gcc on build machine during go-cross-canadian bootstrap, but 8# it uses gcc on build machine during go-cross-canadian bootstrap, but
@@ -29,7 +29,6 @@ do_compile() {
29} 29}
30do_compile[cleandirs] += "${GOTMPDIR} ${B}/bin ${B}/pkg" 30do_compile[cleandirs] += "${GOTMPDIR} ${B}/bin ${B}/pkg"
31 31
32
33make_wrapper() { 32make_wrapper() {
34 rm -f ${D}${bindir}/$2 33 rm -f ${D}${bindir}/$2
35 cat <<END >${D}${bindir}/$2 34 cat <<END >${D}${bindir}/$2
diff --git a/meta/recipes-devtools/go/go-cross-canadian_1.22.2.bb b/meta/recipes-devtools/go/go-cross-canadian_1.24.4.bb
index 7ac9449e47..7ac9449e47 100644
--- a/meta/recipes-devtools/go/go-cross-canadian_1.22.2.bb
+++ b/meta/recipes-devtools/go/go-cross-canadian_1.24.4.bb
diff --git a/meta/recipes-devtools/go/go-cross_1.22.2.bb b/meta/recipes-devtools/go/go-cross_1.24.4.bb
index 80b5a03f6c..80b5a03f6c 100644
--- a/meta/recipes-devtools/go/go-cross_1.22.2.bb
+++ b/meta/recipes-devtools/go/go-cross_1.24.4.bb
diff --git a/meta/recipes-devtools/go/go-crosssdk.inc b/meta/recipes-devtools/go/go-crosssdk.inc
index 12939005c0..4f19025ba7 100644
--- a/meta/recipes-devtools/go/go-crosssdk.inc
+++ b/meta/recipes-devtools/go/go-crosssdk.inc
@@ -1,6 +1,6 @@
1inherit crosssdk 1inherit crosssdk
2 2
3DEPENDS = "go-native virtual/${TARGET_PREFIX}gcc virtual/nativesdk-${TARGET_PREFIX}compilerlibs virtual/${TARGET_PREFIX}binutils" 3DEPENDS = "go-native virtual/nativesdk-cross-cc virtual/nativesdk-compilerlibs virtual/nativesdk-cross-binutils"
4PN = "go-crosssdk-${SDK_SYS}" 4PN = "go-crosssdk-${SDK_SYS}"
5PROVIDES = "virtual/${TARGET_PREFIX}go" 5PROVIDES = "virtual/${TARGET_PREFIX}go"
6 6
diff --git a/meta/recipes-devtools/go/go-crosssdk_1.22.2.bb b/meta/recipes-devtools/go/go-crosssdk_1.24.4.bb
index 1857c8a577..1857c8a577 100644
--- a/meta/recipes-devtools/go/go-crosssdk_1.22.2.bb
+++ b/meta/recipes-devtools/go/go-crosssdk_1.24.4.bb
diff --git a/meta/recipes-devtools/go/go-native_1.22.2.bb b/meta/recipes-devtools/go/go-native_1.22.2.bb
deleted file mode 100644
index ddf25b2c9b..0000000000
--- a/meta/recipes-devtools/go/go-native_1.22.2.bb
+++ /dev/null
@@ -1,58 +0,0 @@
1# This recipe builds a native Go (written in Go) by first building an old Go 1.4
2# (written in C). However this old Go does not support all hosts platforms.
3
4require go-${PV}.inc
5
6inherit native
7
8SRC_URI += "https://dl.google.com/go/go1.4-bootstrap-20171003.tar.gz;name=bootstrap;subdir=go1.4"
9SRC_URI[bootstrap.sha256sum] = "f4ff5b5eb3a3cae1c993723f3eab519c5bae18866b5e5f96fe1102f0cb5c3e52"
10
11export GOOS = "${BUILD_GOOS}"
12export GOARCH = "${BUILD_GOARCH}"
13CC = "${@d.getVar('BUILD_CC').strip()}"
14
15GOMAKEARGS ?= "--no-banner"
16
17do_configure() {
18 cd ${WORKDIR}/go1.4/go/src
19 CGO_ENABLED=0 GOROOT=${WORKDIR}/go1.4/go ./make.bash
20}
21
22do_compile() {
23 export GOROOT_FINAL="${libdir_native}/go"
24 export GOROOT_BOOTSTRAP="${WORKDIR}/go1.4/go"
25
26 cd src
27 ./make.bash ${GOMAKEARGS}
28 cd ${B}
29}
30do_compile[cleandirs] += "${GOTMPDIR} ${B}/bin"
31
32make_wrapper() {
33 rm -f ${D}${bindir}/$2$3
34 cat <<END >${D}${bindir}/$2$3
35#!/bin/bash
36here=\`dirname \$0\`
37export GOROOT="${GOROOT:-\`readlink -f \$here/../lib/go\`}"
38\$here/../lib/go/bin/$1 "\$@"
39END
40 chmod +x ${D}${bindir}/$2
41}
42
43do_install() {
44 install -d ${D}${libdir}/go
45 cp --preserve=mode,timestamps -R ${B}/pkg ${D}${libdir}/go/
46 install -d ${D}${libdir}/go/src
47 (cd ${S}/src; for d in *; do \
48 [ -d $d ] && cp -a ${S}/src/$d ${D}${libdir}/go/src/; \
49 done)
50 find ${D}${libdir}/go/src -depth -type d -name testdata -exec rm -rf {} \;
51 install -d ${D}${bindir} ${D}${libdir}/go/bin
52 for f in ${B}/bin/*
53 do
54 base=`basename $f`
55 install -m755 $f ${D}${libdir}/go/bin
56 make_wrapper $base $base
57 done
58}
diff --git a/meta/recipes-devtools/go/go-runtime.inc b/meta/recipes-devtools/go/go-runtime.inc
index 413cf6d33f..e5f17337bc 100644
--- a/meta/recipes-devtools/go/go-runtime.inc
+++ b/meta/recipes-devtools/go/go-runtime.inc
@@ -34,7 +34,7 @@ do_compile() {
34 if [ -n "${GO_DYNLINK}" ]; then 34 if [ -n "${GO_DYNLINK}" ]; then
35 export GOTOOLDIR="${B}/pkg/tool/native_native" 35 export GOTOOLDIR="${B}/pkg/tool/native_native"
36 CC="$CC_FOR_${TARGET_GOTUPLE}" GOARCH="${TARGET_GOARCH}" GOOS="${TARGET_GOOS}" GOROOT=${B} \ 36 CC="$CC_FOR_${TARGET_GOTUPLE}" GOARCH="${TARGET_GOARCH}" GOOS="${TARGET_GOOS}" GOROOT=${B} \
37 $GOTOOLDIR/go_bootstrap install -linkshared -buildmode=shared ${GO_SHLIB_LDFLAGS} std 37 $GOTOOLDIR/go_bootstrap install -linkshared -trimpath -buildmode=shared ${GO_SHLIB_LDFLAGS} std
38 fi 38 fi
39 cd ${B} 39 cd ${B}
40} 40}
diff --git a/meta/recipes-devtools/go/go-runtime_1.22.2.bb b/meta/recipes-devtools/go/go-runtime_1.24.4.bb
index 63464a1501..63464a1501 100644
--- a/meta/recipes-devtools/go/go-runtime_1.22.2.bb
+++ b/meta/recipes-devtools/go/go-runtime_1.24.4.bb
diff --git a/meta/recipes-devtools/go/go/0001-cmd-go-make-content-based-hash-generation-less-pedan.patch b/meta/recipes-devtools/go/go/0001-cmd-go-make-content-based-hash-generation-less-pedan.patch
index 564837c7cd..86e941b970 100644
--- a/meta/recipes-devtools/go/go/0001-cmd-go-make-content-based-hash-generation-less-pedan.patch
+++ b/meta/recipes-devtools/go/go/0001-cmd-go-make-content-based-hash-generation-less-pedan.patch
@@ -1,7 +1,8 @@
1From 9a6c5040cbcd88b10ceb8ceaebc8d6158c086670 Mon Sep 17 00:00:00 2001 1From 51c04a9a19dec5a48fa0f38324dc2480b7a859e4 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 28 Mar 2022 10:59:03 -0700 3Date: Sat, 22 Feb 2025 03:24:48 -0800
4Subject: [PATCH 1/9] cmd/go: make content-based hash generation less pedantic 4Subject: [PATCH 01/11] cmd/go: make content-based hash generation less
5 pedantic
5 6
6Go 1.10's build tool now uses content-based hashes to 7Go 1.10's build tool now uses content-based hashes to
7determine when something should be built or re-built. 8determine when something should be built or re-built.
@@ -26,16 +27,19 @@ Signed-off-by: Alex Kube <alexander.j.kube@gmail.com>
26Signed-off-by: Matt Madison <matt@madison.systems> 27Signed-off-by: Matt Madison <matt@madison.systems>
27Signed-off-by: Khem Raj <raj.khem@gmail.com> 28Signed-off-by: Khem Raj <raj.khem@gmail.com>
28Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io> 29Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
30
31Rebase to 1.23.4
32Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
29--- 33---
30 src/cmd/go/internal/envcmd/env.go | 2 +- 34 src/cmd/go/internal/envcmd/env.go | 2 +-
31 src/cmd/go/internal/work/exec.go | 44 ++++++++++++++++++++++++------- 35 src/cmd/go/internal/work/exec.go | 44 ++++++++++++++++++++++++-------
32 2 files changed, 36 insertions(+), 10 deletions(-) 36 2 files changed, 36 insertions(+), 10 deletions(-)
33 37
34diff --git a/src/cmd/go/internal/envcmd/env.go b/src/cmd/go/internal/envcmd/env.go 38diff --git a/src/cmd/go/internal/envcmd/env.go b/src/cmd/go/internal/envcmd/env.go
35index c7c2e83e0f..4a90d9da5c 100644 39index 7c370d427f..c2441f7695 100644
36--- a/src/cmd/go/internal/envcmd/env.go 40--- a/src/cmd/go/internal/envcmd/env.go
37+++ b/src/cmd/go/internal/envcmd/env.go 41+++ b/src/cmd/go/internal/envcmd/env.go
38@@ -189,7 +189,7 @@ func ExtraEnvVarsCostly() []cfg.EnvVar { 42@@ -219,7 +219,7 @@ func ExtraEnvVarsCostly() []cfg.EnvVar {
39 } 43 }
40 }() 44 }()
41 45
@@ -45,10 +49,10 @@ index c7c2e83e0f..4a90d9da5c 100644
45 // Should not happen - b.CFlags was given an empty package. 49 // Should not happen - b.CFlags was given an empty package.
46 fmt.Fprintf(os.Stderr, "go: invalid cflags: %v\n", err) 50 fmt.Fprintf(os.Stderr, "go: invalid cflags: %v\n", err)
47diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go 51diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go
48index e05471b06c..9724cd07d0 100644 52index 7b073165d5..1f618be0bb 100644
49--- a/src/cmd/go/internal/work/exec.go 53--- a/src/cmd/go/internal/work/exec.go
50+++ b/src/cmd/go/internal/work/exec.go 54+++ b/src/cmd/go/internal/work/exec.go
51@@ -232,6 +232,8 @@ func (b *Builder) Do(ctx context.Context, root *Action) { 55@@ -237,6 +237,8 @@ func (b *Builder) Do(ctx context.Context, root *Action) {
52 writeActionGraph() 56 writeActionGraph()
53 } 57 }
54 58
@@ -57,7 +61,7 @@ index e05471b06c..9724cd07d0 100644
57 // buildActionID computes the action ID for a build action. 61 // buildActionID computes the action ID for a build action.
58 func (b *Builder) buildActionID(a *Action) cache.ActionID { 62 func (b *Builder) buildActionID(a *Action) cache.ActionID {
59 p := a.Package 63 p := a.Package
60@@ -253,7 +255,7 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID { 64@@ -258,7 +260,7 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
61 if p.Module != nil { 65 if p.Module != nil {
62 fmt.Fprintf(h, "module %s@%s\n", p.Module.Path, p.Module.Version) 66 fmt.Fprintf(h, "module %s@%s\n", p.Module.Path, p.Module.Version)
63 } 67 }
@@ -66,7 +70,7 @@ index e05471b06c..9724cd07d0 100644
66 // The Go compiler always hides the exact value of $GOROOT 70 // The Go compiler always hides the exact value of $GOROOT
67 // when building things in GOROOT. 71 // when building things in GOROOT.
68 // 72 //
69@@ -285,9 +287,9 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID { 73@@ -293,9 +295,9 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
70 } 74 }
71 if len(p.CgoFiles)+len(p.SwigFiles)+len(p.SwigCXXFiles) > 0 { 75 if len(p.CgoFiles)+len(p.SwigFiles)+len(p.SwigCXXFiles) > 0 {
72 fmt.Fprintf(h, "cgo %q\n", b.toolID("cgo")) 76 fmt.Fprintf(h, "cgo %q\n", b.toolID("cgo"))
@@ -78,7 +82,7 @@ index e05471b06c..9724cd07d0 100644
78 fmt.Fprintf(h, "CC=%q %q %q %q\n", ccExe, cppflags, cflags, ldflags) 82 fmt.Fprintf(h, "CC=%q %q %q %q\n", ccExe, cppflags, cflags, ldflags)
79 // Include the C compiler tool ID so that if the C 83 // Include the C compiler tool ID so that if the C
80 // compiler changes we rebuild the package. 84 // compiler changes we rebuild the package.
81@@ -295,14 +297,14 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID { 85@@ -303,14 +305,14 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
82 fmt.Fprintf(h, "CC ID=%q\n", ccID) 86 fmt.Fprintf(h, "CC ID=%q\n", ccID)
83 } 87 }
84 if len(p.CXXFiles)+len(p.SwigCXXFiles) > 0 { 88 if len(p.CXXFiles)+len(p.SwigCXXFiles) > 0 {
@@ -95,7 +99,7 @@ index e05471b06c..9724cd07d0 100644
95 fmt.Fprintf(h, "FC=%q %q\n", fcExe, fflags) 99 fmt.Fprintf(h, "FC=%q %q\n", fcExe, fflags)
96 if fcID, _, err := b.gccToolID(fcExe[0], "f95"); err == nil { 100 if fcID, _, err := b.gccToolID(fcExe[0], "f95"); err == nil {
97 fmt.Fprintf(h, "FC ID=%q\n", fcID) 101 fmt.Fprintf(h, "FC ID=%q\n", fcID)
98@@ -319,7 +321,7 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID { 102@@ -327,7 +329,7 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
99 } 103 }
100 } 104 }
101 if p.Internal.BuildInfo != nil { 105 if p.Internal.BuildInfo != nil {
@@ -104,7 +108,7 @@ index e05471b06c..9724cd07d0 100644
104 } 108 }
105 109
106 // Configuration specific to compiler toolchain. 110 // Configuration specific to compiler toolchain.
107@@ -2679,8 +2681,25 @@ func envList(key, def string) []string { 111@@ -2659,8 +2661,25 @@ func envList(key, def string) []string {
108 return args 112 return args
109 } 113 }
110 114
@@ -131,8 +135,8 @@ index e05471b06c..9724cd07d0 100644
131 if cppflags, err = buildFlags("CPPFLAGS", "", p.CgoCPPFLAGS, checkCompilerFlags); err != nil { 135 if cppflags, err = buildFlags("CPPFLAGS", "", p.CgoCPPFLAGS, checkCompilerFlags); err != nil {
132 return 136 return
133 } 137 }
134@@ -2696,6 +2715,13 @@ func (b *Builder) CFlags(p *load.Package) (cppflags, cflags, cxxflags, fflags, l 138@@ -2676,6 +2695,13 @@ func (b *Builder) CFlags(p *load.Package) (cppflags, cflags, cxxflags, fflags, l
135 if ldflags, err = buildFlags("LDFLAGS", defaultCFlags, p.CgoLDFLAGS, checkLinkerFlags); err != nil { 139 if ldflags, err = buildFlags("LDFLAGS", DefaultCFlags, p.CgoLDFLAGS, checkLinkerFlags); err != nil {
136 return 140 return
137 } 141 }
138+ if filtered { 142+ if filtered {
@@ -145,7 +149,7 @@ index e05471b06c..9724cd07d0 100644
145 149
146 return 150 return
147 } 151 }
148@@ -2713,7 +2739,7 @@ func (b *Builder) cgo(a *Action, cgoExe, objdir string, pcCFLAGS, pcLDFLAGS, cgo 152@@ -2693,7 +2719,7 @@ func (b *Builder) cgo(a *Action, cgoExe, objdir string, pcCFLAGS, pcLDFLAGS, cgo
149 p := a.Package 153 p := a.Package
150 sh := b.Shell(a) 154 sh := b.Shell(a)
151 155
@@ -154,7 +158,7 @@ index e05471b06c..9724cd07d0 100644
154 if err != nil { 158 if err != nil {
155 return nil, nil, err 159 return nil, nil, err
156 } 160 }
157@@ -3268,7 +3294,7 @@ func (b *Builder) swigOne(a *Action, file, objdir string, pcCFLAGS []string, cxx 161@@ -3256,7 +3282,7 @@ func (b *Builder) swigOne(a *Action, file, objdir string, pcCFLAGS []string, cxx
158 p := a.Package 162 p := a.Package
159 sh := b.Shell(a) 163 sh := b.Shell(a)
160 164
@@ -164,5 +168,5 @@ index e05471b06c..9724cd07d0 100644
164 return "", "", err 168 return "", "", err
165 } 169 }
166-- 170--
1672.44.0 1712.25.1
168 172
diff --git a/meta/recipes-devtools/go/go/0002-cmd-go-Allow-GOTOOLDIR-to-be-overridden-in-the-envir.patch b/meta/recipes-devtools/go/go/0002-cmd-go-Allow-GOTOOLDIR-to-be-overridden-in-the-envir.patch
index 001c94a4e7..7e86d8cd6b 100644
--- a/meta/recipes-devtools/go/go/0002-cmd-go-Allow-GOTOOLDIR-to-be-overridden-in-the-envir.patch
+++ b/meta/recipes-devtools/go/go/0002-cmd-go-Allow-GOTOOLDIR-to-be-overridden-in-the-envir.patch
@@ -1,7 +1,7 @@
1From e3f9a8a69d3a340c1a1d0bba566e71f20f635a43 Mon Sep 17 00:00:00 2001 1From fdad9a0ea659cf2281a0df16b0f69f179605ec9a Mon Sep 17 00:00:00 2001
2From: Alex Kube <alexander.j.kube@gmail.com> 2From: Alex Kube <alexander.j.kube@gmail.com>
3Date: Wed, 23 Oct 2019 21:15:37 +0430 3Date: Wed, 23 Oct 2019 21:15:37 +0430
4Subject: [PATCH 2/9] cmd/go: Allow GOTOOLDIR to be overridden in the 4Subject: [PATCH 02/11] cmd/go: Allow GOTOOLDIR to be overridden in the
5 environment 5 environment
6 6
7to allow for split host/target build roots 7to allow for split host/target build roots
@@ -20,10 +20,10 @@ Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
20 2 files changed, 8 insertions(+), 2 deletions(-) 20 2 files changed, 8 insertions(+), 2 deletions(-)
21 21
22diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go 22diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go
23index 32e59b446a..06ee4de8a9 100644 23index 1f467647f5..b62e518030 100644
24--- a/src/cmd/dist/build.go 24--- a/src/cmd/dist/build.go
25+++ b/src/cmd/dist/build.go 25+++ b/src/cmd/dist/build.go
26@@ -259,7 +259,9 @@ func xinit() { 26@@ -280,7 +280,9 @@ func xinit() {
27 } 27 }
28 xatexit(rmworkdir) 28 xatexit(rmworkdir)
29 29
@@ -35,10 +35,10 @@ index 32e59b446a..06ee4de8a9 100644
35 goversion := findgoversion() 35 goversion := findgoversion()
36 isRelease = strings.HasPrefix(goversion, "release.") || strings.HasPrefix(goversion, "go") 36 isRelease = strings.HasPrefix(goversion, "release.") || strings.HasPrefix(goversion, "go")
37diff --git a/src/cmd/go/internal/cfg/cfg.go b/src/cmd/go/internal/cfg/cfg.go 37diff --git a/src/cmd/go/internal/cfg/cfg.go b/src/cmd/go/internal/cfg/cfg.go
38index a8daa2dfc3..393ada39c9 100644 38index 3b9f27e91d..ec043c1530 100644
39--- a/src/cmd/go/internal/cfg/cfg.go 39--- a/src/cmd/go/internal/cfg/cfg.go
40+++ b/src/cmd/go/internal/cfg/cfg.go 40+++ b/src/cmd/go/internal/cfg/cfg.go
41@@ -230,7 +230,11 @@ func SetGOROOT(goroot string, isTestGo bool) { 41@@ -248,7 +248,11 @@ func SetGOROOT(goroot string, isTestGo bool) {
42 // This matches the initialization of ToolDir in go/build, except for 42 // This matches the initialization of ToolDir in go/build, except for
43 // using ctxt.GOROOT and the installed GOOS and GOARCH rather than the 43 // using ctxt.GOROOT and the installed GOOS and GOARCH rather than the
44 // GOROOT, GOOS, and GOARCH reported by the runtime package. 44 // GOROOT, GOOS, and GOARCH reported by the runtime package.
@@ -52,5 +52,5 @@ index a8daa2dfc3..393ada39c9 100644
52 } 52 }
53 } 53 }
54-- 54--
552.44.0 552.25.1
56 56
diff --git a/meta/recipes-devtools/go/go/0003-ld-add-soname-to-shareable-objects.patch b/meta/recipes-devtools/go/go/0003-ld-add-soname-to-shareable-objects.patch
index 9cab2969c8..86a4bb1ea5 100644
--- a/meta/recipes-devtools/go/go/0003-ld-add-soname-to-shareable-objects.patch
+++ b/meta/recipes-devtools/go/go/0003-ld-add-soname-to-shareable-objects.patch
@@ -1,7 +1,7 @@
1From 7dde77b3ce8138314dd2736604b1b110dbcc0ac1 Mon Sep 17 00:00:00 2001 1From 1546d837c69b654754ee137af1fa1c2f7500cfa2 Mon Sep 17 00:00:00 2001
2From: Alex Kube <alexander.j.kube@gmail.com> 2From: Alex Kube <alexander.j.kube@gmail.com>
3Date: Wed, 23 Oct 2019 21:16:32 +0430 3Date: Wed, 23 Oct 2019 21:16:32 +0430
4Subject: [PATCH 3/9] ld: add soname to shareable objects 4Subject: [PATCH 03/11] ld: add soname to shareable objects
5 5
6so that OE's shared library dependency handling 6so that OE's shared library dependency handling
7can find them. 7can find them.
@@ -19,10 +19,10 @@ Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
19 1 file changed, 3 insertions(+) 19 1 file changed, 3 insertions(+)
20 20
21diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go 21diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go
22index eab74dc328..ae9bbc9093 100644 22index 2d8f964f35..dfc72e02c0 100644
23--- a/src/cmd/link/internal/ld/lib.go 23--- a/src/cmd/link/internal/ld/lib.go
24+++ b/src/cmd/link/internal/ld/lib.go 24+++ b/src/cmd/link/internal/ld/lib.go
25@@ -1576,6 +1576,7 @@ func (ctxt *Link) hostlink() { 25@@ -1624,6 +1624,7 @@ func (ctxt *Link) hostlink() {
26 argv = append(argv, "-Wl,-z,relro") 26 argv = append(argv, "-Wl,-z,relro")
27 } 27 }
28 argv = append(argv, "-shared") 28 argv = append(argv, "-shared")
@@ -30,7 +30,7 @@ index eab74dc328..ae9bbc9093 100644
30 if ctxt.HeadType == objabi.Hwindows { 30 if ctxt.HeadType == objabi.Hwindows {
31 argv = addASLRargs(argv, *flagAslr) 31 argv = addASLRargs(argv, *flagAslr)
32 } else { 32 } else {
33@@ -1591,6 +1592,7 @@ func (ctxt *Link) hostlink() { 33@@ -1639,6 +1640,7 @@ func (ctxt *Link) hostlink() {
34 argv = append(argv, "-Wl,-z,relro") 34 argv = append(argv, "-Wl,-z,relro")
35 } 35 }
36 argv = append(argv, "-shared") 36 argv = append(argv, "-shared")
@@ -38,7 +38,7 @@ index eab74dc328..ae9bbc9093 100644
38 case BuildModePlugin: 38 case BuildModePlugin:
39 if ctxt.HeadType == objabi.Hdarwin { 39 if ctxt.HeadType == objabi.Hdarwin {
40 argv = append(argv, "-dynamiclib") 40 argv = append(argv, "-dynamiclib")
41@@ -1599,6 +1601,7 @@ func (ctxt *Link) hostlink() { 41@@ -1647,6 +1649,7 @@ func (ctxt *Link) hostlink() {
42 argv = append(argv, "-Wl,-z,relro") 42 argv = append(argv, "-Wl,-z,relro")
43 } 43 }
44 argv = append(argv, "-shared") 44 argv = append(argv, "-shared")
@@ -47,5 +47,5 @@ index eab74dc328..ae9bbc9093 100644
47 } 47 }
48 48
49-- 49--
502.44.0 502.25.1
51 51
diff --git a/meta/recipes-devtools/go/go/0004-make.bash-override-CC-when-building-dist-and-go_boot.patch b/meta/recipes-devtools/go/go/0004-make.bash-override-CC-when-building-dist-and-go_boot.patch
index 8889aef1cf..abbb7bda2b 100644
--- a/meta/recipes-devtools/go/go/0004-make.bash-override-CC-when-building-dist-and-go_boot.patch
+++ b/meta/recipes-devtools/go/go/0004-make.bash-override-CC-when-building-dist-and-go_boot.patch
@@ -1,7 +1,7 @@
1From 9f59e46991074d3e3c4d00f3971e62bfcd707167 Mon Sep 17 00:00:00 2001 1From b41aaa851f0074682fcd4bf07c891fbdf0fdf70c Mon Sep 17 00:00:00 2001
2From: Alex Kube <alexander.j.kube@gmail.com> 2From: Alex Kube <alexander.j.kube@gmail.com>
3Date: Wed, 23 Oct 2019 21:17:16 +0430 3Date: Sat, 22 Feb 2025 03:14:37 -0800
4Subject: [PATCH 4/9] make.bash: override CC when building dist and 4Subject: [PATCH 04/11] make.bash: override CC when building dist and
5 go_bootstrap 5 go_bootstrap
6 6
7for handling OE cross-canadian builds. 7for handling OE cross-canadian builds.
@@ -14,24 +14,27 @@ Upstream-Status: Inappropriate [OE specific]
14 14
15Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com> 15Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
16Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io> 16Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
17
18Rebase to 1.23.4
19Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
17--- 20---
18 src/make.bash | 4 ++-- 21 src/make.bash | 4 ++--
19 1 file changed, 2 insertions(+), 2 deletions(-) 22 1 file changed, 2 insertions(+), 2 deletions(-)
20 23
21diff --git a/src/make.bash b/src/make.bash 24diff --git a/src/make.bash b/src/make.bash
22index 76ad51624a..074e129a24 100755 25index b67ae1529f..b59cdabd09 100755
23--- a/src/make.bash 26--- a/src/make.bash
24+++ b/src/make.bash 27+++ b/src/make.bash
25@@ -198,7 +198,7 @@ if [[ "$GOROOT_BOOTSTRAP" == "$GOROOT" ]]; then 28@@ -153,7 +153,7 @@ fi
26 exit 1 29 export GOROOT_BOOTSTRAP
27 fi 30
28 rm -f cmd/dist/dist 31 bootstrapenv() {
29-GOROOT="$GOROOT_BOOTSTRAP" nogoenv "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist 32- GOROOT="$GOROOT_BOOTSTRAP" GO111MODULE=off GOENV=off GOOS= GOARCH= GOEXPERIMENT= GOFLAGS= "$@"
30+CC="${BUILD_CC:-${CC}}" GOROOT="$GOROOT_BOOTSTRAP" nogoenv "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist 33+ CC="${BUILD_CC:-${CC}}" GOROOT="$GOROOT_BOOTSTRAP" GO111MODULE=off GOENV=off GOOS= GOARCH= GOEXPERIMENT= GOFLAGS= "$@"
34 }
31 35
32 # -e doesn't propagate out of eval, so check success by hand. 36 export GOROOT="$(cd .. && pwd)"
33 eval $(./cmd/dist/dist env -p || echo FAIL=true) 37@@ -216,7 +216,7 @@ fi
34@@ -223,7 +223,7 @@ fi
35 # Run dist bootstrap to complete make.bash. 38 # Run dist bootstrap to complete make.bash.
36 # Bootstrap installs a proper cmd/dist, built with the new toolchain. 39 # Bootstrap installs a proper cmd/dist, built with the new toolchain.
37 # Throw ours, built with the bootstrap toolchain, away after bootstrap. 40 # Throw ours, built with the bootstrap toolchain, away after bootstrap.
@@ -41,5 +44,5 @@ index 76ad51624a..074e129a24 100755
41 44
42 # DO NOT ADD ANY NEW CODE HERE. 45 # DO NOT ADD ANY NEW CODE HERE.
43-- 46--
442.44.0 472.25.1
45 48
diff --git a/meta/recipes-devtools/go/go/0005-cmd-dist-separate-host-and-target-builds.patch b/meta/recipes-devtools/go/go/0005-cmd-dist-separate-host-and-target-builds.patch
index 364fce907a..f7c3108a98 100644
--- a/meta/recipes-devtools/go/go/0005-cmd-dist-separate-host-and-target-builds.patch
+++ b/meta/recipes-devtools/go/go/0005-cmd-dist-separate-host-and-target-builds.patch
@@ -1,7 +1,7 @@
1From 6dda78d528e60993a4688cd9d49440a726378ac8 Mon Sep 17 00:00:00 2001 1From 12bf824f8b7e85f05434aa00e866e883a551aaeb Mon Sep 17 00:00:00 2001
2From: Alex Kube <alexander.j.kube@gmail.com> 2From: Alex Kube <alexander.j.kube@gmail.com>
3Date: Wed, 23 Oct 2019 21:18:12 +0430 3Date: Fri, 28 Feb 2025 19:09:17 -0800
4Subject: [PATCH 5/9] cmd/dist: separate host and target builds 4Subject: [PATCH 05/11] cmd/dist: separate host and target builds
5 5
6Change the dist tool to allow for OE-style cross- 6Change the dist tool to allow for OE-style cross-
7and cross-canadian builds: 7and cross-canadian builds:
@@ -40,23 +40,26 @@ Upstream-Status: Inappropriate [OE specific]
40 40
41Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com> 41Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
42Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io> 42Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
43
44Rebase to 1.24.0
45Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
43--- 46---
44 src/cmd/dist/build.go | 76 ++++++++++++++++++++++++++++++++++++++++++- 47 src/cmd/dist/build.go | 76 ++++++++++++++++++++++++++++++++++++++++++-
45 1 file changed, 75 insertions(+), 1 deletion(-) 48 1 file changed, 75 insertions(+), 1 deletion(-)
46 49
47diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go 50diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go
48index 06ee4de8a9..74b7c7098f 100644 51index b62e518030..0c54d82300 100644
49--- a/src/cmd/dist/build.go 52--- a/src/cmd/dist/build.go
50+++ b/src/cmd/dist/build.go 53+++ b/src/cmd/dist/build.go
51@@ -46,6 +46,7 @@ var ( 54@@ -49,6 +49,7 @@ var (
52 goexperiment string 55 gofips140 string
53 workdir string 56 workdir string
54 tooldir string 57 tooldir string
55+ build_tooldir string 58+ build_tooldir string
56 oldgoos string 59 oldgoos string
57 oldgoarch string 60 oldgoarch string
58 oldgocache string 61 oldgocache string
59@@ -58,6 +59,7 @@ var ( 62@@ -61,6 +62,7 @@ var (
60 rebuildall bool 63 rebuildall bool
61 noOpt bool 64 noOpt bool
62 isRelease bool 65 isRelease bool
@@ -64,7 +67,7 @@ index 06ee4de8a9..74b7c7098f 100644
64 67
65 vflag int // verbosity 68 vflag int // verbosity
66 ) 69 )
67@@ -265,6 +267,8 @@ func xinit() { 70@@ -286,6 +288,8 @@ func xinit() {
68 71
69 goversion := findgoversion() 72 goversion := findgoversion()
70 isRelease = strings.HasPrefix(goversion, "release.") || strings.HasPrefix(goversion, "go") 73 isRelease = strings.HasPrefix(goversion, "release.") || strings.HasPrefix(goversion, "go")
@@ -73,7 +76,7 @@ index 06ee4de8a9..74b7c7098f 100644
73 } 76 }
74 77
75 // compilerEnv returns a map from "goos/goarch" to the 78 // compilerEnv returns a map from "goos/goarch" to the
76@@ -499,8 +503,10 @@ func setup() { 79@@ -547,8 +551,10 @@ func setup() {
77 goosGoarch := pathf("%s/pkg/%s_%s", goroot, gohostos, gohostarch) 80 goosGoarch := pathf("%s/pkg/%s_%s", goroot, gohostos, gohostarch)
78 if rebuildall { 81 if rebuildall {
79 xremoveall(goosGoarch) 82 xremoveall(goosGoarch)
@@ -84,7 +87,7 @@ index 06ee4de8a9..74b7c7098f 100644
84 xatexit(func() { 87 xatexit(func() {
85 if files := xreaddir(goosGoarch); len(files) == 0 { 88 if files := xreaddir(goosGoarch); len(files) == 0 {
86 xremove(goosGoarch) 89 xremove(goosGoarch)
87@@ -1338,14 +1344,20 @@ func cmdbootstrap() { 90@@ -1411,14 +1417,20 @@ func cmdbootstrap() {
88 defer timelog("end", "dist bootstrap") 91 defer timelog("end", "dist bootstrap")
89 92
90 var debug, distpack, force, noBanner, noClean bool 93 var debug, distpack, force, noBanner, noClean bool
@@ -106,7 +109,7 @@ index 06ee4de8a9..74b7c7098f 100644
106 109
107 if noClean { 110 if noClean {
108 xprintf("warning: --no-clean is deprecated and has no effect; use 'go install std cmd' instead\n") 111 xprintf("warning: --no-clean is deprecated and has no effect; use 'go install std cmd' instead\n")
109@@ -1357,6 +1369,18 @@ func cmdbootstrap() { 112@@ -1430,6 +1442,18 @@ func cmdbootstrap() {
110 "Use the -force flag to build anyway.\n", goos, goarch) 113 "Use the -force flag to build anyway.\n", goos, goarch)
111 } 114 }
112 115
@@ -125,7 +128,7 @@ index 06ee4de8a9..74b7c7098f 100644
125 // Set GOPATH to an internal directory. We shouldn't actually 128 // Set GOPATH to an internal directory. We shouldn't actually
126 // need to store files here, since the toolchain won't 129 // need to store files here, since the toolchain won't
127 // depend on modules outside of vendor directories, but if 130 // depend on modules outside of vendor directories, but if
128@@ -1434,9 +1458,14 @@ func cmdbootstrap() { 131@@ -1513,9 +1537,14 @@ func cmdbootstrap() {
129 xprintf("\n") 132 xprintf("\n")
130 } 133 }
131 134
@@ -140,7 +143,7 @@ index 06ee4de8a9..74b7c7098f 100644
140 goBootstrap := pathf("%s/go_bootstrap", tooldir) 143 goBootstrap := pathf("%s/go_bootstrap", tooldir)
141 if debug { 144 if debug {
142 run("", ShowOutput|CheckExit, pathf("%s/compile", tooldir), "-V=full") 145 run("", ShowOutput|CheckExit, pathf("%s/compile", tooldir), "-V=full")
143@@ -1464,7 +1493,11 @@ func cmdbootstrap() { 146@@ -1543,7 +1572,11 @@ func cmdbootstrap() {
144 xprintf("\n") 147 xprintf("\n")
145 } 148 }
146 xprintf("Building Go toolchain2 using go_bootstrap and Go toolchain1.\n") 149 xprintf("Building Go toolchain2 using go_bootstrap and Go toolchain1.\n")
@@ -152,7 +155,7 @@ index 06ee4de8a9..74b7c7098f 100644
152 // Now that cmd/go is in charge of the build process, enable GOEXPERIMENT. 155 // Now that cmd/go is in charge of the build process, enable GOEXPERIMENT.
153 os.Setenv("GOEXPERIMENT", goexperiment) 156 os.Setenv("GOEXPERIMENT", goexperiment)
154 // No need to enable PGO for toolchain2. 157 // No need to enable PGO for toolchain2.
155@@ -1517,6 +1550,7 @@ func cmdbootstrap() { 158@@ -1596,6 +1629,7 @@ func cmdbootstrap() {
156 os.Setenv("GOCACHE", oldgocache) 159 os.Setenv("GOCACHE", oldgocache)
157 } 160 }
158 161
@@ -160,7 +163,7 @@ index 06ee4de8a9..74b7c7098f 100644
160 if goos == oldgoos && goarch == oldgoarch { 163 if goos == oldgoos && goarch == oldgoarch {
161 // Common case - not setting up for cross-compilation. 164 // Common case - not setting up for cross-compilation.
162 timelog("build", "toolchain") 165 timelog("build", "toolchain")
163@@ -1560,6 +1594,42 @@ func cmdbootstrap() { 166@@ -1639,6 +1673,42 @@ func cmdbootstrap() {
164 checkNotStale(toolenv(), goBootstrap, toolchain...) 167 checkNotStale(toolenv(), goBootstrap, toolchain...)
165 copyfile(pathf("%s/compile4", tooldir), pathf("%s/compile", tooldir), writeExec) 168 copyfile(pathf("%s/compile4", tooldir), pathf("%s/compile", tooldir), writeExec)
166 } 169 }
@@ -203,7 +206,7 @@ index 06ee4de8a9..74b7c7098f 100644
203 206
204 // Check that there are no new files in $GOROOT/bin other than 207 // Check that there are no new files in $GOROOT/bin other than
205 // go and gofmt and $GOOS_$GOARCH (target bin when cross-compiling). 208 // go and gofmt and $GOOS_$GOARCH (target bin when cross-compiling).
206@@ -1582,8 +1652,12 @@ func cmdbootstrap() { 209@@ -1661,8 +1731,12 @@ func cmdbootstrap() {
207 } 210 }
208 } 211 }
209 212
@@ -217,5 +220,5 @@ index 06ee4de8a9..74b7c7098f 100644
217 if goos == "android" { 220 if goos == "android" {
218 // Make sure the exec wrapper will sync a fresh $GOROOT to the device. 221 // Make sure the exec wrapper will sync a fresh $GOROOT to the device.
219-- 222--
2202.44.0 2232.25.1
221 224
diff --git a/meta/recipes-devtools/go/go/0006-cmd-go-make-GOROOT-precious-by-default.patch b/meta/recipes-devtools/go/go/0006-cmd-go-make-GOROOT-precious-by-default.patch
index 262f1e96b8..b29da334ec 100644
--- a/meta/recipes-devtools/go/go/0006-cmd-go-make-GOROOT-precious-by-default.patch
+++ b/meta/recipes-devtools/go/go/0006-cmd-go-make-GOROOT-precious-by-default.patch
@@ -1,7 +1,7 @@
1From aff5a740d6286c04beb0593fc68b0aea5a95ad39 Mon Sep 17 00:00:00 2001 1From ba3caa9f969bac2b937f8f1ffed4a3679cd16ec7 Mon Sep 17 00:00:00 2001
2From: Alex Kube <alexander.j.kube@gmail.com> 2From: Alex Kube <alexander.j.kube@gmail.com>
3Date: Wed, 23 Oct 2019 21:18:56 +0430 3Date: Wed, 23 Oct 2019 21:18:56 +0430
4Subject: [PATCH 6/9] cmd/go: make GOROOT precious by default 4Subject: [PATCH 06/11] cmd/go: make GOROOT precious by default
5 5
6The go build tool normally rebuilds whatever it detects is 6The go build tool normally rebuilds whatever it detects is
7stale. This can be a problem when GOROOT is intended to 7stale. This can be a problem when GOROOT is intended to
@@ -29,10 +29,10 @@ Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
29 3 files changed, 34 insertions(+) 29 3 files changed, 34 insertions(+)
30 30
31diff --git a/src/cmd/go/internal/work/action.go b/src/cmd/go/internal/work/action.go 31diff --git a/src/cmd/go/internal/work/action.go b/src/cmd/go/internal/work/action.go
32index a59072e591..9e35ebde0c 100644 32index 44bb9f8c1e..87ac4e30e5 100644
33--- a/src/cmd/go/internal/work/action.go 33--- a/src/cmd/go/internal/work/action.go
34+++ b/src/cmd/go/internal/work/action.go 34+++ b/src/cmd/go/internal/work/action.go
35@@ -754,6 +754,9 @@ func (b *Builder) addTransitiveLinkDeps(a, a1 *Action, shlib string) { 35@@ -837,6 +837,9 @@ func (b *Builder) addTransitiveLinkDeps(a, a1 *Action, shlib string) {
36 if p1 == nil || p1.Shlib == "" || haveShlib[filepath.Base(p1.Shlib)] { 36 if p1 == nil || p1.Shlib == "" || haveShlib[filepath.Base(p1.Shlib)] {
37 continue 37 continue
38 } 38 }
@@ -43,10 +43,10 @@ index a59072e591..9e35ebde0c 100644
43 // TODO(rsc): The use of ModeInstall here is suspect, but if we only do ModeBuild, 43 // TODO(rsc): The use of ModeInstall here is suspect, but if we only do ModeBuild,
44 // we'll end up building an overall library or executable that depends at runtime 44 // we'll end up building an overall library or executable that depends at runtime
45diff --git a/src/cmd/go/internal/work/build.go b/src/cmd/go/internal/work/build.go 45diff --git a/src/cmd/go/internal/work/build.go b/src/cmd/go/internal/work/build.go
46index 408edb5119..3d60252127 100644 46index 3508d51fbb..77f5e7241a 100644
47--- a/src/cmd/go/internal/work/build.go 47--- a/src/cmd/go/internal/work/build.go
48+++ b/src/cmd/go/internal/work/build.go 48+++ b/src/cmd/go/internal/work/build.go
49@@ -233,6 +233,8 @@ See also: go install, go get, go clean. 49@@ -238,6 +238,8 @@ See also: go install, go get, go clean.
50 50
51 const concurrentGCBackendCompilationEnabledByDefault = true 51 const concurrentGCBackendCompilationEnabledByDefault = true
52 52
@@ -55,7 +55,7 @@ index 408edb5119..3d60252127 100644
55 func init() { 55 func init() {
56 // break init cycle 56 // break init cycle
57 CmdBuild.Run = runBuild 57 CmdBuild.Run = runBuild
58@@ -246,6 +248,10 @@ func init() { 58@@ -251,6 +253,10 @@ func init() {
59 AddCoverFlags(CmdBuild, nil) 59 AddCoverFlags(CmdBuild, nil)
60 AddCoverFlags(CmdInstall, nil) 60 AddCoverFlags(CmdInstall, nil)
61 } 61 }
@@ -67,10 +67,10 @@ index 408edb5119..3d60252127 100644
67 67
68 // Note that flags consulted by other parts of the code 68 // Note that flags consulted by other parts of the code
69diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go 69diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go
70index 9724cd07d0..544df461a2 100644 70index 1f618be0bb..651fa64582 100644
71--- a/src/cmd/go/internal/work/exec.go 71--- a/src/cmd/go/internal/work/exec.go
72+++ b/src/cmd/go/internal/work/exec.go 72+++ b/src/cmd/go/internal/work/exec.go
73@@ -544,6 +544,23 @@ func (b *Builder) build(ctx context.Context, a *Action) (err error) { 73@@ -552,6 +552,23 @@ func (b *Builder) build(ctx context.Context, a *Action) (err error) {
74 return err 74 return err
75 } 75 }
76 76
@@ -94,7 +94,7 @@ index 9724cd07d0..544df461a2 100644
94 if err := sh.Mkdir(a.Objdir); err != nil { 94 if err := sh.Mkdir(a.Objdir); err != nil {
95 return err 95 return err
96 } 96 }
97@@ -1737,6 +1754,14 @@ func (b *Builder) linkShared(ctx context.Context, a *Action) (err error) { 97@@ -1747,6 +1764,14 @@ func (b *Builder) linkShared(ctx context.Context, a *Action) (err error) {
98 return err 98 return err
99 } 99 }
100 100
@@ -110,5 +110,5 @@ index 9724cd07d0..544df461a2 100644
110 return err 110 return err
111 } 111 }
112-- 112--
1132.44.0 1132.25.1
114 114
diff --git a/meta/recipes-devtools/go/go/0007-exec.go-filter-out-build-specific-paths-from-linker-.patch b/meta/recipes-devtools/go/go/0007-exec.go-filter-out-build-specific-paths-from-linker-.patch
index c5bf28f54a..9a701c7a6b 100644
--- a/meta/recipes-devtools/go/go/0007-exec.go-filter-out-build-specific-paths-from-linker-.patch
+++ b/meta/recipes-devtools/go/go/0007-exec.go-filter-out-build-specific-paths-from-linker-.patch
@@ -1,7 +1,8 @@
1From 083b5c74b12a1abeb11dd7f58a1cb1593d0000c0 Mon Sep 17 00:00:00 2001 1From 2197f813c9cff65eedef44473872ec5ea9ced227 Mon Sep 17 00:00:00 2001
2From: Changqing Li <changqing.li@windriver.com> 2From: Changqing Li <changqing.li@windriver.com>
3Date: Tue, 27 Feb 2024 18:06:51 +0800 3Date: Tue, 27 Feb 2024 18:06:51 +0800
4Subject: [PATCH] exec.go: filter out build-specific paths from linker flags 4Subject: [PATCH 07/11] exec.go: filter out build-specific paths from linker
5 flags
5 6
6The flags can contain build-specific paths, breaking reproducibility. 7The flags can contain build-specific paths, breaking reproducibility.
7Filter out options that have build-specific paths. 8Filter out options that have build-specific paths.
@@ -9,15 +10,16 @@ Filter out options that have build-specific paths.
9Upstream-Status: Inappropriate [ Not perfect for upstream ] 10Upstream-Status: Inappropriate [ Not perfect for upstream ]
10 11
11Signed-off-by: Changqing Li <changqing.li@windriver.com> 12Signed-off-by: Changqing Li <changqing.li@windriver.com>
13Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
12--- 14---
13 src/cmd/go/internal/work/exec.go | 25 ++++++++++++++++++++++++- 15 src/cmd/go/internal/work/exec.go | 25 ++++++++++++++++++++++++-
14 1 file changed, 24 insertions(+), 1 deletion(-) 16 1 file changed, 24 insertions(+), 1 deletion(-)
15 17
16diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go 18diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go
17index cde867b..e3ce17d 100644 19index 651fa64582..586079afb4 100644
18--- a/src/cmd/go/internal/work/exec.go 20--- a/src/cmd/go/internal/work/exec.go
19+++ b/src/cmd/go/internal/work/exec.go 21+++ b/src/cmd/go/internal/work/exec.go
20@@ -1358,6 +1358,29 @@ func (b *Builder) linkActionID(a *Action) cache.ActionID { 22@@ -1426,6 +1426,29 @@ func (b *Builder) linkActionID(a *Action) cache.ActionID {
21 return h.Sum() 23 return h.Sum()
22 } 24 }
23 25
@@ -47,7 +49,7 @@ index cde867b..e3ce17d 100644
47 // printLinkerConfig prints the linker config into the hash h, 49 // printLinkerConfig prints the linker config into the hash h,
48 // as part of the computation of a linker-related action ID. 50 // as part of the computation of a linker-related action ID.
49 func (b *Builder) printLinkerConfig(h io.Writer, p *load.Package) { 51 func (b *Builder) printLinkerConfig(h io.Writer, p *load.Package) {
50@@ -1368,7 +1391,7 @@ func (b *Builder) printLinkerConfig(h io.Writer, p *load.Package) { 52@@ -1436,7 +1459,7 @@ func (b *Builder) printLinkerConfig(h io.Writer, p *load.Package) {
51 case "gc": 53 case "gc":
52 fmt.Fprintf(h, "link %s %q %s\n", b.toolID("link"), forcedLdflags, ldBuildmode) 54 fmt.Fprintf(h, "link %s %q %s\n", b.toolID("link"), forcedLdflags, ldBuildmode)
53 if p != nil { 55 if p != nil {
diff --git a/meta/recipes-devtools/go/go/0008-src-cmd-dist-buildgo.go-do-not-hardcode-host-compile.patch b/meta/recipes-devtools/go/go/0008-src-cmd-dist-buildgo.go-do-not-hardcode-host-compile.patch
index 0662f66af5..a9cb2a4b84 100644
--- a/meta/recipes-devtools/go/go/0008-src-cmd-dist-buildgo.go-do-not-hardcode-host-compile.patch
+++ b/meta/recipes-devtools/go/go/0008-src-cmd-dist-buildgo.go-do-not-hardcode-host-compile.patch
@@ -1,7 +1,7 @@
1From e0999902687e2e394499f7153db8d62440c4dab0 Mon Sep 17 00:00:00 2001 1From e5752b239707df8ad7a72dc60420e01c5912d606 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com> 2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Tue, 10 Nov 2020 16:33:27 +0000 3Date: Tue, 10 Nov 2020 16:33:27 +0000
4Subject: [PATCH 8/9] src/cmd/dist/buildgo.go: do not hardcode host compilers 4Subject: [PATCH 08/11] src/cmd/dist/buildgo.go: do not hardcode host compilers
5 into target binaries 5 into target binaries
6 6
7These come from $CC/$CXX on the build host and are not useful on targets; 7These come from $CC/$CXX on the build host and are not useful on targets;
@@ -42,5 +42,5 @@ index 884e9d729a..2f52edacfe 100644
42 } 42 }
43 43
44-- 44--
452.44.0 452.25.1
46 46
diff --git a/meta/recipes-devtools/go/go/0009-go-Filter-build-paths-on-staticly-linked-arches.patch b/meta/recipes-devtools/go/go/0009-go-Filter-build-paths-on-staticly-linked-arches.patch
index cc45496e9c..d47c4b1d31 100644
--- a/meta/recipes-devtools/go/go/0009-go-Filter-build-paths-on-staticly-linked-arches.patch
+++ b/meta/recipes-devtools/go/go/0009-go-Filter-build-paths-on-staticly-linked-arches.patch
@@ -1,7 +1,7 @@
1From 6c2438f187ca912c54a71b4ac65ab98999a019d2 Mon Sep 17 00:00:00 2001 1From 79a1c80ed43f2a541bcab665656a4e2bb87baab3 Mon Sep 17 00:00:00 2001
2From: Richard Purdie <richard.purdie@linuxfoundation.org> 2From: Richard Purdie <richard.purdie@linuxfoundation.org>
3Date: Sat, 2 Jul 2022 23:08:13 +0100 3Date: Sat, 2 Jul 2022 23:08:13 +0100
4Subject: [PATCH 9/9] go: Filter build paths on staticly linked arches 4Subject: [PATCH 09/11] go: Filter build paths on staticly linked arches
5 5
6Filter out build time paths from ldflags and other flags variables when they're 6Filter out build time paths from ldflags and other flags variables when they're
7embedded in the go binary so that builds are reproducible regardless of build 7embedded in the go binary so that builds are reproducible regardless of build
@@ -17,10 +17,10 @@ Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
17 1 file changed, 13 insertions(+), 2 deletions(-) 17 1 file changed, 13 insertions(+), 2 deletions(-)
18 18
19diff --git a/src/cmd/go/internal/load/pkg.go b/src/cmd/go/internal/load/pkg.go 19diff --git a/src/cmd/go/internal/load/pkg.go b/src/cmd/go/internal/load/pkg.go
20index 1549800afb..f41fb2c4ef 100644 20index 15f6b2e87b..47c5b865a1 100644
21--- a/src/cmd/go/internal/load/pkg.go 21--- a/src/cmd/go/internal/load/pkg.go
22+++ b/src/cmd/go/internal/load/pkg.go 22+++ b/src/cmd/go/internal/load/pkg.go
23@@ -2277,6 +2277,17 @@ func appendBuildSetting(info *debug.BuildInfo, key, value string) { 23@@ -2291,6 +2291,17 @@ func appendBuildSetting(info *debug.BuildInfo, key, value string) {
24 info.Settings = append(info.Settings, debug.BuildSetting{Key: key, Value: value}) 24 info.Settings = append(info.Settings, debug.BuildSetting{Key: key, Value: value})
25 } 25 }
26 26
@@ -38,7 +38,7 @@ index 1549800afb..f41fb2c4ef 100644
38 // setBuildInfo gathers build information and sets it into 38 // setBuildInfo gathers build information and sets it into
39 // p.Internal.BuildInfo, which will later be formatted as a string and embedded 39 // p.Internal.BuildInfo, which will later be formatted as a string and embedded
40 // in the binary. setBuildInfo should only be called on a main package with no 40 // in the binary. setBuildInfo should only be called on a main package with no
41@@ -2384,7 +2395,7 @@ func (p *Package) setBuildInfo(ctx context.Context, autoVCS bool) { 41@@ -2398,7 +2409,7 @@ func (p *Package) setBuildInfo(ctx context.Context, autoVCS bool) {
42 if gcflags := BuildGcflags.String(); gcflags != "" && cfg.BuildContext.Compiler == "gc" { 42 if gcflags := BuildGcflags.String(); gcflags != "" && cfg.BuildContext.Compiler == "gc" {
43 appendSetting("-gcflags", gcflags) 43 appendSetting("-gcflags", gcflags)
44 } 44 }
@@ -47,7 +47,7 @@ index 1549800afb..f41fb2c4ef 100644
47 // https://go.dev/issue/52372: only include ldflags if -trimpath is not set, 47 // https://go.dev/issue/52372: only include ldflags if -trimpath is not set,
48 // since it can include system paths through various linker flags (notably 48 // since it can include system paths through various linker flags (notably
49 // -extar, -extld, and -extldflags). 49 // -extar, -extld, and -extldflags).
50@@ -2427,7 +2438,7 @@ func (p *Package) setBuildInfo(ctx context.Context, autoVCS bool) { 50@@ -2444,7 +2455,7 @@ func (p *Package) setBuildInfo(ctx context.Context, autoVCS bool) {
51 // subset of flags that are known not to be paths? 51 // subset of flags that are known not to be paths?
52 if cfg.BuildContext.CgoEnabled && !cfg.BuildTrimpath { 52 if cfg.BuildContext.CgoEnabled && !cfg.BuildTrimpath {
53 for _, name := range []string{"CGO_CFLAGS", "CGO_CPPFLAGS", "CGO_CXXFLAGS", "CGO_LDFLAGS"} { 53 for _, name := range []string{"CGO_CFLAGS", "CGO_CPPFLAGS", "CGO_CXXFLAGS", "CGO_LDFLAGS"} {
@@ -57,5 +57,5 @@ index 1549800afb..f41fb2c4ef 100644
57 } 57 }
58 appendSetting("GOARCH", cfg.BuildContext.GOARCH) 58 appendSetting("GOARCH", cfg.BuildContext.GOARCH)
59-- 59--
602.44.0 602.25.1
61 61
diff --git a/meta/recipes-devtools/go/go/0010-cmd-go-clear-GOROOT-for-func-ldShared-when-trimpath-.patch b/meta/recipes-devtools/go/go/0010-cmd-go-clear-GOROOT-for-func-ldShared-when-trimpath-.patch
new file mode 100644
index 0000000000..2c2f0cbfb5
--- /dev/null
+++ b/meta/recipes-devtools/go/go/0010-cmd-go-clear-GOROOT-for-func-ldShared-when-trimpath-.patch
@@ -0,0 +1,51 @@
1From c4215b5ca69a7626d97cf9b7ebc460c2b5b9148b Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Fri, 28 Feb 2025 19:13:18 -0800
4Subject: [PATCH 10/11] cmd/go: clear GOROOT for func ldShared when -trimpath
5 is used
6
7In commit [cmd: remove support for GOROOT_FINAL][1], it clear GOROOT
8for func ld when -trimpath is used. [2]
9
10This commit do the same thing for func ldShared, otherwise run go_bootstrap
11with -trimpath does not remove build path directory from the generated share
12libarary
13
14 $ ./make.bash --target-only --no-banner std
15 $ go_bootstrap install -linkshared -buildmode=shared -trimpath std
16 $ grep "$(pwd)" ./pkg/linux_amd64_dynlink/libstd.so
17 Binary file ./pkg/linux_amd64_dynlink/libstd.so matches
18
19[1] https://github.com/golang/go/commit/507d1b22f4b58ac68841582d0c2c0ab6b20e5a98
20[2] https://github.com/golang/go/commit/507d1b22f4b58ac68841582d0c2c0ab6b20e5a98#diff-cab5921f94f2667bb0bc1b935d2d46b4c03541b4351b33438ab7290b94dea212R669
21
22Upstream-Status: Submitted [https://go-review.googlesource.com/c/go/+/653895]
23
24Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
25---
26 src/cmd/go/internal/work/gc.go | 9 ++++++++-
27 1 file changed, 8 insertions(+), 1 deletion(-)
28
29diff --git a/src/cmd/go/internal/work/gc.go b/src/cmd/go/internal/work/gc.go
30index 3a173efee8..8b7a44e031 100644
31--- a/src/cmd/go/internal/work/gc.go
32+++ b/src/cmd/go/internal/work/gc.go
33@@ -728,7 +728,14 @@ func (gcToolchain) ldShared(b *Builder, root *Action, toplevelactions []*Action,
34 // the output file path is recorded in the .gnu.version_d section.
35 dir, targetPath := filepath.Split(targetPath)
36
37- return b.Shell(root).run(dir, targetPath, nil, cfg.BuildToolexec, base.Tool("link"), "-o", targetPath, "-importcfg", importcfg, ldflags)
38+ env := []string{}
39+ // When -trimpath is used, GOROOT is cleared
40+ if cfg.BuildTrimpath {
41+ env = append(env, "GOROOT=")
42+ } else {
43+ env = append(env, "GOROOT="+cfg.GOROOT)
44+ }
45+ return b.Shell(root).run(dir, targetPath, env, cfg.BuildToolexec, base.Tool("link"), "-o", targetPath, "-importcfg", importcfg, ldflags)
46 }
47
48 func (gcToolchain) cc(b *Builder, a *Action, ofile, cfile string) error {
49--
502.25.1
51
diff --git a/meta/recipes-devtools/go/go/6d265b008e3d106b2706645e5a88cd8e2fb98953.patch b/meta/recipes-devtools/go/go/6d265b008e3d106b2706645e5a88cd8e2fb98953.patch
new file mode 100644
index 0000000000..58bd00fc73
--- /dev/null
+++ b/meta/recipes-devtools/go/go/6d265b008e3d106b2706645e5a88cd8e2fb98953.patch
@@ -0,0 +1,54 @@
1From 6d265b008e3d106b2706645e5a88cd8e2fb98953 Mon Sep 17 00:00:00 2001
2From: Dirk Müller <dirk@dmllr.de>
3Date: Wed, 09 Mar 2022 17:47:23 +0100
4Subject: [PATCH] cmd/link: stop forcing binutils-gold dependency on aarch64
5
6The bfd linker appears to be working just fine at least in version
72.41 or above. Reject the known broken one instead, which
8avoids an architecture specific linker dependency that
9is cumbersome for distributions.
10
11Fixes #22040.
12
13Change-Id: I9f377e47c22ef20497479c0978c053ed5de46a38
14
15Upstream-Status: Submitted [https://go-review.googlesource.com/c/go/+/391115]
16---
17 src/cmd/link/internal/ld/lib.go | 21 ---------------------
18 1 file changed, 21 deletions(-)
19
20diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go
21index dfc72e02c0..2a2a304113 100644
22--- a/src/cmd/link/internal/ld/lib.go
23+++ b/src/cmd/link/internal/ld/lib.go
24@@ -1673,27 +1673,6 @@ func (ctxt *Link) hostlink() {
25 // Use lld to avoid errors from default linker (issue #38838)
26 altLinker = "lld"
27 }
28-
29- if ctxt.Arch.InFamily(sys.ARM64) && buildcfg.GOOS == "linux" {
30- // On ARM64, the GNU linker will fail with
31- // -znocopyreloc if it thinks a COPY relocation is
32- // required. Switch to gold.
33- // https://sourceware.org/bugzilla/show_bug.cgi?id=19962
34- // https://go.dev/issue/22040
35- altLinker = "gold"
36-
37- // If gold is not installed, gcc will silently switch
38- // back to ld.bfd. So we parse the version information
39- // and provide a useful error if gold is missing.
40- name, args := flagExtld[0], flagExtld[1:]
41- args = append(args, "-fuse-ld=gold", "-Wl,--version")
42- cmd := exec.Command(name, args...)
43- if out, err := cmd.CombinedOutput(); err == nil {
44- if !bytes.Contains(out, []byte("GNU gold")) {
45- log.Fatalf("ARM64 external linker must be gold (issue #15696, 22040), but is not: %s", out)
46- }
47- }
48- }
49 }
50 if ctxt.Arch.Family == sys.ARM64 && buildcfg.GOOS == "freebsd" {
51 // Switch to ld.bfd on freebsd/arm64.
52--
532.25.1
54
diff --git a/meta/recipes-devtools/go/go_1.22.2.bb b/meta/recipes-devtools/go/go_1.24.4.bb
index 46f5fbc6be..46f5fbc6be 100644
--- a/meta/recipes-devtools/go/go_1.22.2.bb
+++ b/meta/recipes-devtools/go/go_1.24.4.bb