Bug 14859

Summary: Go selftest fails when target=qemux86-64 but host=aarch64
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Ross Burton <ross.burton>
Component: devtools / tool chainAssignee: Unassigned <unassigned>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: meta.mr.watcher, meta.watcher, raj.khem, randy.macleod
Version: 4.2   
Target Milestone: 4.1 M3   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Ross Burton 2022-07-12 10:42:24 UTC
If I run the gotoolchain selftest on an aarch64 host with MACHINE=qemux86-64, the test fails:

AssertionError: Command 'cd /tmp/SDKQAg7yt6cs3/go/src/github.com/direnv/direnv; . /tmp/SDKQAg7yt6cs3/environment-setup-core2-64-poky-linux; export GOPATH=/tmp/SDKQAg7yt6cs3/go; ${CROSS_COMPILE}go build' returned non-zero exit status 2:
go: downloading github.com/BurntSushi/toml v0.3.1
go: downloading golang.org/x/mod v0.4.0
go: downloading github.com/direnv/go-dotenv v0.0.0-20181227095604-4cce6d1a66f7
go: downloading github.com/mattn/go-isatty v0.0.12
go: downloading golang.org/x/sys v0.0.0-20200116001909-b77594299b42
# github.com/direnv/direnv
cannot find package runtime/cgo (using -importcfg)
/tmp/SDKQAg7yt6cs3/sysroots/aarch64-pokysdk-linux/usr/lib/x86_64-poky-linux/go/pkg/tool/linux_arm64/link: cannot open file : open : no such file or directory
Comment 1 Ross Burton 2022-07-12 13:38:07 UTC
https://bugzilla.yoctoproject.org/show_bug.cgi?id=14860 is another Go/SDK issue.
Comment 2 Ross Burton 2022-07-25 15:53:59 UTC
CGO_ENABLED=1 needed to be set.  Patch on the list.
Comment 3 Ross Burton 2022-07-26 15:37:28 UTC
Fixed in 19be072619d39267df44f23c4c8b64f3808f6148.