Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ require go-common.inc

FILESEXTRAPATHS:prepend := "${FILE_DIRNAME}/go:"

LIC_FILES_CHKSUM = "file://LICENSE;md5=5d4950ecb7b26d2c5e4e7b4e0dd74707"
LIC_FILES_CHKSUM = "file://LICENSE;md5=7998cb338f82d15c0eff93b7004d272a"

SRC_URI += "\
file://0001-cmd-go-make-content-based-hash-generation-less-pedan.patch \
Expand All @@ -14,5 +14,6 @@ SRC_URI += "\
file://0007-exec.go-filter-out-build-specific-paths-from-linker-.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://0010-cmd-go-clear-GOROOT-for-func-ldShared-when-trimpath-.patch \
"
SRC_URI[main.sha256sum] = "ac9c723f224969aee624bc34fd34c9e13f2a212d75c71c807de644bb46e112f6"
SRC_URI[main.sha256sum] = "1c646875d0aa8799133184ed57cf79ff24bdefe8c8820470602a9d3d6d9192b8"
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
SUMMARY = "Go programming language compiler (upstream binary for bootstrap)"
HOMEPAGE = " http://golang.org/"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=5d4950ecb7b26d2c5e4e7b4e0dd74707"
LIC_FILES_CHKSUM = "file://LICENSE;md5=7998cb338f82d15c0eff93b7004d272a"

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] = "904b924d435eaea086515bc63235b192ea441bd8c9b198c507e85009e6e4c7f0"
SRC_URI[go_linux_arm64.sha256sum] = "8d21325bfcf431be3660527c1a39d3d9ad71535fabdf5041c826e44e31642b5a"
SRC_URI[go_linux_ppc64le.sha256sum] = "5312bb420ac0b59175a58927e70b4660b14ab7319aab54398b6071fabcbfbb09"
SRC_URI[go_linux_amd64.sha256sum] = "2b2cfc7148493da5e73981bffbf3353af381d5f93e789c82c79aff64962eb556"
SRC_URI[go_linux_arm64.sha256sum] = "9d89a3ea57d141c2b22d70083f2c8459ba3890f2d9e818e7e933b75614936565"
SRC_URI[go_linux_ppc64le.sha256sum] = "dbd82b50530ead2beb1fd72215117380df3cb16332b51467116dc35b3691dd75"

UPSTREAM_CHECK_URI = "https://golang.org/dl/"
UPSTREAM_CHECK_REGEX = "go(?P<pver>\d+(\.\d+)+)\.linux"
Expand Down
1 change: 0 additions & 1 deletion compat/dunfell/backport-go/go/go-native_1.22.5.bb

This file was deleted.

1 change: 1 addition & 0 deletions compat/dunfell/backport-go/go/go-native_1.26.3.bb
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
From 9b3ebef0356594a447906f00fe80584952c08289 Mon Sep 17 00:00:00 2001
From 51c04a9a19dec5a48fa0f38324dc2480b7a859e4 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 28 Mar 2022 10:59:03 -0700
Subject: [PATCH] cmd/go: make content-based hash generation less pedantic
Date: Sat, 22 Feb 2025 03:24:48 -0800
Subject: [PATCH 01/11] cmd/go: make content-based hash generation less
pedantic

Go 1.10's build tool now uses content-based hashes to
determine when something should be built or re-built.
Expand All @@ -26,16 +27,19 @@ Signed-off-by: Alex Kube <alexander.j.kube@gmail.com>
Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>

Rebase to 1.23.4
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
src/cmd/go/internal/envcmd/env.go | 2 +-
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 c7c2e83..4a90d9d 100644
index 7c370d427f..c2441f7695 100644
--- a/src/cmd/go/internal/envcmd/env.go
+++ b/src/cmd/go/internal/envcmd/env.go
@@ -189,7 +189,7 @@ func ExtraEnvVarsCostly() []cfg.EnvVar {
@@ -219,7 +219,7 @@ func ExtraEnvVarsCostly(loaderstate *modload.State) []cfg.EnvVar {
}
}()

