go: bump 1.21.0

Go 1.21 Release Notes
https://go.dev/doc/go1.21

(From OE-Core rev: 51a3cb046de4cfd66ecef36031fa96be29ef0a2a)

Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Jose Quaresma
2024-02-28 18:30:06 +00:00
committed by Richard Purdie
parent 9c730d3bcc
commit ed39f516e9
18 changed files with 125 additions and 111 deletions

View File

@@ -23,7 +23,7 @@ GDBVERSION ?= "14.%"
GLIBCVERSION ?= "2.39%" GLIBCVERSION ?= "2.39%"
LINUXLIBCVERSION ?= "6.6%" LINUXLIBCVERSION ?= "6.6%"
QEMUVERSION ?= "8.2%" QEMUVERSION ?= "8.2%"
GOVERSION ?= "1.20%" GOVERSION ?= "1.21%"
RUSTVERSION ?= "1.75%" RUSTVERSION ?= "1.75%"
PREFERRED_VERSION_gcc ?= "${GCCVERSION}" PREFERRED_VERSION_gcc ?= "${GCCVERSION}"

View File

@@ -15,4 +15,4 @@ SRC_URI += "\
file://0008-src-cmd-dist-buildgo.go-do-not-hardcode-host-compile.patch \ file://0008-src-cmd-dist-buildgo.go-do-not-hardcode-host-compile.patch \
file://0009-go-Filter-build-paths-on-staticly-linked-arches.patch \ file://0009-go-Filter-build-paths-on-staticly-linked-arches.patch \
" "
SRC_URI[main.sha256sum] = "1aef321a0e3e38b7e91d2d7eb64040666cabdcc77d383de3c9522d0d69b67f4e" SRC_URI[main.sha256sum] = "818d46ede85682dd551ad378ef37a4d247006f12ec59b5b755601d2ce114369a"

View File

@@ -9,9 +9,9 @@ PROVIDES = "go-native"
# Checksums available at https://go.dev/dl/ # 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 = "https://dl.google.com/go/go${PV}.${BUILD_GOOS}-${BUILD_GOARCH}.tar.gz;name=go_${BUILD_GOTUPLE}"
SRC_URI[go_linux_amd64.sha256sum] = "ff445e48af27f93f66bd949ae060d97991c83e11289009d311f25426258f9c44" SRC_URI[go_linux_amd64.sha256sum] = "d0398903a16ba2232b389fb31032ddf57cac34efda306a0eebac34f0965a0742"
SRC_URI[go_linux_arm64.sha256sum] = "2096507509a98782850d1f0669786c09727053e9fe3c92b03c0d96f48700282b" SRC_URI[go_linux_arm64.sha256sum] = "f3d4548edf9b22f26bbd49720350bbfe59d75b7090a1a2bff1afad8214febaf3"
SRC_URI[go_linux_ppc64le.sha256sum] = "237b1da9b65629a9b0fcf1f3ca75b4c84ef55fca1fc3eadf1681da7bbcb2e9cd" SRC_URI[go_linux_ppc64le.sha256sum] = "e938ffc81d8ebe5efc179240960ba22da6a841ff05d5cab7ce2547112b14a47f"
UPSTREAM_CHECK_URI = "https://golang.org/dl/" UPSTREAM_CHECK_URI = "https://golang.org/dl/"
UPSTREAM_CHECK_REGEX = "go(?P<pver>\d+(\.\d+)+)\.linux" UPSTREAM_CHECK_REGEX = "go(?P<pver>\d+(\.\d+)+)\.linux"

View File

