digitallumens / meta-golang

OpenEmbedded/Yocto layer with recipes for go-lang
MIT License
16 stars 11 forks source link

fatal error: gnu/stubs-soft.h: No such file or directory #1

Closed davidlawson closed 8 years ago

davidlawson commented 9 years ago

I'm getting the following error when compiling for a Cubox-i:

| In file included from .../build/tmp/sysroots/cubox-i/usr/include/features.h:389:0,
|                  from .../build/tmp/sysroots/cubox-i/usr/include/sys/types.h:25,
|                  from pkg/runtime/cgo/cgo.go:26:
| .../build/tmp/sysroots/cubox-i/usr/include/gnu/stubs.h:7:29: fatal error: gnu/stubs-soft.h: No such file or directory
|  # include <gnu/stubs-soft.h>
|                              ^
| compilation terminated.

I'm pretty sure my image is supposed to be using hard floats.

celledge commented 9 years ago

Which recipe are you building when it errors?

I'm building for an ATSAMA5D33. My system uses hard floats and does not have gnu/stubs-soft.h either.

My Machine File has these lines in it: require conf/machine/include/tune-cortexa5.inc DEFAULTTUNE = "cortexa5thf"

davidlawson commented 9 years ago

just golang-cross. https://github.com/Freescale/meta-fsl-arm-extra/blob/master/conf/machine/cubox-i.conf includes https://github.com/Freescale/meta-fsl-arm/blob/master/conf/machine/include/imx-base.inc which contains DEFAULTTUNE_mx6 ?= "cortexa9hf-neon"

celledge commented 9 years ago

I'm not sure what to suggest without trying to build for the board myself. As you can see from the recipes I'm just sourcing the gcc-4.8 recipe from meta with a few modifications to have it build the go language support instead. At this point I would have to dig into what assumptions the compiler is making and why.

I'm not yet familiar with that process so, you will probably be better off digging around yourself if you want an answer anytime soon.

whirm commented 9 years ago

I'm hitting the same error here with my cubieboard 2 build, any hints on how to solve this?

fbertux commented 9 years ago

Hi! I'm trying to use this layer with poky version fido and I got the same error. Any update on this?

whirm commented 9 years ago

I was forwarded this discussion: http://patchwork.openembedded.org/patch/93139/ but I haven't had time to read it closely yet.

fbertux commented 9 years ago

I made some modifications on make.bash script to set the correct CFLAGS for CC_FOR_TARGET. Can you try use https://github.com/fbertux/meta-golang on branch fido and test if compile?

whirm commented 9 years ago

@fbertux I'm using poky fido and it's building gcc-4.9, so I've added recipes for it: https://github.com/whirm/meta-golang/tree/float_fix And I'm still getting the error when building: http://paste.debian.net/204676/

fbertux commented 9 years ago

@whirm I'm able to work on this next monday. I updated my branch fido to be more simple. The error "gnu/stubs-soft.h: No such file or directory" I fixed using the variable ${TARGET_CC_ARCH} to set correct cflags. I'm using wandboard-solo with hard float. If you won't get fix the error next week I can test using a build for cubieboard.

whirm commented 9 years ago

@fbertux I've rebased my branch and removed all non-necessary layers just in case, still getting the error: http://paste.debian.net/205528/ Let me know if I can help with anything. Thanks!

fbertux commented 9 years ago

@whirm Try run bitbake golang-cross and check if appears the same error.

whirm commented 9 years ago

I rebased and it works now! I haven't tried to compile anything yet though. Tried executing the native go binary and it seems to run fine.

I'll try to build syncthing with it ASAP.

Thanks!

whirm commented 9 years ago

@fbertux Is the example recipe working for you? I tried it and gccgo-cross fails with the same with the same soft-float error.

http://paste.debian.net/221022/ http://paste.debian.net/221023/

I'm running on your fido branch with the gcc-4.9 recipes on top.

fbertux commented 9 years ago

@whirm Only golang-cross is working, I'm still working on gccgo.

whirm commented 9 years ago

I see, thanks!

otavio commented 9 years ago

Those errors are due missing toolchain flags (TOOLCHAIN_OPTIONS, IRRC) for the compiler. This is not related to the layer.

celledge commented 9 years ago

I'm sorry, but this really appears to be a toolchain issue. Either something is misconfigured for your target platform or something funny is happening in gcc. I don't have much experience with either of these topics, so you might be better off seeing if you can manually build a gccgo toolchain for your intended target outside of yocto.

celledge commented 9 years ago

If this problem is still happening, you can try the bbappend branch of meta-golang. It is now based on gcc-4.9.2, and I cleaned up a few target CC flag issues that were happening.