Expand All @@ -45,10 +49,10 @@ index c7c2e83..4a90d9d 100644
// 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 e05471b..9724cd0 100644
index 7b073165d5..1f618be0bb 100644
--- a/src/cmd/go/internal/work/exec.go
+++ b/src/cmd/go/internal/work/exec.go
@@ -232,6 +232,8 @@ func (b *Builder) Do(ctx context.Context, root *Action) {
@@ -257,6 +257,8 @@ func (b *Builder) Do(ctx context.Context, root *Action) {
writeActionGraph()
}

Expand All @@ -57,7 +61,7 @@ index e05471b..9724cd0 100644
// buildActionID computes the action ID for a build action.
func (b *Builder) buildActionID(a *Action) cache.ActionID {
p := a.Package
@@ -253,7 +255,7 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
@@ -278,7 +280,7 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
if p.Module != nil {
fmt.Fprintf(h, "module %s@%s\n", p.Module.Path, p.Module.Version)
}
Expand All @@ -66,7 +70,7 @@ index e05471b..9724cd0 100644
// The Go compiler always hides the exact value of $GOROOT
// when building things in GOROOT.
//
@@ -285,9 +287,9 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
@@ -313,9 +315,9 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
}
if len(p.CgoFiles)+len(p.SwigFiles)+len(p.SwigCXXFiles) > 0 {
fmt.Fprintf(h, "cgo %q\n", b.toolID("cgo"))
Expand All @@ -78,15 +82,16 @@ index e05471b..9724cd0 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.
@@ -295,14 +297,14 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
fmt.Fprintf(h, "CC ID=%q\n", ccID)
@@ -325,7 +327,7 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
fmt.Fprintf(h, "CC ID ERROR=%q\n", err)
}
if len(p.CXXFiles)+len(p.SwigCXXFiles) > 0 {
- cxxExe := b.cxxExe()
+ cxxExe := filterCompilerFlags(b.cxxExe(), true)
fmt.Fprintf(h, "CXX=%q %q\n", cxxExe, cxxflags)
if cxxID, _, err := b.gccToolID(cxxExe[0], "c++"); err == nil {
fmt.Fprintf(h, "CXX ID=%q\n", cxxID)
@@ -334,7 +336,7 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
}
}
if len(p.FFiles) > 0 {
Expand All @@ -95,7 +100,7 @@ index e05471b..9724cd0 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)
@@ -319,7 +321,7 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
@@ -353,7 +355,7 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
}
}
if p.Internal.BuildInfo != nil {
Expand All @@ -104,7 +109,7 @@ index e05471b..9724cd0 100644
}

