[yocto] native recipe question

Burton, Ross ross.burton at intel.com
Tue May 22 02:19:43 PDT 2018


On 22 May 2018 at 08:43, Damien LEFEVRE <lefevre.da at gmail.com> wrote:
> I'm having to build a package (arrayfire) for Tegra. This package requires
> to first build a x86_64 utility (bin2cpp) which is then used for building
> the tegra arrayfire.
>
> Do I understand correctly that I should create:
>
> arrayfire-native.bb: for compiling the x86_64 utility. If so how do I
> instruct the platform?
> arrayfire.bb: for compiling the tegra platform. This recipe requires
> arrayfire-native.bb and I should get a copy in the recipe-sysroot-native
> folder?

That's one solution, but if it's jus a single tool that you need built
then you can build that yourself using the host compiler.  The best
practise here is for the upstream build to respect CC_FOR_BUILD ("use
this compiler to build binaries that I need to run at build time")
which we already export.  As presumably arrayfire doesn't do this,
then you can just build it yourself first.  For example, the Pango
recipe in oe-core basically does this:

do_compile_prepend_class-target () {
            make CC="${BUILD_CC}" LDFLAGS="${BUILD_LDFLAGS}" -C
${B}/tests gen-all-unicode
}

Which makes it build tests/gen-all-unicode using BUILD_CC (host
compiler, not cross compiler) for target builds before it goes and
builds the rest of the project.

Ross


More information about the yocto mailing list