summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/conf/distro/include/tcmode-default.inc2
-rw-r--r--meta/recipes-devtools/go/go-1.21.0.inc (renamed from meta/recipes-devtools/go/go-1.20.7.inc)2
-rw-r--r--meta/recipes-devtools/go/go-binary-native_1.21.0.bb (renamed from meta/recipes-devtools/go/go-binary-native_1.20.7.bb)6
-rw-r--r--meta/recipes-devtools/go/go-common.inc5
-rw-r--r--meta/recipes-devtools/go/go-cross-canadian_1.21.0.bb (renamed from meta/recipes-devtools/go/go-cross-canadian_1.20.7.bb)0
-rw-r--r--meta/recipes-devtools/go/go-cross_1.21.0.bb (renamed from meta/recipes-devtools/go/go-cross_1.20.7.bb)0
-rw-r--r--meta/recipes-devtools/go/go-crosssdk_1.21.0.bb (renamed from meta/recipes-devtools/go/go-crosssdk_1.20.7.bb)0
-rw-r--r--meta/recipes-devtools/go/go-native_1.21.0.bb (renamed from meta/recipes-devtools/go/go-native_1.20.7.bb)0
-rw-r--r--meta/recipes-devtools/go/go-runtime_1.21.0.bb (renamed from meta/recipes-devtools/go/go-runtime_1.20.7.bb)0
-rw-r--r--meta/recipes-devtools/go/go/0001-cmd-go-make-content-based-hash-generation-less-pedan.patch33
-rw-r--r--meta/recipes-devtools/go/go/0002-cmd-go-Allow-GOTOOLDIR-to-be-overridden-in-the-envir.patch15
-rw-r--r--meta/recipes-devtools/go/go/0003-ld-add-soname-to-shareable-objects.patch11
-rw-r--r--meta/recipes-devtools/go/go/0004-make.bash-override-CC-when-building-dist-and-go_boot.patch13
-rw-r--r--meta/recipes-devtools/go/go/0005-cmd-dist-separate-host-and-target-builds.patch137
-rw-r--r--meta/recipes-devtools/go/go/0006-cmd-go-make-GOROOT-precious-by-default.patch21
-rw-r--r--meta/recipes-devtools/go/go/0007-exec.go-do-not-write-linker-flags-into-buildids.patch9
-rw-r--r--meta/recipes-devtools/go/go/0008-src-cmd-dist-buildgo.go-do-not-hardcode-host-compile.patch9
-rw-r--r--meta/recipes-devtools/go/go/0009-go-Filter-build-paths-on-staticly-linked-arches.patch21
-rw-r--r--meta/recipes-devtools/go/go_1.21.0.bb (renamed from meta/recipes-devtools/go/go_1.20.7.bb)0
19 files changed, 121 insertions, 163 deletions
diff --git a/meta/conf/distro/include/tcmode-default.inc b/meta/conf/distro/include/tcmode-default.inc
index 1c4a22aef00..5d3065be0c5 100644
--- a/meta/conf/distro/include/tcmode-default.inc
+++ b/meta/conf/distro/include/tcmode-default.inc
@@ -23,7 +23,7 @@ GDBVERSION ?= "13.%"
GLIBCVERSION ?= "2.37"
LINUXLIBCVERSION ?= "6.4%"
QEMUVERSION ?= "8.0%"
-GOVERSION ?= "1.20%"
+GOVERSION ?= "1.21%"
LLVMVERSION ?= "16.%"
RUSTVERSION ?= "1.70%"
diff --git a/meta/recipes-devtools/go/go-1.20.7.inc b/meta/recipes-devtools/go/go-1.21.0.inc
index f7974367ccf..2933793b8bc 100644
--- a/meta/recipes-devtools/go/go-1.20.7.inc
+++ b/meta/recipes-devtools/go/go-1.21.0.inc
@@ -15,4 +15,4 @@ SRC_URI += "\
file://0008-src-cmd-dist-buildgo.go-do-not-hardcode-host-compile.patch \
file://0009-go-Filter-build-paths-on-staticly-linked-arches.patch \
"
-SRC_URI[main.sha256sum] = "2c5ee9c9ec1e733b0dbbc2bdfed3f62306e51d8172bf38f4f4e542b27520f597"
+SRC_URI[main.sha256sum] = "818d46ede85682dd551ad378ef37a4d247006f12ec59b5b755601d2ce114369a"
diff --git a/meta/recipes-devtools/go/go-binary-native_1.20.7.bb b/meta/recipes-devtools/go/go-binary-native_1.21.0.bb
index 3decde19549..0b8086e7b9f 100644
--- a/meta/recipes-devtools/go/go-binary-native_1.20.7.bb
+++ b/meta/recipes-devtools/go/go-binary-native_1.21.0.bb
@@ -9,9 +9,9 @@ PROVIDES = "go-native"
# Checksums available at https://go.dev/dl/
SRC_URI = "https://dl.google.com/go/go${PV}.${BUILD_GOOS}-${BUILD_GOARCH}.tar.gz;name=go_${BUILD_GOTUPLE}"
-SRC_URI[go_linux_amd64.sha256sum] = "f0a87f1bcae91c4b69f8dc2bc6d7e6bfcd7524fceec130af525058c0c17b1b44"
-SRC_URI[go_linux_arm64.sha256sum] = "44781ae3b153c3b07651d93b6bc554e835a36e2d72a696281c1e4dad9efffe43"
-SRC_URI[go_linux_ppc64le.sha256sum] = "6318a1db307c12b8afe68808bd6fae4fba1e558a85b958216096869ed506dcb3"
+SRC_URI[go_linux_amd64.sha256sum] = "d0398903a16ba2232b389fb31032ddf57cac34efda306a0eebac34f0965a0742"
+SRC_URI[go_linux_arm64.sha256sum] = "f3d4548edf9b22f26bbd49720350bbfe59d75b7090a1a2bff1afad8214febaf3"
+SRC_URI[go_linux_ppc64le.sha256sum] = "e938ffc81d8ebe5efc179240960ba22da6a841ff05d5cab7ce2547112b14a47f"
UPSTREAM_CHECK_URI = "https://golang.org/dl/"
UPSTREAM_CHECK_REGEX = "go(?P<pver>\d+(\.\d+)+)\.linux"
diff --git a/meta/recipes-devtools/go/go-common.inc b/meta/recipes-devtools/go/go-common.inc
index 96e32eeb978..63fb9f32426 100644
--- a/meta/recipes-devtools/go/go-common.inc
+++ b/meta/recipes-devtools/go/go-common.inc
@@ -9,12 +9,11 @@ DESCRIPTION = " The Go programming language is an open source project to make \
fast, statically typed, compiled language that feels like a\
dynamically typed, interpreted language."
-HOMEPAGE = " http://golang.org/"
+HOMEPAGE = "https://go.dev/"
LICENSE = "BSD-3-Clause"
inherit goarch
-
-SRC_URI = "https://golang.org/dl/go${PV}.src.tar.gz;name=main"
+SRC_URI = "https://go.dev/dl/go${PV}.src.tar.gz;name=main"
S = "${WORKDIR}/go"
B = "${S}"
UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)\.src\.tar"
diff --git a/meta/recipes-devtools/go/go-cross-canadian_1.20.7.bb b/meta/recipes-devtools/go/go-cross-canadian_1.21.0.bb
index 7ac9449e476..7ac9449e476 100644
--- a/meta/recipes-devtools/go/go-cross-canadian_1.20.7.bb
+++ b/meta/recipes-devtools/go/go-cross-canadian_1.21.0.bb
diff --git a/meta/recipes-devtools/go/go-cross_1.20.7.bb b/meta/recipes-devtools/go/go-cross_1.21.0.bb
index 80b5a03f6ca..80b5a03f6ca 100644
--- a/meta/recipes-devtools/go/go-cross_1.20.7.bb
+++ b/meta/recipes-devtools/go/go-cross_1.21.0.bb
diff --git a/meta/recipes-devtools/go/go-crosssdk_1.20.7.bb b/meta/recipes-devtools/go/go-crosssdk_1.21.0.bb
index 1857c8a5772..1857c8a5772 100644
--- a/meta/recipes-devtools/go/go-crosssdk_1.20.7.bb
+++ b/meta/recipes-devtools/go/go-crosssdk_1.21.0.bb
diff --git a/meta/recipes-devtools/go/go-native_1.20.7.bb b/meta/recipes-devtools/go/go-native_1.21.0.bb
index ddf25b2c9ba..ddf25b2c9ba 100644
--- a/meta/recipes-devtools/go/go-native_1.20.7.bb
+++ b/meta/recipes-devtools/go/go-native_1.21.0.bb
diff --git a/meta/recipes-devtools/go/go-runtime_1.20.7.bb b/meta/recipes-devtools/go/go-runtime_1.21.0.bb
index 63464a15014..63464a15014 100644
--- a/meta/recipes-devtools/go/go-runtime_1.20.7.bb
+++ b/meta/recipes-devtools/go/go-runtime_1.21.0.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 56487e34e3a..94f4f2c3f36 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
@@ -30,11 +30,9 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
src/cmd/go/internal/work/exec.go | 44 ++++++++++++++++++++++++-------
2 files changed, 36 insertions(+), 10 deletions(-)
-diff --git a/src/cmd/go/internal/envcmd/env.go b/src/cmd/go/internal/envcmd/env.go
-index 66ef5ce..fb7448a 100644
--- a/src/cmd/go/internal/envcmd/env.go
+++ b/src/cmd/go/internal/envcmd/env.go
-@@ -183,7 +183,7 @@ func ExtraEnvVarsCostly() []cfg.EnvVar {
+@@ -189,7 +189,7 @@ func ExtraEnvVarsCostly() []cfg.EnvVar {
}
}()
@@ -43,11 +41,9 @@ index 66ef5ce..fb7448a 100644
if err != nil {
// Should not happen - b.CFlags was given an empty package.
fmt.Fprintf(os.Stderr, "go: invalid cflags: %v\n", err)
-diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go
-index d6fa847..7e4fcb3 100644
--- a/src/cmd/go/internal/work/exec.go
+++ b/src/cmd/go/internal/work/exec.go
-@@ -223,6 +223,8 @@ func (b *Builder) Do(ctx context.Context, root *Action) {
+@@ -231,6 +231,8 @@ func (b *Builder) Do(ctx context.Context
writeActionGraph()
}
@@ -56,7 +52,7 @@ index d6fa847..7e4fcb3 100644
// buildActionID computes the action ID for a build action.
func (b *Builder) buildActionID(a *Action) cache.ActionID {
p := a.Package
-@@ -244,7 +246,7 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
+@@ -252,7 +254,7 @@ func (b *Builder) buildActionID(a *Actio
if p.Module != nil {
fmt.Fprintf(h, "module %s@%s\n", p.Module.Path, p.Module.Version)
}
@@ -65,7 +61,7 @@ index d6fa847..7e4fcb3 100644
// The Go compiler always hides the exact value of $GOROOT
// when building things in GOROOT.
//
-@@ -276,9 +278,9 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
+@@ -284,9 +286,9 @@ func (b *Builder) buildActionID(a *Actio
}
if len(p.CgoFiles)+len(p.SwigFiles)+len(p.SwigCXXFiles) > 0 {
fmt.Fprintf(h, "cgo %q\n", b.toolID("cgo"))
@@ -77,7 +73,7 @@ index d6fa847..7e4fcb3 100644
fmt.Fprintf(h, "CC=%q %q %q %q\n", ccExe, cppflags, cflags, ldflags)
// Include the C compiler tool ID so that if the C
// compiler changes we rebuild the package.
-@@ -286,14 +288,14 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
+@@ -294,14 +296,14 @@ func (b *Builder) buildActionID(a *Actio
fmt.Fprintf(h, "CC ID=%q\n", ccID)
}
if len(p.CXXFiles)+len(p.SwigCXXFiles) > 0 {
@@ -94,16 +90,16 @@ index d6fa847..7e4fcb3 100644
fmt.Fprintf(h, "FC=%q %q\n", fcExe, fflags)
if fcID, _, err := b.gccToolID(fcExe[0], "f95"); err == nil {
fmt.Fprintf(h, "FC ID=%q\n", fcID)
-@@ -310,7 +312,7 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
+@@ -318,7 +320,7 @@ func (b *Builder) buildActionID(a *Actio
}
}
- if p.Internal.BuildInfo != "" {
-- fmt.Fprintf(h, "modinfo %q\n", p.Internal.BuildInfo)
-+ //fmt.Fprintf(h, "modinfo %q\n", p.Internal.BuildInfo)
+ if p.Internal.BuildInfo != nil {
+- fmt.Fprintf(h, "modinfo %q\n", p.Internal.BuildInfo.String())
++ //fmt.Fprintf(h, "modinfo %q\n", p.Internal.BuildInfo.String())
}
// Configuration specific to compiler toolchain.
-@@ -2970,8 +2972,25 @@ func envList(key, def string) []string {
+@@ -3137,8 +3139,25 @@ func envList(key, def string) []string {
return args
}
@@ -130,7 +126,7 @@ index d6fa847..7e4fcb3 100644
if cppflags, err = buildFlags("CPPFLAGS", "", p.CgoCPPFLAGS, checkCompilerFlags); err != nil {
return
}
-@@ -2987,6 +3006,13 @@ func (b *Builder) CFlags(p *load.Package) (cppflags, cflags, cxxflags, fflags, l
+@@ -3154,6 +3173,13 @@ func (b *Builder) CFlags(p *load.Package
if ldflags, err = buildFlags("LDFLAGS", defaultCFlags, p.CgoLDFLAGS, checkLinkerFlags); err != nil {
return
}
@@ -144,7 +140,7 @@ index d6fa847..7e4fcb3 100644
return
}
-@@ -3002,7 +3028,7 @@ var cgoRe = lazyregexp.New(`[/\\:]`)
+@@ -3169,7 +3195,7 @@ var cgoRe = lazyregexp.New(`[/\\:]`)
func (b *Builder) cgo(a *Action, cgoExe, objdir string, pcCFLAGS, pcLDFLAGS, cgofiles, gccfiles, gxxfiles, mfiles, ffiles []string) (outGo, outObj []string, err error) {
p := a.Package
@@ -153,7 +149,7 @@ index d6fa847..7e4fcb3 100644
if err != nil {
return nil, nil, err
}
-@@ -3510,7 +3536,7 @@ func (b *Builder) swigIntSize(objdir string) (intsize string, err error) {
+@@ -3725,7 +3751,7 @@ func (b *Builder) swigIntSize(objdir str
// Run SWIG on one SWIG input file.
func (b *Builder) swigOne(a *Action, p *load.Package, file, objdir string, pcCFLAGS []string, cxx bool, intgosize string) (outGo, outC string, err error) {
@@ -162,6 +158,3 @@ index d6fa847..7e4fcb3 100644
if err != nil {
return "", "", err
}
---
-2.30.2
-
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 6abd424733e..0e2a74d1b70 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
@@ -18,11 +18,9 @@ Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
src/cmd/go/internal/cfg/cfg.go | 6 +++++-
2 files changed, 8 insertions(+), 2 deletions(-)
-diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go
-index c36a12e..5d31718 100644
--- a/src/cmd/dist/build.go
+++ b/src/cmd/dist/build.go
-@@ -264,7 +264,9 @@ func xinit() {
+@@ -259,7 +259,9 @@ func xinit() {
}
xatexit(rmworkdir)
@@ -30,14 +28,12 @@ index c36a12e..5d31718 100644
+ if tooldir = os.Getenv("GOTOOLDIR"); tooldir == "" {
+ tooldir = pathf("%s/pkg/tool/%s_%s", goroot, gohostos, gohostarch)
+ }
- }
- // compilerEnv returns a map from "goos/goarch" to the
-diff --git a/src/cmd/go/internal/cfg/cfg.go b/src/cmd/go/internal/cfg/cfg.go
-index 3257140..bb46253 100644
+ goversion := findgoversion()
+ isRelease = strings.HasPrefix(goversion, "release.") || strings.HasPrefix(goversion, "go")
--- a/src/cmd/go/internal/cfg/cfg.go
+++ b/src/cmd/go/internal/cfg/cfg.go
-@@ -229,7 +229,11 @@ func SetGOROOT(goroot string, isTestGo bool) {
+@@ -231,7 +231,11 @@ func SetGOROOT(goroot string, isTestGo b
// This matches the initialization of ToolDir in go/build, except for
// using ctxt.GOROOT and the installed GOOS and GOARCH rather than the
// GOROOT, GOOS, and GOARCH reported by the runtime package.
@@ -50,6 +46,3 @@ index 3257140..bb46253 100644
}
}
}
---
-2.30.2
-
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 2bc7d194bb2..97e674017d6 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
@@ -17,11 +17,9 @@ Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
src/cmd/link/internal/ld/lib.go | 3 +++
1 file changed, 3 insertions(+)
-diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go
-index c073017..e60d39a 100644
--- a/src/cmd/link/internal/ld/lib.go
+++ b/src/cmd/link/internal/ld/lib.go
-@@ -1491,6 +1491,7 @@ func (ctxt *Link) hostlink() {
+@@ -1554,6 +1554,7 @@ func (ctxt *Link) hostlink() {
argv = append(argv, "-Wl,-z,relro")
}
argv = append(argv, "-shared")
@@ -29,7 +27,7 @@ index c073017..e60d39a 100644
if ctxt.HeadType == objabi.Hwindows {
argv = addASLRargs(argv, *flagAslr)
} else {
-@@ -1506,6 +1507,7 @@ func (ctxt *Link) hostlink() {
+@@ -1569,6 +1570,7 @@ func (ctxt *Link) hostlink() {
argv = append(argv, "-Wl,-z,relro")
}
argv = append(argv, "-shared")
@@ -37,7 +35,7 @@ index c073017..e60d39a 100644
case BuildModePlugin:
if ctxt.HeadType == objabi.Hdarwin {
argv = append(argv, "-dynamiclib")
-@@ -1514,6 +1516,7 @@ func (ctxt *Link) hostlink() {
+@@ -1577,6 +1579,7 @@ func (ctxt *Link) hostlink() {
argv = append(argv, "-Wl,-z,relro")
}
argv = append(argv, "-shared")
@@ -45,6 +43,3 @@ index c073017..e60d39a 100644
}
}
---
-2.30.2
-
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 85e42f7660f..7f209783ca4 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
@@ -17,20 +17,18 @@ Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
src/make.bash | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
-diff --git a/src/make.bash b/src/make.bash
-index c07f39b..6ca7242 100755
--- a/src/make.bash
+++ b/src/make.bash
-@@ -194,7 +194,7 @@ if [ "$GOROOT_BOOTSTRAP" = "$GOROOT" ]; then
+@@ -198,7 +198,7 @@ if [ "$GOROOT_BOOTSTRAP" = "$GOROOT" ];
exit 1
fi
rm -f cmd/dist/dist
--GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" GO111MODULE=off GOEXPERIMENT="" GOENV=off GOFLAGS="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist
-+CC="${BUILD_CC:-${CC}}" GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" GO111MODULE=off GOEXPERIMENT="" GOENV=off GOFLAGS="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist
+-GOROOT="$GOROOT_BOOTSTRAP" nogoenv "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist
++CC="${BUILD_CC:-${CC}}" GOROOT="$GOROOT_BOOTSTRAP" nogoenv "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist
# -e doesn't propagate out of eval, so check success by hand.
eval $(./cmd/dist/dist env -p || echo FAIL=true)
-@@ -219,7 +219,7 @@ fi
+@@ -223,7 +223,7 @@ fi
# Run dist bootstrap to complete make.bash.
# Bootstrap installs a proper cmd/dist, built with the new toolchain.
# Throw ours, built with the bootstrap toolchain, away after bootstrap.
@@ -39,6 +37,3 @@ index c07f39b..6ca7242 100755
rm -f ./cmd/dist/dist
# DO NOT ADD ANY NEW CODE HERE.
---
-2.30.2
-
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 29598449da5..40945ea8500 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
@@ -38,56 +38,64 @@ Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
src/cmd/dist/build.go | 152 +++++++++++++++++++++++++++++++-----------
1 file changed, 113 insertions(+), 39 deletions(-)
-diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go
-index 5d31718..1c7f308 100644
--- a/src/cmd/dist/build.go
+++ b/src/cmd/dist/build.go
-@@ -44,6 +44,7 @@ var (
+@@ -46,6 +46,7 @@ var (
goexperiment string
workdir string
tooldir string
+ build_tooldir string
oldgoos string
oldgoarch string
- exe string
-@@ -55,6 +56,7 @@ var (
- rebuildall bool
- defaultclang bool
- noOpt bool
-+ crossBuild bool
+ oldgocache string
+@@ -57,6 +58,7 @@ var (
+
+ rebuildall bool
+ noOpt bool
++ crossBuild bool
+ isRelease bool
vflag int // verbosity
- )
-@@ -267,6 +269,8 @@ func xinit() {
- if tooldir = os.Getenv("GOTOOLDIR"); tooldir == "" {
+@@ -263,6 +265,8 @@ func xinit() {
tooldir = pathf("%s/pkg/tool/%s_%s", goroot, gohostos, gohostarch)
}
-+
+
+ build_tooldir = pathf("%s/pkg/tool/native_native", goroot)
++
+ goversion := findgoversion()
+ isRelease = strings.HasPrefix(goversion, "release.") || strings.HasPrefix(goversion, "go")
}
+@@ -498,9 +502,9 @@ func setup() {
- // compilerEnv returns a map from "goos/goarch" to the
-@@ -468,8 +472,10 @@ func setup() {
goosGoarch := pathf("%s/pkg/%s_%s", goroot, gohostos, gohostarch)
if rebuildall {
- xremoveall(goosGoarch)
+- xremoveall(goosGoarch)
+ xremoveall(build_tooldir)
}
- xmkdirall(goosGoarch)
+- xmkdirall(goosGoarch)
+ xmkdirall(build_tooldir)
xatexit(func() {
if files := xreaddir(goosGoarch); len(files) == 0 {
xremove(goosGoarch)
-@@ -1276,17 +1282,35 @@ func cmdbootstrap() {
+@@ -566,6 +570,8 @@ func setup() {
+ }
+ }
+ }
++
++ build_tooldir = pathf("%s/pkg/tool/native_native", goroot)
+ }
- var noBanner, noClean bool
- var debug bool
-+ var hostOnly bool
-+ var targetOnly bool
+ /*
+@@ -1344,19 +1350,35 @@ func cmdbootstrap() {
+ defer timelog("end", "dist bootstrap")
+
+ var debug, distpack, force, noBanner, noClean bool
++ var hostOnly, targetOnly bool
+ var toBuild = []string{"std", "cmd"}
-+
flag.BoolVar(&rebuildall, "a", rebuildall, "rebuild all")
flag.BoolVar(&debug, "d", debug, "enable debugging of bootstrap process")
+ flag.BoolVar(&distpack, "distpack", distpack, "write distribution files to pkg/distpack")
+ flag.BoolVar(&force, "force", force, "build even if the port is marked as broken")
flag.BoolVar(&noBanner, "no-banner", noBanner, "do not print banner")
flag.BoolVar(&noClean, "no-clean", noClean, "print deprecation warning")
+ flag.BoolVar(&hostOnly, "host-only", hostOnly, "build only host binaries, not target")
@@ -112,10 +120,10 @@ index 5d31718..1c7f308 100644
+ }
+ }
+
- // Set GOPATH to an internal directory. We shouldn't actually
- // need to store files here, since the toolchain won't
- // depend on modules outside of vendor directories, but if
-@@ -1354,9 +1378,14 @@ func cmdbootstrap() {
+ // Don't build broken ports by default.
+ if broken[goos+"/"+goarch] && !force {
+ fatalf("build stopped because the port %s/%s is marked as broken\n\n"+
+@@ -1440,9 +1462,14 @@ func cmdbootstrap() {
xprintf("\n")
}
@@ -131,23 +139,23 @@ index 5d31718..1c7f308 100644
+ goldflags = os.Getenv("GO_LDFLAGS") // we were using $BOOT_GO_LDFLAGS until now
+ }
goBootstrap := pathf("%s/go_bootstrap", tooldir)
- cmdGo := pathf("%s/go", gorootBin)
if debug {
-@@ -1385,7 +1414,11 @@ func cmdbootstrap() {
+ run("", ShowOutput|CheckExit, pathf("%s/compile", tooldir), "-V=full")
+@@ -1470,7 +1497,11 @@ func cmdbootstrap() {
xprintf("\n")
}
xprintf("Building Go toolchain2 using go_bootstrap and Go toolchain1.\n")
-- os.Setenv("CC", compilerEnvLookup(defaultcc, goos, goarch))
+- os.Setenv("CC", compilerEnvLookup("CC", defaultcc, goos, goarch))
+ if crossBuild {
+ os.Setenv("CC", defaultcc[""])
+ } else {
-+ os.Setenv("CC", compilerEnvLookup(defaultcc, goos, goarch))
++ os.Setenv("CC", compilerEnvLookup("CC", defaultcc, goos, goarch))
+ }
// Now that cmd/go is in charge of the build process, enable GOEXPERIMENT.
os.Setenv("GOEXPERIMENT", goexperiment)
- goInstall(goBootstrap, toolchain...)
-@@ -1421,46 +1454,84 @@ func cmdbootstrap() {
- copyfile(pathf("%s/compile3", tooldir), pathf("%s/compile", tooldir), writeExec)
+ // No need to enable PGO for toolchain2.
+@@ -1523,48 +1554,83 @@ func cmdbootstrap() {
+ os.Setenv("GOCACHE", oldgocache)
}
- if goos == oldgoos && goarch == oldgoarch {
@@ -171,8 +179,8 @@ index 5d31718..1c7f308 100644
+ xprintf("\n")
+ }
+ xprintf("Building %s for host, %s/%s.\n", strings.Join(toBuild, ","), goos, goarch)
-+ goInstall(goBootstrap, toBuild...)
-+ checkNotStale(goBootstrap, toBuild...)
++ goInstall(toolenv(), goBootstrap, toBuild...)
++ checkNotStale(toolenv(), goBootstrap, toBuild...)
+ // Skip cmdGo staleness checks here, since we can't necessarily run the cmdGo binary
+
+ timelog("build", "target toolchain")
@@ -184,10 +192,10 @@ index 5d31718..1c7f308 100644
+ goarch = oldgoarch
+ os.Setenv("GOOS", goos)
+ os.Setenv("GOARCH", goarch)
-+ os.Setenv("CC", compilerEnvLookup(defaultcc, goos, goarch))
++ os.Setenv("CC", compilerEnvLookup("CC", defaultcc, goos, goarch))
+ xprintf("Building %s for target, %s/%s.\n", strings.Join(toBuild, ","), goos, goarch)
-+ goInstall(goBootstrap, toBuild...)
-+ checkNotStale(goBootstrap, toBuild...)
++ goInstall(toolenv(), goBootstrap, toBuild...)
++ checkNotStale(toolenv(), goBootstrap, toBuild...)
+ // Skip cmdGo staleness checks here, since we can't run the target's cmdGo binary
}
- xprintf("Building packages and commands for %s/%s.\n", goos, goarch)
@@ -215,9 +223,8 @@ index 5d31718..1c7f308 100644
+ xprintf("\n")
+ }
+ xprintf("Building packages and commands for host, %s/%s.\n", goos, goarch)
-+ goInstall(goBootstrap, "std", "cmd")
-+ checkNotStale(goBootstrap, "std", "cmd")
-+ checkNotStale(cmdGo, "std", "cmd")
++ goInstall(toolenv(), goBootstrap, "std", "cmd")
++ checkNotStale(toolenv(), goBootstrap, "std", "cmd")
+
+ timelog("build", "target toolchain")
+ if vflag > 0 {
@@ -227,48 +234,51 @@ index 5d31718..1c7f308 100644
+ goarch = oldgoarch
+ os.Setenv("GOOS", goos)
+ os.Setenv("GOARCH", goarch)
-+ os.Setenv("CC", compilerEnvLookup(defaultcc, goos, goarch))
++ os.Setenv("CC", compilerEnvLookup("CC", defaultcc, goos, goarch))
+ xprintf("Building packages and commands for target, %s/%s.\n", goos, goarch)
}
-- xprintf("Building packages and commands for host, %s/%s.\n", goos, goarch)
- goInstall(goBootstrap, "std", "cmd")
- checkNotStale(goBootstrap, "std", "cmd")
- checkNotStale(cmdGo, "std", "cmd")
+- xprintf("Building commands for host, %s/%s.\n", goos, goarch)
+ goInstall(toolenv(), goBootstrap, "cmd")
+ checkNotStale(toolenv(), goBootstrap, "cmd")
+ checkNotStale(toolenv(), gorootBinGo, "cmd")
- timelog("build", "target toolchain")
- if vflag > 0 {
- xprintf("\n")
-+ if debug {
-+ run("", ShowOutput|CheckExit, pathf("%s/compile", tooldir), "-V=full")
-+ run("", ShowOutput|CheckExit, pathf("%s/buildid", tooldir), pathf("%s/pkg/%s_%s/runtime/internal/sys.a", goroot, goos, goarch))
-+ checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...)
-+ copyfile(pathf("%s/compile4", tooldir), pathf("%s/compile", tooldir), writeExec)
- }
+- }
- goos = oldgoos
- goarch = oldgoarch
- os.Setenv("GOOS", goos)
- os.Setenv("GOARCH", goarch)
-- os.Setenv("CC", compilerEnvLookup(defaultcc, goos, goarch))
+- os.Setenv("CC", compilerEnvLookup("CC", defaultcc, goos, goarch))
- xprintf("Building packages and commands for target, %s/%s.\n", goos, goarch)
- }
-- targets := []string{"std", "cmd"}
-- goInstall(goBootstrap, targets...)
-- checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...)
-- checkNotStale(goBootstrap, targets...)
-- checkNotStale(cmdGo, targets...)
+- goInstall(nil, goBootstrap, "std")
+- goInstall(toolenv(), goBootstrap, "cmd")
+- checkNotStale(toolenv(), goBootstrap, toolchain...)
+- checkNotStale(nil, goBootstrap, "std")
+- checkNotStale(toolenv(), goBootstrap, "cmd")
+- checkNotStale(nil, gorootBinGo, "std")
+- checkNotStale(toolenv(), gorootBinGo, "cmd")
- if debug {
- run("", ShowOutput|CheckExit, pathf("%s/compile", tooldir), "-V=full")
-- checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...)
+- checkNotStale(toolenv(), goBootstrap, toolchain...)
- copyfile(pathf("%s/compile4", tooldir), pathf("%s/compile", tooldir), writeExec)
++ if debug {
++ run("", ShowOutput|CheckExit, pathf("%s/compile", tooldir), "-V=full")
++ run("", ShowOutput|CheckExit, pathf("%s/buildid", tooldir), pathf("%s/pkg/%s_%s/runtime/internal/sys.a", goroot, goos, goarch))
++ checkNotStale(toolenv(), goBootstrap, append(toolchain, "runtime/internal/sys")...)
++ copyfile(pathf("%s/compile4", tooldir), pathf("%s/compile", tooldir), writeExec)
++ }
}
// Check that there are no new files in $GOROOT/bin other than
-@@ -1477,8 +1548,11 @@ func cmdbootstrap() {
+@@ -1585,8 +1651,11 @@ func cmdbootstrap() {
}
}
- // Remove go_bootstrap now that we're done.
-- xremove(pathf("%s/go_bootstrap", tooldir))
+- xremove(pathf("%s/go_bootstrap"+exe, tooldir))
+ // Except that for split host/target cross-builds, we need to
+ // keep it.
+ if !crossBuild {
@@ -277,6 +287,3 @@ index 5d31718..1c7f308 100644
if goos == "android" {
// Make sure the exec wrapper will sync a fresh $GOROOT to the device.
---
-2.30.2
-
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 38b28b98771..5a1391eef63 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
@@ -27,11 +27,9 @@ Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
src/cmd/go/internal/work/exec.go | 25 +++++++++++++++++++++++++
3 files changed, 34 insertions(+)
-diff --git a/src/cmd/go/internal/work/action.go b/src/cmd/go/internal/work/action.go
-index 8beb134..68a8cfe 100644
--- a/src/cmd/go/internal/work/action.go
+++ b/src/cmd/go/internal/work/action.go
-@@ -718,6 +718,9 @@ func (b *Builder) addTransitiveLinkDeps(a, a1 *Action, shlib string) {
+@@ -730,6 +730,9 @@ func (b *Builder) addTransitiveLinkDeps(
if p1 == nil || p1.Shlib == "" || haveShlib[filepath.Base(p1.Shlib)] {
continue
}
@@ -41,11 +39,9 @@ index 8beb134..68a8cfe 100644
haveShlib[filepath.Base(p1.Shlib)] = true
// TODO(rsc): The use of ModeInstall here is suspect, but if we only do ModeBuild,
// we'll end up building an overall library or executable that depends at runtime
-diff --git a/src/cmd/go/internal/work/build.go b/src/cmd/go/internal/work/build.go
-index 2f2860a..8cc6166 100644
--- a/src/cmd/go/internal/work/build.go
+++ b/src/cmd/go/internal/work/build.go
-@@ -217,6 +217,8 @@ See also: go install, go get, go clean.
+@@ -228,6 +228,8 @@ See also: go install, go get, go clean.
const concurrentGCBackendCompilationEnabledByDefault = true
@@ -54,7 +50,7 @@ index 2f2860a..8cc6166 100644
func init() {
// break init cycle
CmdBuild.Run = runBuild
-@@ -230,6 +232,10 @@ func init() {
+@@ -241,6 +243,10 @@ func init() {
AddCoverFlags(CmdBuild, nil)
AddCoverFlags(CmdInstall, nil)
}
@@ -65,12 +61,10 @@ index 2f2860a..8cc6166 100644
}
// Note that flags consulted by other parts of the code
-diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go
-index 7e4fcb3..d83b31b 100644
--- a/src/cmd/go/internal/work/exec.go
+++ b/src/cmd/go/internal/work/exec.go
-@@ -527,6 +527,23 @@ func (b *Builder) build(ctx context.Context, a *Action) (err error) {
- return errors.New("binary-only packages are no longer supported")
+@@ -539,6 +539,23 @@ func (b *Builder) build(ctx context.Cont
+ return err
}
+ if goRootPrecious && (a.Package.Standard || a.Package.Goroot) {
@@ -93,7 +87,7 @@ index 7e4fcb3..d83b31b 100644
if err := b.Mkdir(a.Objdir); err != nil {
return err
}
-@@ -1624,6 +1641,14 @@ func (b *Builder) linkShared(ctx context.Context, a *Action) (err error) {
+@@ -1722,6 +1739,14 @@ func (b *Builder) linkShared(ctx context
return err
}
@@ -108,6 +102,3 @@ index 7e4fcb3..d83b31b 100644
if err := b.Mkdir(a.Objdir); err != nil {
return err
}
---
-2.30.2
-
diff --git a/meta/recipes-devtools/go/go/0007-exec.go-do-not-write-linker-flags-into-buildids.patch b/meta/recipes-devtools/go/go/0007-exec.go-do-not-write-linker-flags-into-buildids.patch
index a821cf02fcb..c4c9f555900 100644
--- a/meta/recipes-devtools/go/go/0007-exec.go-do-not-write-linker-flags-into-buildids.patch
+++ b/meta/recipes-devtools/go/go/0007-exec.go-do-not-write-linker-flags-into-buildids.patch
@@ -14,11 +14,9 @@ Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
src/cmd/go/internal/work/exec.go | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
-diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go
-index d83b31b..a646fbb 100644
--- a/src/cmd/go/internal/work/exec.go
+++ b/src/cmd/go/internal/work/exec.go
-@@ -1312,7 +1312,7 @@ func (b *Builder) linkActionID(a *Action) cache.ActionID {
+@@ -1357,7 +1357,7 @@ func (b *Builder) linkActionID(a *Action
}
// Toolchain-dependent configuration, shared with b.linkSharedActionID.
@@ -27,7 +25,7 @@ index d83b31b..a646fbb 100644
// Input files.
for _, a1 := range a.Deps {
-@@ -1607,7 +1607,7 @@ func (b *Builder) linkSharedActionID(a *Action) cache.ActionID {
+@@ -1705,7 +1705,7 @@ func (b *Builder) linkSharedActionID(a *
fmt.Fprintf(h, "goos %s goarch %s\n", cfg.Goos, cfg.Goarch)
// Toolchain-dependent configuration, shared with b.linkActionID.
@@ -36,6 +34,3 @@ index d83b31b..a646fbb 100644
// Input files.
for _, a1 := range a.Deps {
---
-2.30.2
-
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 fe830ce35c2..173a4059f0f 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
@@ -13,11 +13,9 @@ Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
src/cmd/dist/buildgo.go | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
-diff --git a/src/cmd/dist/buildgo.go b/src/cmd/dist/buildgo.go
-index 29b0167..63a49f0 100644
--- a/src/cmd/dist/buildgo.go
+++ b/src/cmd/dist/buildgo.go
-@@ -33,8 +33,8 @@ func mkzdefaultcc(dir, file string) {
+@@ -51,8 +51,8 @@ func mkzdefaultcc(dir, file string) {
fmt.Fprintf(&buf, "package cfg\n")
fmt.Fprintln(&buf)
fmt.Fprintf(&buf, "const DefaultPkgConfig = `%s`\n", defaultpkgconfig)
@@ -28,7 +26,7 @@ index 29b0167..63a49f0 100644
writefile(buf.String(), file, writeSkipSame)
return
}
-@@ -45,8 +45,8 @@ func mkzdefaultcc(dir, file string) {
+@@ -62,8 +62,8 @@ func mkzdefaultcc(dir, file string) {
fmt.Fprintf(&buf, "package main\n")
fmt.Fprintln(&buf)
fmt.Fprintf(&buf, "const defaultPkgConfig = `%s`\n", defaultpkgconfig)
@@ -39,6 +37,3 @@ index 29b0167..63a49f0 100644
writefile(buf.String(), file, writeSkipSame)
}
---
-2.30.2
-
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 705c9221419..5e751e032d8 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
@@ -15,13 +15,11 @@ Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
src/cmd/go/internal/load/pkg.go | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
-diff --git a/src/cmd/go/internal/load/pkg.go b/src/cmd/go/internal/load/pkg.go
-index 56a4e5e..22edbdb 100644
--- a/src/cmd/go/internal/load/pkg.go
+++ b/src/cmd/go/internal/load/pkg.go
-@@ -2266,6 +2266,17 @@ func (p *Package) collectDeps() {
- // to their VCS information (vcsStatusError).
- var vcsStatusCache par.Cache
+@@ -2264,6 +2264,17 @@ func isBadEmbedName(name string) bool {
+ // to their VCS information.
+ var vcsStatusCache par.ErrCache[string, vcs.Status]
+func filterCompilerFlags(flags string) string {
+ var newflags []string
@@ -34,10 +32,10 @@ index 56a4e5e..22edbdb 100644
+ return strings.Join(newflags, " ")
+}
+
- // setBuildInfo gathers build information, formats it as a string to be
- // embedded in the binary, then sets p.Internal.BuildInfo to that string.
- // setBuildInfo should only be called on a main package with no errors.
-@@ -2372,7 +2383,7 @@ func (p *Package) setBuildInfo(autoVCS bool) {
+ func appendBuildSetting(info *debug.BuildInfo, key, value string) {
+ value = strings.ReplaceAll(value, "\n", " ") // make value safe
+ info.Settings = append(info.Settings, debug.BuildSetting{Key: key, Value: value})
+@@ -2376,7 +2387,7 @@ func (p *Package) setBuildInfo(ctx conte
if gcflags := BuildGcflags.String(); gcflags != "" && cfg.BuildContext.Compiler == "gc" {
appendSetting("-gcflags", gcflags)
}
@@ -46,7 +44,7 @@ index 56a4e5e..22edbdb 100644
// https://go.dev/issue/52372: only include ldflags if -trimpath is not set,
// since it can include system paths through various linker flags (notably
// -extar, -extld, and -extldflags).
-@@ -2418,7 +2429,7 @@ func (p *Package) setBuildInfo(autoVCS bool) {
+@@ -2419,7 +2430,7 @@ func (p *Package) setBuildInfo(ctx conte
// subset of flags that are known not to be paths?
if cfg.BuildContext.CgoEnabled && !cfg.BuildTrimpath {
for _, name := range []string{"CGO_CFLAGS", "CGO_CPPFLAGS", "CGO_CXXFLAGS", "CGO_LDFLAGS"} {
@@ -55,6 +53,3 @@ index 56a4e5e..22edbdb 100644
}
}
appendSetting("GOARCH", cfg.BuildContext.GOARCH)
---
-2.30.2
-
diff --git a/meta/recipes-devtools/go/go_1.20.7.bb b/meta/recipes-devtools/go/go_1.21.0.bb
index 46f5fbc6be9..46f5fbc6be9 100644
--- a/meta/recipes-devtools/go/go_1.20.7.bb
+++ b/meta/recipes-devtools/go/go_1.21.0.bb