[yocto] sysroot / external toolchain

Chris Larson clarson at kergoth.com
Fri Jul 13 13:36:04 PDT 2012


> I'm using an external toolchain for my project.  What is the proper
> way to include my external toolchain libc files in the sysroot?

Use an external toolchain recipe which actually installs the files
from the external sysroot into ${D}, the way the known working
external sourcery toolchain recipe does.

> Currently I have
>
> TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_HOST}"
>
> and
>
> EXTERNAL_TOOLCHAIN_SYSROOT_CMD = "${TARGET_PREFIX}gcc
> ${TARGET_CC_ARCH} -print-sysroot"
> EXTERNAL_TOOLCHAIN_SYSROOT ??= "${@exttc_run(d,
> EXTERNAL_TOOLCHAIN_SYSROOT_CMD)}"

The tcmode sets these already, there's no need to set them explicitly,
just copy the external-sourcery tcmode to your own and set TCMODE
appropriately.

> which resolves to
> /opt/armada-sdk-5.0-64k/armv7-marvell-linux-gnueabi-softfp/arm-marvell-linux-gnueabi/libc/
>
> I also have a recipe for my external toolchain which includes the following:
>
> do_install() {
>         # Use optimized files if available
>         sysroot="${EXTERNAL_TOOLCHAIN_SYSROOT}"
> }

If this is all you have in do_install, it's no wonder you have no
files. do_install has to actually install the files from t he sysroot.
Copy what's in external-sourcery-toolchain, as that actually works.

> The EXTERNAL_TOOLCHAIN_SYSROOT doesn't seem to have any effect.  My
> libc header files are not visible during compilation. It looks like I
> may have to copy them to the staging dir or setup some symlinks.  Is
> this the right approach?

No.
-- 
Christopher Larson



More information about the yocto mailing list