// Configuration specific to compiler toolchain.
@@ -2679,8 +2681,25 @@ func envList(key, def string) []string {
@@ -2804,8 +2806,25 @@ func envList(key, def string) []string {
return args
}

Expand All @@ -131,8 +136,8 @@ index e05471b..9724cd0 100644
if cppflags, err = buildFlags("CPPFLAGS", "", p.CgoCPPFLAGS, checkCompilerFlags); err != nil {
return
}
@@ -2696,6 +2715,13 @@ func (b *Builder) CFlags(p *load.Package) (cppflags, cflags, cxxflags, fflags, l
if ldflags, err = buildFlags("LDFLAGS", defaultCFlags, p.CgoLDFLAGS, checkLinkerFlags); err != nil {
@@ -2821,6 +2840,13 @@ func (b *Builder) CFlags(p *load.Package) (cppflags, cflags, cxxflags, fflags, l
if ldflags, err = buildFlags("LDFLAGS", DefaultCFlags, p.CgoLDFLAGS, checkLinkerFlags); err != nil {
return
}
+ if filtered {
Expand All @@ -145,21 +150,24 @@ index e05471b..9724cd0 100644

return
}
@@ -2713,7 +2739,7 @@ func (b *Builder) cgo(a *Action, cgoExe, objdir string, pcCFLAGS, pcLDFLAGS, cgo
p := a.Package
sh := b.Shell(a)
@@ -2909,7 +2935,7 @@ func (b *Builder) runCgo(ctx context.Context, a *Action) error {
cgoExe := base.Tool("cgo")
cgofiles = mkAbsFiles(p.Dir, cgofiles)

- cgoCPPFLAGS, cgoCFLAGS, cgoCXXFLAGS, cgoFFLAGS, cgoLDFLAGS, err := b.CFlags(p)
+ cgoCPPFLAGS, cgoCFLAGS, cgoCXXFLAGS, cgoFFLAGS, cgoLDFLAGS, err := b.CFlags(p, false)
if err != nil {
return nil, nil, err
return err
}
@@ -3268,7 +3294,7 @@ func (b *Builder) swigOne(a *Action, file, objdir string, pcCFLAGS []string, cxx
@@ -3462,7 +3488,7 @@ func (b *Builder) swigOne(a *Action, file, objdir string, pcCFLAGS []string, cxx
p := a.Package
sh := b.Shell(a)

- cgoCPPFLAGS, cgoCFLAGS, cgoCXXFLAGS, _, _, err := b.CFlags(p)
+ cgoCPPFLAGS, cgoCFLAGS, cgoCXXFLAGS, _, _, err := b.CFlags(p, false)
if err != nil {
return "", "", err
return err
}
--
2.25.1

Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
From 687ff9d17f756145f9a58413070cccbd488d1ea2 Mon Sep 17 00:00:00 2001
From fdad9a0ea659cf2281a0df16b0f69f179605ec9a Mon Sep 17 00:00:00 2001
From: Alex Kube <alexander.j.kube@gmail.com>
Date: Wed, 23 Oct 2019 21:15:37 +0430
Subject: [PATCH] cmd/go: Allow GOTOOLDIR to be overridden in the environment
Subject: [PATCH 02/11] cmd/go: Allow GOTOOLDIR to be overridden in the
environment

to allow for split host/target build roots

Expand All @@ -19,10 +20,10 @@ Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go
index 32e59b4..06ee4de 100644
index 1f467647f5..b62e518030 100644
--- a/src/cmd/dist/build.go
+++ b/src/cmd/dist/build.go
@@ -259,7 +259,9 @@ func xinit() {
@@ -271,7 +271,9 @@ func xinit() {
}
xatexit(rmworkdir)

Expand All @@ -32,12 +33,12 @@ index 32e59b4..06ee4de 100644
+ }

goversion := findgoversion()
isRelease = strings.HasPrefix(goversion, "release.") || strings.HasPrefix(goversion, "go")
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
index a8daa2d..393ada3 100644
index 3b9f27e91d..ec043c1530 100644
--- a/src/cmd/go/internal/cfg/cfg.go
+++ b/src/cmd/go/internal/cfg/cfg.go
@@ -230,7 +230,11 @@ func SetGOROOT(goroot string, isTestGo bool) {
@@ -279,7 +279,11 @@ func SetGOROOT(goroot string, isTestGo bool) {
// 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.
Expand All @@ -50,3 +51,6 @@ index a8daa2d..393ada3 100644
}
}
}
--
2.25.1

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 01fe178b292db12d811811ff2d8d56b225e4b5e8 Mon Sep 17 00:00:00 2001
From 1546d837c69b654754ee137af1fa1c2f7500cfa2 Mon Sep 17 00:00:00 2001
From: Alex Kube <alexander.j.kube@gmail.com>
Date: Wed, 23 Oct 2019 21:16:32 +0430
Subject: [PATCH] ld: add soname to shareable objects
Subject: [PATCH 03/11] ld: add soname to shareable objects

so that OE's shared library dependency handling
can find them.
Expand All @@ -19,30 +19,33 @@ Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
1 file changed, 3 insertions(+)

diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go
index eab74dc..ae9bbc9 100644
index 2d8f964f35..dfc72e02c0 100644
--- a/src/cmd/link/internal/ld/lib.go
+++ b/src/cmd/link/internal/ld/lib.go
@@ -1576,6 +1576,7 @@ func (ctxt *Link) hostlink() {
@@ -1652,6 +1652,7 @@ func (ctxt *Link) hostlink() {
argv = append(argv, "-Wl,-z,relro")
}
argv = append(argv, "-shared")
+ argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile)))
if ctxt.HeadType == objabi.Hwindows {
argv = addASLRargs(argv, *flagAslr)
} else {
@@ -1591,6 +1592,7 @@ func (ctxt *Link) hostlink() {
@@ -1667,6 +1668,7 @@ func (ctxt *Link) hostlink() {
argv = append(argv, "-Wl,-z,relro")
}
argv = append(argv, "-shared")
+ argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile)))
case BuildModePlugin:
if ctxt.HeadType == objabi.Hdarwin {
argv = append(argv, "-dynamiclib")
@@ -1599,6 +1601,7 @@ func (ctxt *Link) hostlink() {
@@ -1675,6 +1677,7 @@ func (ctxt *Link) hostlink() {
argv = append(argv, "-Wl,-z,relro")
}
argv = append(argv, "-shared")
+ argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile)))
}
}

--
2.25.1

Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
From e47d157631d1b97403f253c63d361b7380b32c22 Mon Sep 17 00:00:00 2001
From b41aaa851f0074682fcd4bf07c891fbdf0fdf70c Mon Sep 17 00:00:00 2001
From: Alex Kube <alexander.j.kube@gmail.com>
Date: Wed, 23 Oct 2019 21:17:16 +0430
Subject: [PATCH] make.bash: override CC when building dist and go_bootstrap
Date: Sat, 22 Feb 2025 03:14:37 -0800
Subject: [PATCH 04/11] make.bash: override CC when building dist and
go_bootstrap

for handling OE cross-canadian builds.

Expand All @@ -13,24 +14,27 @@ Upstream-Status: Inappropriate [OE specific]

Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>

Rebase to 1.23.4
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
src/make.bash | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/make.bash b/src/make.bash
index 76ad516..074e129 100755
index b67ae1529f..b59cdabd09 100755
--- a/src/make.bash
+++ b/src/make.bash
@@ -198,7 +198,7 @@ if [[ "$GOROOT_BOOTSTRAP" == "$GOROOT" ]]; then
exit 1
fi
rm -f cmd/dist/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
@@ -153,7 +153,7 @@ fi
export GOROOT_BOOTSTRAP

bootstrapenv() {
- GOROOT="$GOROOT_BOOTSTRAP" GO111MODULE=off GOENV=off GOOS= GOARCH= GOEXPERIMENT= GOFLAGS= "$@"
+ CC="${BUILD_CC:-${CC}}" GOROOT="$GOROOT_BOOTSTRAP" GO111MODULE=off GOENV=off GOOS= GOARCH= GOEXPERIMENT= GOFLAGS= "$@"
}

# -e doesn't propagate out of eval, so check success by hand.
eval $(./cmd/dist/dist env -p || echo FAIL=true)
@@ -223,7 +223,7 @@ fi
export GOROOT="$(cd .. && pwd)"
@@ -216,7 +216,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.
Expand All @@ -39,3 +43,6 @@ index 76ad516..074e129 100755
rm -f ./cmd/dist/dist

# DO NOT ADD ANY NEW CODE HERE.
--
2.25.1

Loading
Loading