Bug 12704 - Go fails to build on older hosts
Summary: Go fails to build on older hosts
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: devtools / tool chain (show other bugs)
Version: 2.5
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 2.5 M4
Assignee: Matt Madison
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2018-04-20 14:50 UTC by Ross Burton
Modified: 2018-04-26 07:59 UTC (History)
5 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ross Burton 2018-04-20 14:50:16 UTC
ERROR: go-runtime-1.9.4-r0 do_compile: Function failed: do_compile (log file is located at /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-world-lsb/build/build/tmp/work/i586-poky-linux/go-runtime/1.9.4-r0/temp/log.do_compile.54340)
...
| ##### Building Go toolchain using /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-world-lsb/build/build/tmp/work/i586-poky-linux/go-runtime/1.9.4-r0/recipe-sysroot-native/usr/lib/go.
| # runtime/cgo
| gcc: error: unrecognized command line option ‘-fstack-protector-strong’


Looks like it's trying to use the host compiler with target CFLAGS, which isn't right.

This broke a test-M4 build so hopefully we can get this fixed asap.

https://autobuilder.yocto.io/builders/nightly-world-lsb/builds/941/steps/BuildImages/logs/stdio
Comment 1 Matt Madison 2018-04-21 06:16:19 UTC
The issue is specifically with CGO_CFLAGS and CGO_LDFLAGS, which are being set in go-runtime.inc to the target values.  For the go 1.10 runtime build, that's the right setting, since it only builds target binaries.  That's not good for the go 1.9 runtime build, though, since it builds the host binaries before building the target binaries.

Overriding those settings on the host-side invocation of make.bash should take care of this.