Bug 9272

Summary: BBCLASSEXTEND="cross" overrides do_install()
Product: [Build System, Metadata & Runtime] OE-Core Reporter: gus
Component: coreAssignee: Richard Purdie <richard.purdie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: meta.mr.watcher, meta.watcher, richard.purdie
Version: unspecified   
Target Milestone: 4.99   
Hardware: x86   
OS: x86_64   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description gus 2016-03-16 04:18:04 UTC
BBCLASSEXTEND="cross" seems to result in the do_install() from cross.bbclass *replacing* any do_install() defined in the current recipe.  That seems wrong, and surprising given the usual way "inherit" directives work.

I think either the BBCLASSEXTEND mechanism should be fixed to not do this, cross.bbclass should be modified to remove/change do_install, or the BBCLASSEXTEND docs should be updated to suggest that this will happen and offer workarounds.

(Version: jethro)
Comment 1 Richard Purdie 2016-03-16 16:40:20 UTC
Firstly, the cross class is very heavily gcc/binutils specific. In general its probably not usable elsewhere.

Secondly, BBCLASSEXTEND with cross in it isn't well supported. I see only one usage of that in OE-Core in u-boot-fw-utils and I'm not sure its something I'd recommend in general even if happens to work there.

Cleaning up that do_install is probably good but would require careful measured changes to the existing users of the class.

Out of interest, where are you thinking the cross class would be useful as a BBCLASSEXTEND?
Comment 2 gus 2016-03-17 13:49:22 UTC
I am/was trying to cross compile some "go" code to my target platform.  I thought it made sense to create go_x.y.bb which uses BBCLASSEXTEND="cross native nativesdk", and then my actual golang-application recipe used DEPENDS="go-cross".

I very recently discovered that recent go versions can support multiple targets with the one toolchain executable (this is contrary to the documentation), so I think I can now drop go-cross entirely which makes me happy (and renders this bug no longer an issue for me).

Fwiw, I didn't encounter any further oddness from using cross.bbclass.