* [PATCH] go-cross-canadian: fix binaries install and GOARCH
@ 2025-08-07 22:44 Osama Abdelkader
2025-08-08 0:49 ` Khem Raj
0 siblings, 1 reply; 3+ messages in thread
From: Osama Abdelkader @ 2025-08-07 22:44 UTC (permalink / raw)
To: yocto; +Cc: raj.khem, Osama Abdelkader
Canadian cross builds produce host-side binaries (x86_64), but
GOARCH=arm was leaking in from go-${PV}.inc/go-common.inc, causing
arch mismatch and package QA errors. Explicitly set GOARCH=amd64 to
ensure the correct host architecture is used.
Also fix do_install to correctly install all binaries from
${GO_BUILD_BINDIR} by using 'find -type f' to avoid issues when the
directory contains subdirectories (e.g. "linux_arm").
Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
---
meta/recipes-devtools/go/go-cross-canadian.inc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/meta/recipes-devtools/go/go-cross-canadian.inc b/meta/recipes-devtools/go/go-cross-canadian.inc
index 39330fc98b..14f0100bdc 100644
--- a/meta/recipes-devtools/go/go-cross-canadian.inc
+++ b/meta/recipes-devtools/go/go-cross-canadian.inc
@@ -5,6 +5,8 @@ DEPENDS = "go-native virtual/${HOST_PREFIX}go virtual/nativesdk-${HOST_PREFIX}go
virtual/nativesdk-compilerlibs"
PN = "go-cross-canadian-${TRANSLATED_TARGET_ARCH}"
+GOARCH = "amd64"
+
# it uses gcc on build machine during go-cross-canadian bootstrap, but
# the gcc version may be old and not support option '-fmacro-prefix-map'
# which is one of default values of DEBUG_PREFIX_MAP
@@ -51,7 +53,7 @@ do_install() {
install -d ${D}${libdir}/go/pkg/tool
cp --preserve=mode,timestamps -R ${B}/pkg/tool/${HOST_GOTUPLE} ${D}${libdir}/go/pkg/tool/
install -d ${D}${bindir} ${D}${libdir}/go/bin
- for f in ${B}/${GO_BUILD_BINDIR}/*
+ for f in $(find ${B}/${GO_BUILD_BINDIR} -type f)
do
base=`basename $f`
install -m755 $f ${D}${libdir}/go/bin
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] go-cross-canadian: fix binaries install and GOARCH
2025-08-07 22:44 [PATCH] go-cross-canadian: fix binaries install and GOARCH Osama Abdelkader
@ 2025-08-08 0:49 ` Khem Raj
2025-08-09 21:17 ` Osama Ahmed
0 siblings, 1 reply; 3+ messages in thread
From: Khem Raj @ 2025-08-08 0:49 UTC (permalink / raw)
To: Osama Abdelkader; +Cc: yocto
On Thu, Aug 7, 2025 at 3:44 PM Osama Abdelkader
<osama.abdelkader@gmail.com> wrote:
>
> Canadian cross builds produce host-side binaries (x86_64), but
> GOARCH=arm was leaking in from go-${PV}.inc/go-common.inc, causing
> arch mismatch and package QA errors. Explicitly set GOARCH=amd64 to
> ensure the correct host architecture is used.
>
> Also fix do_install to correctly install all binaries from
> ${GO_BUILD_BINDIR} by using 'find -type f' to avoid issues when the
> directory contains subdirectories (e.g. "linux_arm").
>
> Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
> ---
> meta/recipes-devtools/go/go-cross-canadian.inc | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/meta/recipes-devtools/go/go-cross-canadian.inc b/meta/recipes-devtools/go/go-cross-canadian.inc
> index 39330fc98b..14f0100bdc 100644
> --- a/meta/recipes-devtools/go/go-cross-canadian.inc
> +++ b/meta/recipes-devtools/go/go-cross-canadian.inc
> @@ -5,6 +5,8 @@ DEPENDS = "go-native virtual/${HOST_PREFIX}go virtual/nativesdk-${HOST_PREFIX}go
> virtual/nativesdk-compilerlibs"
> PN = "go-cross-canadian-${TRANSLATED_TARGET_ARCH}"
>
> +GOARCH = "amd64"
We also have arm64 build hosts these days. Will it work on those too ?
> +
> # it uses gcc on build machine during go-cross-canadian bootstrap, but
> # the gcc version may be old and not support option '-fmacro-prefix-map'
> # which is one of default values of DEBUG_PREFIX_MAP
> @@ -51,7 +53,7 @@ do_install() {
> install -d ${D}${libdir}/go/pkg/tool
> cp --preserve=mode,timestamps -R ${B}/pkg/tool/${HOST_GOTUPLE} ${D}${libdir}/go/pkg/tool/
> install -d ${D}${bindir} ${D}${libdir}/go/bin
> - for f in ${B}/${GO_BUILD_BINDIR}/*
> + for f in $(find ${B}/${GO_BUILD_BINDIR} -type f)
> do
> base=`basename $f`
> install -m755 $f ${D}${libdir}/go/bin
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] go-cross-canadian: fix binaries install and GOARCH
2025-08-08 0:49 ` Khem Raj
@ 2025-08-09 21:17 ` Osama Ahmed
0 siblings, 0 replies; 3+ messages in thread
From: Osama Ahmed @ 2025-08-09 21:17 UTC (permalink / raw)
To: Khem Raj; +Cc: yocto
[-- Attachment #1: Type: text/plain, Size: 2325 bytes --]
Thanks for the review, I replaced it with HOST_GOARCH:
https://patchwork.yoctoproject.org/project/oe-core/patch/20250808161533.13752-1-osama.abdelkader@gmail.com/
On Fri, Aug 8, 2025 at 2:50 AM Khem Raj <raj.khem@gmail.com> wrote:
> On Thu, Aug 7, 2025 at 3:44 PM Osama Abdelkader
> <osama.abdelkader@gmail.com> wrote:
> >
> > Canadian cross builds produce host-side binaries (x86_64), but
> > GOARCH=arm was leaking in from go-${PV}.inc/go-common.inc, causing
> > arch mismatch and package QA errors. Explicitly set GOARCH=amd64 to
> > ensure the correct host architecture is used.
> >
> > Also fix do_install to correctly install all binaries from
> > ${GO_BUILD_BINDIR} by using 'find -type f' to avoid issues when the
> > directory contains subdirectories (e.g. "linux_arm").
> >
> > Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
> > ---
> > meta/recipes-devtools/go/go-cross-canadian.inc | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/meta/recipes-devtools/go/go-cross-canadian.inc
> b/meta/recipes-devtools/go/go-cross-canadian.inc
> > index 39330fc98b..14f0100bdc 100644
> > --- a/meta/recipes-devtools/go/go-cross-canadian.inc
> > +++ b/meta/recipes-devtools/go/go-cross-canadian.inc
> > @@ -5,6 +5,8 @@ DEPENDS = "go-native virtual/${HOST_PREFIX}go
> virtual/nativesdk-${HOST_PREFIX}go
> > virtual/nativesdk-compilerlibs"
> > PN = "go-cross-canadian-${TRANSLATED_TARGET_ARCH}"
> >
> > +GOARCH = "amd64"
>
> We also have arm64 build hosts these days. Will it work on those too ?
>
> > +
> > # it uses gcc on build machine during go-cross-canadian bootstrap, but
> > # the gcc version may be old and not support option '-fmacro-prefix-map'
> > # which is one of default values of DEBUG_PREFIX_MAP
> > @@ -51,7 +53,7 @@ do_install() {
> > install -d ${D}${libdir}/go/pkg/tool
> > cp --preserve=mode,timestamps -R ${B}/pkg/tool/${HOST_GOTUPLE}
> ${D}${libdir}/go/pkg/tool/
> > install -d ${D}${bindir} ${D}${libdir}/go/bin
> > - for f in ${B}/${GO_BUILD_BINDIR}/*
> > + for f in $(find ${B}/${GO_BUILD_BINDIR} -type f)
> > do
> > base=`basename $f`
> > install -m755 $f ${D}${libdir}/go/bin
> > --
> > 2.43.0
> >
>
[-- Attachment #2: Type: text/html, Size: 3223 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-08-09 21:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-07 22:44 [PATCH] go-cross-canadian: fix binaries install and GOARCH Osama Abdelkader
2025-08-08 0:49 ` Khem Raj
2025-08-09 21:17 ` Osama Ahmed
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).