ERROR: go-native-1.4.3-r0 do_compile: Function failed

I upgraded from LinuxImageV2.6.1 to LinuxImageV2.7 using these commands:

repo init -b LinuxImageV2.7
repo sync

Then I tried to rebuild angstrom-lxde-image:

. export
bitbake -k angstrom-lxde-image

But it fails with ERROR: Task (/home/user/oe-core/build/../layers/meta-snappy/recipes-devtools/go-cross/ failed with exit code '1'

This is the log file.

I found a bug report which may be relevant. I re-tried after bitbake -c cleanall go-native with no success.

EDIT: Fixed order of repo commands.

Using bitbake -g -u depexp angstrom-lxde-image I could analyse the dependencies:

  +-+ packagegroup-snapd   SUMMARY = "A small demo image to demo Snappy running on OpenEmbedded/Yocto"
    +-+ snapd
      +-+ go-cross
        + go-native

I don’t think that we need Snappy, so I started to configure our own image which would have to be done anyway.


Native recipes get compiled by the toolchain of your buildhost so it would be interesting what distro you are using.

Also please report the GCC/Binutils versions installed, i.e.:

gcc --version
as --version

As this bug report suggests, does it help set CGO_ENABLED to 0?


P.S.: snapd is pulled in here:

Gentoo Linux 4.9.34 x86_64

gcc --version
gcc (Gentoo 5.4.0-r3 p1.3, pie-0.6.5) 5.4.0

as --version
GNU assembler (Gentoo 2.28 p1.2) 2.28

Setting export CGO_ENABLED = "0" in meta-snappy/recipes-devtools/go-cross/ works around the issue. But according to first comment in “go compiler 1.4 & 1.5 build errors with binutils 2.27”:

Go 1.4 is end of life.

Shouldn’t Go be upgraded?

Good to hear that this works around the issue.

Shouldn’t Go be upgraded?

Probably, but the full line reads

Go 1.4 is end of life. If you are using Go 1.4 to bootstrap a later version, disable cgo with …

which is what meta-snappy does for the go-cross 1.6 (but they also seem to use go-native 1.4 for the snapd recipe).

Note that for the OE pyro version the maintainers of meta-snappy removed the go recipes in favor of using the ones now provided in oe-core so we will get that update going forward.