@@ -1,4 +1,4 @@
From 10766ca6f4007b96e3f6bf4fb496e5df74397eb9 Mon Sep 17 00:00:00 2001 From 9a6c5040cbcd88b10ceb8ceaebc8d6158c086670 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com> From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 28 Mar 2022 10:59:03 -0700 Date: Mon, 28 Mar 2022 10:59:03 -0700
Subject: [PATCH 1/9] cmd/go: make content-based hash generation less pedantic Subject: [PATCH 1/9] cmd/go: make content-based hash generation less pedantic
@@ -25,16 +25,17 @@ Upstream-Status: Inappropriate [OE specific]
Signed-off-by: Alex Kube <alexander.j.kube@gmail.com> Signed-off-by: Alex Kube <alexander.j.kube@gmail.com>
Signed-off-by: Matt Madison <matt@madison.systems> Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
--- ---
src/cmd/go/internal/envcmd/env.go | 2 +- src/cmd/go/internal/envcmd/env.go | 2 +-
src/cmd/go/internal/work/exec.go | 44 ++++++++++++++++++++++++------- src/cmd/go/internal/work/exec.go | 44 ++++++++++++++++++++++++-------
2 files changed, 36 insertions(+), 10 deletions(-) 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 diff --git a/src/cmd/go/internal/envcmd/env.go b/src/cmd/go/internal/envcmd/env.go
index 66ef5ce..fb7448a 100644 index c7c2e83..4a90d9d 100644
--- a/src/cmd/go/internal/envcmd/env.go --- a/src/cmd/go/internal/envcmd/env.go
+++ b/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 {
} }
}() }()
@@ -44,10 +45,10 @@ index 66ef5ce..fb7448a 100644
// Should not happen - b.CFlags was given an empty package. // Should not happen - b.CFlags was given an empty package.
fmt.Fprintf(os.Stderr, "go: invalid cflags: %v\n", err) 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 diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go
index 67d1193..62e1774 100644 index 13d2a78..e3dd486 100644
--- a/src/cmd/go/internal/work/exec.go --- a/src/cmd/go/internal/work/exec.go
+++ b/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, root *Action) {
writeActionGraph() writeActionGraph()
} }
@@ -56,7 +57,7 @@ index 67d1193..62e1774 100644
// buildActionID computes the action ID for a build action. // buildActionID computes the action ID for a build action.
func (b *Builder) buildActionID(a *Action) cache.ActionID { func (b *Builder) buildActionID(a *Action) cache.ActionID {
p := a.Package p := a.Package
@@ -244,7 +246,7 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID { @@ -252,7 +254,7 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
if p.Module != nil { if p.Module != nil {
fmt.Fprintf(h, "module %s@%s\n", p.Module.Path, p.Module.Version) fmt.Fprintf(h, "module %s@%s\n", p.Module.Path, p.Module.Version)
} }
@@ -65,7 +66,7 @@ index 67d1193..62e1774 100644
// The Go compiler always hides the exact value of $GOROOT // The Go compiler always hides the exact value of $GOROOT
// when building things in 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 *Action) cache.ActionID {
} }
if len(p.CgoFiles)+len(p.SwigFiles)+len(p.SwigCXXFiles) > 0 { if len(p.CgoFiles)+len(p.SwigFiles)+len(p.SwigCXXFiles) > 0 {
fmt.Fprintf(h, "cgo %q\n", b.toolID("cgo")) fmt.Fprintf(h, "cgo %q\n", b.toolID("cgo"))
@@ -77,7 +78,7 @@ index 67d1193..62e1774 100644
fmt.Fprintf(h, "CC=%q %q %q %q\n", ccExe, cppflags, cflags, ldflags) fmt.Fprintf(h, "CC=%q %q %q %q\n", ccExe, cppflags, cflags, ldflags)
// Include the C compiler tool ID so that if the C // Include the C compiler tool ID so that if the C
// compiler changes we rebuild the package. // 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 *Action) cache.ActionID {
fmt.Fprintf(h, "CC ID=%q\n", ccID) fmt.Fprintf(h, "CC ID=%q\n", ccID)
} }
if len(p.CXXFiles)+len(p.SwigCXXFiles) > 0 { if len(p.CXXFiles)+len(p.SwigCXXFiles) > 0 {
@@ -94,16 +95,16 @@ index 67d1193..62e1774 100644
fmt.Fprintf(h, "FC=%q %q\n", fcExe, fflags) fmt.Fprintf(h, "FC=%q %q\n", fcExe, fflags)
if fcID, _, err := b.gccToolID(fcExe[0], "f95"); err == nil { if fcID, _, err := b.gccToolID(fcExe[0], "f95"); err == nil {
fmt.Fprintf(h, "FC ID=%q\n", fcID) 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 *Action) cache.ActionID {
} }
} }
if p.Internal.BuildInfo != "" { if p.Internal.BuildInfo != nil {
- fmt.Fprintf(h, "modinfo %q\n", p.Internal.BuildInfo) - fmt.Fprintf(h, "modinfo %q\n", p.Internal.BuildInfo.String())
+ //fmt.Fprintf(h, "modinfo %q\n", p.Internal.BuildInfo) + //fmt.Fprintf(h, "modinfo %q\n", p.Internal.BuildInfo.String())
} }
// Configuration specific to compiler toolchain. // Configuration specific to compiler toolchain.
@@ -2989,8 +2991,25 @@ func envList(key, def string) []string { @@ -3137,8 +3139,25 @@ func envList(key, def string) []string {
return args return args
} }
@@ -130,7 +131,7 @@ index 67d1193..62e1774 100644
if cppflags, err = buildFlags("CPPFLAGS", "", p.CgoCPPFLAGS, checkCompilerFlags); err != nil { if cppflags, err = buildFlags("CPPFLAGS", "", p.CgoCPPFLAGS, checkCompilerFlags); err != nil {
return return
} }
@@ -3006,6 +3025,13 @@ func (b *Builder) CFlags(p *load.Package) (cppflags, cflags, cxxflags, fflags, l @@ -3154,6 +3173,13 @@ func (b *Builder) CFlags(p *load.Package) (cppflags, cflags, cxxflags, fflags, l
if ldflags, err = buildFlags("LDFLAGS", defaultCFlags, p.CgoLDFLAGS, checkLinkerFlags); err != nil { if ldflags, err = buildFlags("LDFLAGS", defaultCFlags, p.CgoLDFLAGS, checkLinkerFlags); err != nil {
return return
} }
@@ -144,7 +145,7 @@ index 67d1193..62e1774 100644
return return
} }
@@ -3021,7 +3047,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) { 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 p := a.Package
@@ -153,7 +154,7 @@ index 67d1193..62e1774 100644
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
} }
@@ -3577,7 +3603,7 @@ func (b *Builder) swigIntSize(objdir string) (intsize string, err error) { @@ -3725,7 +3751,7 @@ func (b *Builder) swigIntSize(objdir string) (intsize string, err error) {
// Run SWIG on one SWIG input file. // 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) { func (b *Builder) swigOne(a *Action, p *load.Package, file, objdir string, pcCFLAGS []string, cxx bool, intgosize string) (outGo, outC string, err error) {
@@ -163,5 +164,5 @@ index 67d1193..62e1774 100644
return "", "", err return "", "", err
} }
-- --
2.30.2 2.43.0

View File

