]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
go-cross-canadian: fix binaries install and GOARCH
authorOsama Abdelkader <osama.abdelkader@gmail.com>
Tue, 12 Aug 2025 20:50:50 +0000 (22:50 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 14 Aug 2025 09:14:30 +0000 (10:14 +0100)
set GOARCH to HOST_GOARCH which is set from SDKMACHINE,
since GOARCH defaults to TARGET_GOARCH, which is set from MACHINE (wrong arch).

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>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/go/go-cross-canadian.inc

index 39330fc98b0c8c680a2b85254f11a5111e304c55..4a6f2f4c36002e06d60f9faa172a6bb5baf2f90c 100644 (file)
@@ -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 = "${HOST_GOARCH}"
+
 # 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