[OE-core] Building and using a second toolchain

Mike Crowe mac at mcrowe.com
Thu Sep 7 11:13:47 UTC 2017


I'm trying to compile a vendor bootloader for an AArch64-based chip. This
bootloader requires both a 32-bit "arm" compiler and a 64-bit "aarch64"
compiler to build. The rest of the system only requires the aarch64
compiler, so I'm using arch-armv8.inc in my machine configuration.

Since this is for a bootloader, the 32-bit compiler can probably be the
equivalent of gcc-cross-initial, and of course I need binutils-cross too.

Inspired by native.bbclass, I produced binutils-cross-arm and
gcc-cross-initial-arm recipes that rewrite lots of TARGET_ variables and
then copied the handful of require lines from the standard binutils-cross
and gcc-cross-initial recipes. This seems to work well - the binaries end
up in sysroots-components as would be expected.

I then added gcc-cross-initial-arm to DEPENDS for the bootloader recipe.
Unfortunately, things seem to go wrong when populating the recipe-specific
sysroot as the secondary toolchain is not present. I get messages like:

 WARNING: bootloader-7 do_prepare_recipe_sysroot: Manifest .../tmp-glibc/sstate-control/manifest-x86_64_aarch64-gcc-cross-initial-arm.populate_sysroot not found?
 WARNING: bootloader-7 do_prepare_recipe_sysroot: Manifest .../tmp-glibc/sstate-control/manifest-x86_64_aarch64-binutils-cross-arm.populate_sysroot not found?

These manifest files do exist though:

 tmp-glibc/sstate-control/manifest-x86_64_arm-gcc-cross-initial-arm.populate_sysroot
 tmp-glibc/sstate-control/manifest-x86_64_arm-binutils-cross-arm.populate_sysroot

These filenames appear to come from staging.bbclass and are generated from:

 manifest-${BUILD_ARCH}_${TARGET_ARCH}-%s.populate_sysroot

It thought that the simplest path to making this work would be to ensure
that the manifest files generated during the build have the names that all
other recipes will expect, but this means using the wrong TARGET_ARCH in my
binutils-cross-arm and gcc-cross-initial-arm recipes which I can't do
without also overriding TARGET_SYS and PN at least which definitely isn't
pretty.

I remember reading posts about doing this on the list in the past, but my
search engine skills aren't up to the job of finding anything. Am I missing
an easier way to make this work?

Thanks.

Mike.



More information about the Openembedded-core mailing list