@@ -1,4 +1,4 @@
From 5cca2fa5997292a87302bdc7e7ed3231371e98bd Mon Sep 17 00:00:00 2001 From e3f9a8a69d3a340c1a1d0bba566e71f20f635a43 Mon Sep 17 00:00:00 2001
From: Alex Kube <alexander.j.kube@gmail.com> From: Alex Kube <alexander.j.kube@gmail.com>
Date: Wed, 23 Oct 2019 21:15:37 +0430 Date: Wed, 23 Oct 2019 21:15:37 +0430
Subject: [PATCH 2/9] cmd/go: Allow GOTOOLDIR to be overridden in the Subject: [PATCH 2/9] cmd/go: Allow GOTOOLDIR to be overridden in the
@@ -13,16 +13,17 @@ Matt Madison <matt@madison.systems>.
Upstream-Status: Inappropriate [OE specific] Upstream-Status: Inappropriate [OE specific]
Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com> Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
--- ---
src/cmd/dist/build.go | 4 +++- src/cmd/dist/build.go | 4 +++-
src/cmd/go/internal/cfg/cfg.go | 6 +++++- src/cmd/go/internal/cfg/cfg.go | 6 +++++-
2 files changed, 8 insertions(+), 2 deletions(-) 2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go
index c36a12e..5d31718 100644 index 8973a87..adc9fd2 100644
--- a/src/cmd/dist/build.go --- a/src/cmd/dist/build.go
+++ b/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) xatexit(rmworkdir)
@@ -30,14 +31,14 @@ index c36a12e..5d31718 100644
+ if tooldir = os.Getenv("GOTOOLDIR"); tooldir == "" { + if tooldir = os.Getenv("GOTOOLDIR"); tooldir == "" {
+ tooldir = pathf("%s/pkg/tool/%s_%s", goroot, gohostos, gohostarch) + tooldir = pathf("%s/pkg/tool/%s_%s", goroot, gohostos, gohostarch)
+ } + }
}
// compilerEnv returns a map from "goos/goarch" to the goversion := findgoversion()
isRelease = strings.HasPrefix(goversion, "release.") || strings.HasPrefix(goversion, "go")
diff --git a/src/cmd/go/internal/cfg/cfg.go b/src/cmd/go/internal/cfg/cfg.go diff --git a/src/cmd/go/internal/cfg/cfg.go b/src/cmd/go/internal/cfg/cfg.go
index 3257140..bb46253 100644 index 8a82e55..1141fc2 100644
--- a/src/cmd/go/internal/cfg/cfg.go --- a/src/cmd/go/internal/cfg/cfg.go
+++ b/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 bool) {
// This matches the initialization of ToolDir in go/build, except for // This matches the initialization of ToolDir in go/build, except for
// using ctxt.GOROOT and the installed GOOS and GOARCH rather than the // using ctxt.GOROOT and the installed GOOS and GOARCH rather than the
// GOROOT, GOOS, and GOARCH reported by the runtime package. // GOROOT, GOOS, and GOARCH reported by the runtime package.
@@ -51,5 +52,5 @@ index 3257140..bb46253 100644
} }
} }
-- --
2.30.2 2.43.0

View File

@@ -1,4 +1,4 @@
From c7536a820f713013ab1d4acef74a4c8bd970bf8f Mon Sep 17 00:00:00 2001 From 7dde77b3ce8138314dd2736604b1b110dbcc0ac1 Mon Sep 17 00:00:00 2001
From: Alex Kube <alexander.j.kube@gmail.com> From: Alex Kube <alexander.j.kube@gmail.com>
Date: Wed, 23 Oct 2019 21:16:32 +0430 Date: Wed, 23 Oct 2019 21:16:32 +0430
Subject: [PATCH 3/9] ld: add soname to shareable objects Subject: [PATCH 3/9] ld: add soname to shareable objects
@@ -13,15 +13,16 @@ Matt Madison <matt@madison.systems>.
Upstream-Status: Inappropriate [OE specific] Upstream-Status: Inappropriate [OE specific]
Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com> Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
--- ---
src/cmd/link/internal/ld/lib.go | 3 +++ src/cmd/link/internal/ld/lib.go | 3 +++
1 file changed, 3 insertions(+) 1 file changed, 3 insertions(+)
diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go
index 6eae900..0462ee8 100644 index 91e2d51..e98b912 100644
--- a/src/cmd/link/internal/ld/lib.go --- a/src/cmd/link/internal/ld/lib.go
+++ b/src/cmd/link/internal/ld/lib.go +++ b/src/cmd/link/internal/ld/lib.go
@@ -1508,6 +1508,7 @@ func (ctxt *Link) hostlink() { @@ -1554,6 +1554,7 @@ func (ctxt *Link) hostlink() {
argv = append(argv, "-Wl,-z,relro") argv = append(argv, "-Wl,-z,relro")
} }
argv = append(argv, "-shared") argv = append(argv, "-shared")
@@ -29,7 +30,7 @@ index 6eae900..0462ee8 100644
if ctxt.HeadType == objabi.Hwindows { if ctxt.HeadType == objabi.Hwindows {
argv = addASLRargs(argv, *flagAslr) argv = addASLRargs(argv, *flagAslr)
} else { } else {
@@ -1523,6 +1524,7 @@ func (ctxt *Link) hostlink() { @@ -1569,6 +1570,7 @@ func (ctxt *Link) hostlink() {
argv = append(argv, "-Wl,-z,relro") argv = append(argv, "-Wl,-z,relro")
} }
argv = append(argv, "-shared") argv = append(argv, "-shared")
@@ -37,7 +38,7 @@ index 6eae900..0462ee8 100644
case BuildModePlugin: case BuildModePlugin:
if ctxt.HeadType == objabi.Hdarwin { if ctxt.HeadType == objabi.Hdarwin {
argv = append(argv, "-dynamiclib") argv = append(argv, "-dynamiclib")
@@ -1531,6 +1533,7 @@ func (ctxt *Link) hostlink() { @@ -1577,6 +1579,7 @@ func (ctxt *Link) hostlink() {
argv = append(argv, "-Wl,-z,relro") argv = append(argv, "-Wl,-z,relro")
} }
argv = append(argv, "-shared") argv = append(argv, "-shared")

View File

@@ -1,4 +1,4 @@
From 31ff609cc3d3bfcc2f2257fda1dbaafaec31eb0b Mon Sep 17 00:00:00 2001 From 9f59e46991074d3e3c4d00f3971e62bfcd707167 Mon Sep 17 00:00:00 2001
From: Alex Kube <alexander.j.kube@gmail.com> From: Alex Kube <alexander.j.kube@gmail.com>
Date: Wed, 23 Oct 2019 21:17:16 +0430 Date: Wed, 23 Oct 2019 21:17:16 +0430
Subject: [PATCH 4/9] make.bash: override CC when building dist and Subject: [PATCH 4/9] make.bash: override CC when building dist and
@@ -13,24 +13,25 @@ Matt Madison <matt@madison.systems>.
Upstream-Status: Inappropriate [OE specific] Upstream-Status: Inappropriate [OE specific]
Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com> Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
--- ---
src/make.bash | 4 ++-- src/make.bash | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-) 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/make.bash b/src/make.bash diff --git a/src/make.bash b/src/make.bash
index c07f39b..6ca7242 100755 index 755b3b0..eddfc3c 100755
--- a/src/make.bash --- a/src/make.bash
+++ b/src/make.bash +++ b/src/make.bash
@@ -194,7 +194,7 @@ if [ "$GOROOT_BOOTSTRAP" = "$GOROOT" ]; then @@ -198,7 +198,7 @@ if [ "$GOROOT_BOOTSTRAP" = "$GOROOT" ]; then
exit 1 exit 1
fi fi
rm -f cmd/dist/dist 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 -GOROOT="$GOROOT_BOOTSTRAP" nogoenv "$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 +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. # -e doesn't propagate out of eval, so check success by hand.
eval $(./cmd/dist/dist env -p || echo FAIL=true) 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. # Run dist bootstrap to complete make.bash.
# Bootstrap installs a proper cmd/dist, built with the new toolchain. # Bootstrap installs a proper cmd/dist, built with the new toolchain.
# Throw ours, built with the bootstrap toolchain, away after bootstrap. # Throw ours, built with the bootstrap toolchain, away after bootstrap.
@@ -40,5 +41,5 @@ index c07f39b..6ca7242 100755
# DO NOT ADD ANY NEW CODE HERE. # DO NOT ADD ANY NEW CODE HERE.
-- --
2.30.2 2.43.0

View File

@@ -1,4 +1,4 @@
From 7a191e5191c8b813e929caedb3f3918bb08692a1 Mon Sep 17 00:00:00 2001 From 6dda78d528e60993a4688cd9d49440a726378ac8 Mon Sep 17 00:00:00 2001
From: Alex Kube <alexander.j.kube@gmail.com> From: Alex Kube <alexander.j.kube@gmail.com>
Date: Wed, 23 Oct 2019 21:18:12 +0430 Date: Wed, 23 Oct 2019 21:18:12 +0430
Subject: [PATCH 5/9] cmd/dist: separate host and target builds Subject: [PATCH 5/9] cmd/dist: separate host and target builds
@@ -31,8 +31,8 @@ Adapted to Go 1.13 from patches originally submitted to
the meta/recipes-devtools/go tree by the meta/recipes-devtools/go tree by
Matt Madison <matt@madison.systems>. Matt Madison <matt@madison.systems>.
Rework the patch to avoid identation, it's more hard to read Rework the patch to avoid identation, it's more hard to read but
but easy to rebase. easy to rebase.
Jose Quaresma <jose.quaresma@foundries.io> Jose Quaresma <jose.quaresma@foundries.io>
Upstream-Status: Inappropriate [OE specific] Upstream-Status: Inappropriate [OE specific]
@@ -44,35 +44,35 @@ Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
1 file changed, 75 insertions(+), 1 deletion(-) 1 file changed, 75 insertions(+), 1 deletion(-)
diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go
index 5d3171856a..d0ba54c072 100644 index adc9fd2..5fff592 100644
--- a/src/cmd/dist/build.go --- a/src/cmd/dist/build.go
+++ b/src/cmd/dist/build.go +++ b/src/cmd/dist/build.go
@@ -44,6 +44,7 @@ var ( @@ -46,6 +46,7 @@ var (
goexperiment string goexperiment string
workdir string workdir string
tooldir string tooldir string
+ build_tooldir string + build_tooldir string
oldgoos string oldgoos string
oldgoarch string oldgoarch string
exe string oldgocache string
@@ -55,6 +56,7 @@ var ( @@ -58,6 +59,7 @@ var (
rebuildall bool rebuildall bool
defaultclang bool noOpt bool
noOpt bool isRelease bool
+ crossBuild bool + crossBuild bool
vflag int // verbosity vflag int // verbosity
) )
@@ -267,6 +269,8 @@ func xinit() { @@ -265,6 +267,8 @@ func xinit() {
if tooldir = os.Getenv("GOTOOLDIR"); tooldir == "" {
tooldir = pathf("%s/pkg/tool/%s_%s", goroot, gohostos, gohostarch) goversion := findgoversion()
} isRelease = strings.HasPrefix(goversion, "release.") || strings.HasPrefix(goversion, "go")
+ +
+ build_tooldir = pathf("%s/pkg/tool/native_native", goroot) + build_tooldir = pathf("%s/pkg/tool/native_native", goroot)
} }
// compilerEnv returns a map from "goos/goarch" to the // compilerEnv returns a map from "goos/goarch" to the
@@ -468,8 +472,10 @@ func setup() { @@ -499,8 +503,10 @@ func setup() {
goosGoarch := pathf("%s/pkg/%s_%s", goroot, gohostos, gohostarch) goosGoarch := pathf("%s/pkg/%s_%s", goroot, gohostos, gohostarch)
if rebuildall { if rebuildall {
xremoveall(goosGoarch) xremoveall(goosGoarch)
@@ -83,16 +83,18 @@ index 5d3171856a..d0ba54c072 100644
xatexit(func() { xatexit(func() {
if files := xreaddir(goosGoarch); len(files) == 0 { if files := xreaddir(goosGoarch); len(files) == 0 {
xremove(goosGoarch) xremove(goosGoarch)
@@ -1276,17 +1282,35 @@ func cmdbootstrap() { @@ -1344,14 +1350,20 @@ func cmdbootstrap() {
defer timelog("end", "dist bootstrap")
var noBanner, noClean bool var debug, distpack, force, noBanner, noClean bool
var debug bool
+ var hostOnly bool + var hostOnly bool
+ var targetOnly bool + var targetOnly bool
+ var toBuild = []string{"std", "cmd"} + var toBuild = []string{"std", "cmd"}
+ +
flag.BoolVar(&rebuildall, "a", rebuildall, "rebuild all") flag.BoolVar(&rebuildall, "a", rebuildall, "rebuild all")
flag.BoolVar(&debug, "d", debug, "enable debugging of bootstrap process") 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(&noBanner, "no-banner", noBanner, "do not print banner")
flag.BoolVar(&noClean, "no-clean", noClean, "print deprecation warning") flag.BoolVar(&noClean, "no-clean", noClean, "print deprecation warning")
+ flag.BoolVar(&hostOnly, "host-only", hostOnly, "build only host binaries, not target") + flag.BoolVar(&hostOnly, "host-only", hostOnly, "build only host binaries, not target")
@@ -103,6 +105,8 @@ index 5d3171856a..d0ba54c072 100644
if noClean { if noClean {
xprintf("warning: --no-clean is deprecated and has no effect; use 'go install std cmd' instead\n") xprintf("warning: --no-clean is deprecated and has no effect; use 'go install std cmd' instead\n")
@@ -1363,6 +1375,18 @@ func cmdbootstrap() {
"Use the -force flag to build anyway.\n", goos, goarch)
} }
+ if hostOnly && targetOnly { + if hostOnly && targetOnly {
@@ -120,7 +124,7 @@ index 5d3171856a..d0ba54c072 100644
// Set GOPATH to an internal directory. We shouldn't actually // Set GOPATH to an internal directory. We shouldn't actually
// need to store files here, since the toolchain won't // need to store files here, since the toolchain won't
// depend on modules outside of vendor directories, but if // depend on modules outside of vendor directories, but if
@@ -1354,9 +1378,14 @@ func cmdbootstrap() { @@ -1440,9 +1464,14 @@ func cmdbootstrap() {
xprintf("\n") xprintf("\n")
} }
@@ -133,30 +137,30 @@ index 5d3171856a..d0ba54c072 100644
goldflags = os.Getenv("GO_LDFLAGS") // we were using $BOOT_GO_LDFLAGS until now goldflags = os.Getenv("GO_LDFLAGS") // we were using $BOOT_GO_LDFLAGS until now
+} +}
goBootstrap := pathf("%s/go_bootstrap", tooldir) goBootstrap := pathf("%s/go_bootstrap", tooldir)
cmdGo := pathf("%s/go", gorootBin)
if debug { if debug {
@@ -1385,7 +1414,11 @@ func cmdbootstrap() { run("", ShowOutput|CheckExit, pathf("%s/compile", tooldir), "-V=full")
@@ -1470,7 +1499,11 @@ func cmdbootstrap() {
xprintf("\n") xprintf("\n")
} }
xprintf("Building Go toolchain2 using go_bootstrap and Go toolchain1.\n") xprintf("Building Go toolchain2 using go_bootstrap and Go toolchain1.\n")
+ if !crossBuild { + if !crossBuild {
os.Setenv("CC", compilerEnvLookup(defaultcc, goos, goarch)) os.Setenv("CC", compilerEnvLookup("CC", defaultcc, goos, goarch))
+} else { +} else {
+ os.Setenv("CC", defaultcc[""]) + os.Setenv("CC", defaultcc[""])
+ } + }
// Now that cmd/go is in charge of the build process, enable GOEXPERIMENT. // Now that cmd/go is in charge of the build process, enable GOEXPERIMENT.
os.Setenv("GOEXPERIMENT", goexperiment) os.Setenv("GOEXPERIMENT", goexperiment)
goInstall(goBootstrap, toolchain...) // No need to enable PGO for toolchain2.
@@ -1421,6 +1454,7 @@ func cmdbootstrap() { @@ -1523,6 +1556,7 @@ func cmdbootstrap() {
copyfile(pathf("%s/compile3", tooldir), pathf("%s/compile", tooldir), writeExec) os.Setenv("GOCACHE", oldgocache)
} }
+ if !crossBuild { + if !crossBuild {
if goos == oldgoos && goarch == oldgoarch { if goos == oldgoos && goarch == oldgoarch {
// Common case - not setting up for cross-compilation. // Common case - not setting up for cross-compilation.
timelog("build", "toolchain") timelog("build", "toolchain")
@@ -1462,6 +1496,42 @@ func cmdbootstrap() { @@ -1566,6 +1600,42 @@ func cmdbootstrap() {
checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...) checkNotStale(toolenv(), goBootstrap, toolchain...)
copyfile(pathf("%s/compile4", tooldir), pathf("%s/compile", tooldir), writeExec) copyfile(pathf("%s/compile4", tooldir), pathf("%s/compile", tooldir), writeExec)
} }
+} else { +} else {
@@ -175,8 +179,8 @@ index 5d3171856a..d0ba54c072 100644
+ xprintf("\n") + xprintf("\n")
+ } + }
+ xprintf("Building %s for host, %s/%s.\n", strings.Join(toBuild, ","), goos, goarch) + xprintf("Building %s for host, %s/%s.\n", strings.Join(toBuild, ","), goos, goarch)
+ goInstall(goBootstrap, toBuild...) + goInstall(toolenv(), goBootstrap, toBuild...)
+ checkNotStale(goBootstrap, toBuild...) + checkNotStale(toolenv(), goBootstrap, toBuild...)
+ // Skip cmdGo staleness checks here, since we can't necessarily run the cmdGo binary + // Skip cmdGo staleness checks here, since we can't necessarily run the cmdGo binary
+ +
+ timelog("build", "target toolchain") + timelog("build", "target toolchain")
@@ -188,17 +192,17 @@ index 5d3171856a..d0ba54c072 100644
+ goarch = oldgoarch + goarch = oldgoarch
+ os.Setenv("GOOS", goos) + os.Setenv("GOOS", goos)
+ os.Setenv("GOARCH", goarch) + 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) + xprintf("Building %s for target, %s/%s.\n", strings.Join(toBuild, ","), goos, goarch)
+ goInstall(goBootstrap, toBuild...) + goInstall(toolenv(), goBootstrap, toBuild...)
+ checkNotStale(goBootstrap, toBuild...) + checkNotStale(toolenv(), goBootstrap, toBuild...)
+ // Skip cmdGo staleness checks here, since we can't run the target's cmdGo binary + // Skip cmdGo staleness checks here, since we can't run the target's cmdGo binary
+ } + }
+ } + }
// Check that there are no new files in $GOROOT/bin other than // Check that there are no new files in $GOROOT/bin other than
// go and gofmt and $GOOS_$GOARCH (target bin when cross-compiling). // go and gofmt and $GOOS_$GOARCH (target bin when cross-compiling).
@@ -1477,8 +1547,12 @@ func cmdbootstrap() { @@ -1585,8 +1655,12 @@ func cmdbootstrap() {
} }
} }
@@ -206,7 +210,7 @@ index 5d3171856a..d0ba54c072 100644
+ // keep it. + // keep it.
+ if !crossBuild { + if !crossBuild {
// Remove go_bootstrap now that we're done. // Remove go_bootstrap now that we're done.
xremove(pathf("%s/go_bootstrap", tooldir)) xremove(pathf("%s/go_bootstrap"+exe, tooldir))
+} +}
if goos == "android" { if goos == "android" {

View File

@@ -1,10 +1,8 @@
From efab470498bb0a30ee2d00455a0c8c10459f6347 Mon Sep 17 00:00:00 2001 From aff5a740d6286c04beb0593fc68b0aea5a95ad39 Mon Sep 17 00:00:00 2001
From: Alex Kube <alexander.j.kube@gmail.com> From: Alex Kube <alexander.j.kube@gmail.com>
Date: Wed, 23 Oct 2019 21:18:56 +0430 Date: Wed, 23 Oct 2019 21:18:56 +0430
Subject: [PATCH 6/9] cmd/go: make GOROOT precious by default Subject: [PATCH 6/9] cmd/go: make GOROOT precious by default
Upstream-Status: Inappropriate [OE specific]
The go build tool normally rebuilds whatever it detects is The go build tool normally rebuilds whatever it detects is
stale. This can be a problem when GOROOT is intended to stale. This can be a problem when GOROOT is intended to
be read-only and the go runtime has been built as a shared be read-only and the go runtime has been built as a shared
@@ -20,7 +18,10 @@ Adapted to Go 1.13 from patches originally submitted to
the meta/recipes-devtools/go tree by the meta/recipes-devtools/go tree by
Matt Madison <matt@madison.systems>. Matt Madison <matt@madison.systems>.
Upstream-Status: Inappropriate [OE specific]
Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com> Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
--- ---
src/cmd/go/internal/work/action.go | 3 +++ src/cmd/go/internal/work/action.go | 3 +++
src/cmd/go/internal/work/build.go | 6 ++++++ src/cmd/go/internal/work/build.go | 6 ++++++
@@ -28,10 +29,10 @@ Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
3 files changed, 34 insertions(+) 3 files changed, 34 insertions(+)
diff --git a/src/cmd/go/internal/work/action.go b/src/cmd/go/internal/work/action.go diff --git a/src/cmd/go/internal/work/action.go b/src/cmd/go/internal/work/action.go
index 8beb134..68a8cfe 100644 index d4d0a71..42149d2 100644
--- a/src/cmd/go/internal/work/action.go --- a/src/cmd/go/internal/work/action.go
+++ b/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(a, a1 *Action, shlib string) {
if p1 == nil || p1.Shlib == "" || haveShlib[filepath.Base(p1.Shlib)] { if p1 == nil || p1.Shlib == "" || haveShlib[filepath.Base(p1.Shlib)] {
continue continue
} }
@@ -42,10 +43,10 @@ index 8beb134..68a8cfe 100644
// TODO(rsc): The use of ModeInstall here is suspect, but if we only do ModeBuild, // 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 // 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 diff --git a/src/cmd/go/internal/work/build.go b/src/cmd/go/internal/work/build.go
index 2f2860a..8cc6166 100644 index e2e0e07..1c84137 100644
--- a/src/cmd/go/internal/work/build.go --- a/src/cmd/go/internal/work/build.go
+++ b/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 const concurrentGCBackendCompilationEnabledByDefault = true
@@ -54,7 +55,7 @@ index 2f2860a..8cc6166 100644
func init() { func init() {
// break init cycle // break init cycle
CmdBuild.Run = runBuild CmdBuild.Run = runBuild
@@ -230,6 +232,10 @@ func init() { @@ -241,6 +243,10 @@ func init() {
AddCoverFlags(CmdBuild, nil) AddCoverFlags(CmdBuild, nil)
AddCoverFlags(CmdInstall, nil) AddCoverFlags(CmdInstall, nil)
} }
@@ -66,11 +67,11 @@ index 2f2860a..8cc6166 100644
// Note that flags consulted by other parts of the code // 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 diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go
index 62e1774..cde867b 100644 index e3dd486..0ea5316 100644
--- a/src/cmd/go/internal/work/exec.go --- a/src/cmd/go/internal/work/exec.go
+++ b/src/cmd/go/internal/work/exec.go +++ b/src/cmd/go/internal/work/exec.go
@@ -546,6 +546,23 @@ func (b *Builder) build(ctx context.Context, a *Action) (err error) { @@ -539,6 +539,23 @@ func (b *Builder) build(ctx context.Context, a *Action) (err error) {
return errors.New("cannot compile Go " + p.Module.GoVersion + " code") return err
} }
+ if goRootPrecious && (a.Package.Standard || a.Package.Goroot) { + if goRootPrecious && (a.Package.Standard || a.Package.Goroot) {
@@ -93,7 +94,7 @@ index 62e1774..cde867b 100644
if err := b.Mkdir(a.Objdir); err != nil { if err := b.Mkdir(a.Objdir); err != nil {
return err return err
} }
@@ -1643,6 +1660,14 @@ func (b *Builder) linkShared(ctx context.Context, a *Action) (err error) { @@ -1722,6 +1739,14 @@ func (b *Builder) linkShared(ctx context.Context, a *Action) (err error) {
return err return err
} }
@@ -109,5 +110,5 @@ index 62e1774..cde867b 100644
return err return err
} }
-- --
2.30.2 2.43.0

View File

@@ -1,4 +1,4 @@
From 0ba747e6a4b251a0d9eed0cfd8f8c491bb508040 Mon Sep 17 00:00:00 2001 From 619991feab04f331d081a91243434ccd859f611d Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex.kanavin@gmail.com> From: Alexander Kanavin <alex.kanavin@gmail.com>
Date: Mon, 23 Nov 2020 19:22:04 +0000 Date: Mon, 23 Nov 2020 19:22:04 +0000
Subject: [PATCH 7/9] exec.go: do not write linker flags into buildids Subject: [PATCH 7/9] exec.go: do not write linker flags into buildids
@@ -9,16 +9,18 @@ To make this acceptable to upstream, we probably need to trim the flags,
removing those known to be buildhost-specific. removing those known to be buildhost-specific.
Upstream-Status: Inappropriate [needs upstream discussion] Upstream-Status: Inappropriate [needs upstream discussion]
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
--- ---
src/cmd/go/internal/work/exec.go | 4 ++-- src/cmd/go/internal/work/exec.go | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-) 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 diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go
index cde867b..5cb1812 100644 index 0ea5316..d7e2d51 100644
--- a/src/cmd/go/internal/work/exec.go --- a/src/cmd/go/internal/work/exec.go
+++ b/src/cmd/go/internal/work/exec.go +++ b/src/cmd/go/internal/work/exec.go
@@ -1331,7 +1331,7 @@ func (b *Builder) linkActionID(a *Action) cache.ActionID { @@ -1357,7 +1357,7 @@ func (b *Builder) linkActionID(a *Action) cache.ActionID {
} }
// Toolchain-dependent configuration, shared with b.linkSharedActionID. // Toolchain-dependent configuration, shared with b.linkSharedActionID.
@@ -27,7 +29,7 @@ index cde867b..5cb1812 100644
// Input files. // Input files.
for _, a1 := range a.Deps { for _, a1 := range a.Deps {
@@ -1626,7 +1626,7 @@ func (b *Builder) linkSharedActionID(a *Action) cache.ActionID { @@ -1705,7 +1705,7 @@ func (b *Builder) linkSharedActionID(a *Action) cache.ActionID {
fmt.Fprintf(h, "goos %s goarch %s\n", cfg.Goos, cfg.Goarch) fmt.Fprintf(h, "goos %s goarch %s\n", cfg.Goos, cfg.Goarch)
// Toolchain-dependent configuration, shared with b.linkActionID. // Toolchain-dependent configuration, shared with b.linkActionID.
@@ -37,5 +39,5 @@ index cde867b..5cb1812 100644
// Input files. // Input files.
for _, a1 := range a.Deps { for _, a1 := range a.Deps {
-- --
2.30.2 2.43.0

View File

@@ -1,4 +1,4 @@
From 1cbb416538a9c7c3fbedcb23f4d90d5c48becca8 Mon Sep 17 00:00:00 2001 From e0999902687e2e394499f7153db8d62440c4dab0 Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex.kanavin@gmail.com> From: Alexander Kanavin <alex.kanavin@gmail.com>
Date: Tue, 10 Nov 2020 16:33:27 +0000 Date: Tue, 10 Nov 2020 16:33:27 +0000
Subject: [PATCH 8/9] src/cmd/dist/buildgo.go: do not hardcode host compilers Subject: [PATCH 8/9] src/cmd/dist/buildgo.go: do not hardcode host compilers
@@ -8,16 +8,18 @@ These come from $CC/$CXX on the build host and are not useful on targets;
additionally as they contain host specific paths, this helps reproducibility. additionally as they contain host specific paths, this helps reproducibility.
Upstream-Status: Inappropriate [needs upstream discussion] Upstream-Status: Inappropriate [needs upstream discussion]
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
--- ---
src/cmd/dist/buildgo.go | 8 ++++---- src/cmd/dist/buildgo.go | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-) 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/cmd/dist/buildgo.go b/src/cmd/dist/buildgo.go diff --git a/src/cmd/dist/buildgo.go b/src/cmd/dist/buildgo.go
index 29b0167..63a49f0 100644 index 884e9d7..2f52eda 100644
--- a/src/cmd/dist/buildgo.go --- a/src/cmd/dist/buildgo.go
+++ b/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.Fprintf(&buf, "package cfg\n")
fmt.Fprintln(&buf) fmt.Fprintln(&buf)
fmt.Fprintf(&buf, "const DefaultPkgConfig = `%s`\n", defaultpkgconfig) fmt.Fprintf(&buf, "const DefaultPkgConfig = `%s`\n", defaultpkgconfig)
@@ -28,7 +30,7 @@ index 29b0167..63a49f0 100644
writefile(buf.String(), file, writeSkipSame) writefile(buf.String(), file, writeSkipSame)
return 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.Fprintf(&buf, "package main\n")
fmt.Fprintln(&buf) fmt.Fprintln(&buf)
fmt.Fprintf(&buf, "const defaultPkgConfig = `%s`\n", defaultpkgconfig) fmt.Fprintf(&buf, "const defaultPkgConfig = `%s`\n", defaultpkgconfig)
@@ -40,5 +42,5 @@ index 29b0167..63a49f0 100644
} }
-- --
2.30.2 2.43.0

View File

@@ -1,4 +1,4 @@
From 18011f72125bbea273d07ee5d792ac0ce6059572 Mon Sep 17 00:00:00 2001 From 6c2438f187ca912c54a71b4ac65ab98999a019d2 Mon Sep 17 00:00:00 2001
From: Richard Purdie <richard.purdie@linuxfoundation.org> From: Richard Purdie <richard.purdie@linuxfoundation.org>
Date: Sat, 2 Jul 2022 23:08:13 +0100 Date: Sat, 2 Jul 2022 23:08:13 +0100
Subject: [PATCH 9/9] go: Filter build paths on staticly linked arches Subject: [PATCH 9/9] go: Filter build paths on staticly linked arches
@@ -11,17 +11,18 @@ on mips/ppc.
Upstream-Status: Submitted [https://github.com/golang/go/pull/56410] Upstream-Status: Submitted [https://github.com/golang/go/pull/56410]
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
--- ---
src/cmd/go/internal/load/pkg.go | 15 +++++++++++++-- src/cmd/go/internal/load/pkg.go | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-) 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 diff --git a/src/cmd/go/internal/load/pkg.go b/src/cmd/go/internal/load/pkg.go
index f427e29..6d6dc4e 100644 index c0e6265..b199fee 100644
--- a/src/cmd/go/internal/load/pkg.go --- a/src/cmd/go/internal/load/pkg.go
+++ b/src/cmd/go/internal/load/pkg.go +++ b/src/cmd/go/internal/load/pkg.go
@@ -2270,6 +2270,17 @@ func (p *Package) collectDeps() { @@ -2269,6 +2269,17 @@ func appendBuildSetting(info *debug.BuildInfo, key, value string) {
// to their VCS information (vcsStatusError). info.Settings = append(info.Settings, debug.BuildSetting{Key: key, Value: value})
var vcsStatusCache par.Cache }
+func filterCompilerFlags(flags string) string { +func filterCompilerFlags(flags string) string {
+ var newflags []string + var newflags []string
@@ -34,10 +35,10 @@ index f427e29..6d6dc4e 100644
+ return strings.Join(newflags, " ") + return strings.Join(newflags, " ")
+} +}
+ +
// setBuildInfo gathers build information, formats it as a string to be // setBuildInfo gathers build information and sets it into
// embedded in the binary, then sets p.Internal.BuildInfo to that string. // p.Internal.BuildInfo, which will later be formatted as a string and embedded
// setBuildInfo should only be called on a main package with no errors. // in the binary. setBuildInfo should only be called on a main package with no
@@ -2376,7 +2387,7 @@ func (p *Package) setBuildInfo(autoVCS bool) { @@ -2376,7 +2387,7 @@ func (p *Package) setBuildInfo(ctx context.Context, autoVCS bool) {
if gcflags := BuildGcflags.String(); gcflags != "" && cfg.BuildContext.Compiler == "gc" { if gcflags := BuildGcflags.String(); gcflags != "" && cfg.BuildContext.Compiler == "gc" {
appendSetting("-gcflags", gcflags) appendSetting("-gcflags", gcflags)
} }
@@ -46,7 +47,7 @@ index f427e29..6d6dc4e 100644
// https://go.dev/issue/52372: only include ldflags if -trimpath is not set, // https://go.dev/issue/52372: only include ldflags if -trimpath is not set,
// since it can include system paths through various linker flags (notably // since it can include system paths through various linker flags (notably
// -extar, -extld, and -extldflags). // -extar, -extld, and -extldflags).
@@ -2422,7 +2433,7 @@ func (p *Package) setBuildInfo(autoVCS bool) { @@ -2419,7 +2430,7 @@ func (p *Package) setBuildInfo(ctx context.Context, autoVCS bool) {
// subset of flags that are known not to be paths? // subset of flags that are known not to be paths?
if cfg.BuildContext.CgoEnabled && !cfg.BuildTrimpath { if cfg.BuildContext.CgoEnabled && !cfg.BuildTrimpath {
for _, name := range []string{"CGO_CFLAGS", "CGO_CPPFLAGS", "CGO_CXXFLAGS", "CGO_LDFLAGS"} { for _, name := range []string{"CGO_CFLAGS", "CGO_CPPFLAGS", "CGO_CXXFLAGS", "CGO_LDFLAGS"} {
@@ -56,5 +57,5 @@ index f427e29..6d6dc4e 100644
} }
appendSetting("GOARCH", cfg.BuildContext.GOARCH) appendSetting("GOARCH", cfg.BuildContext.GOARCH)
-- --
2.30.2 2.43.0