[yocto] Issue of external toolchain usage in Yocto

Luo Zhenhua-B19537 B19537 at freescale.com
Thu Dec 6 02:22:18 PST 2012


I tried to use CS external toolchain to build images in Yocto, I met following issue when doing configure for package.

configure:2728: checking for powerpc-linux-gnu-gcc  -m32   -mcpu=8548 -mabi=spe -mspe -mfloat-gprs=double --sysroot=/home/yocto/poky/build_bsc9131rdb_release/tmp/sysroots/bsc9131rdb-tcbootstrap option to accept ISO C89
configure:2802: powerpc-linux-gnu-gcc  -m32   -mcpu=8548 -mabi=spe -mspe -mfloat-gprs=double --sysroot=/home/yocto/poky/build_bsc9131rdb_release/tmp/sysroots/bsc9131rdb-tcbootstrap  -c -isystem/opt/freescale/usr/local/gcc-4.5.55-eglibc-2.11.55/powerpc-linux-gnu/powerpc-fsl-linux-gnuspe/include -I/home/yocto/poky/build_bsc9131rdb_release/tmp/sysroots/bsc9131rdb -O2 -pipe -g -feliminate-unused-debug-types  conftest.c >&5
conftest.c:9:19: fatal error: stdio.h: No such file or directory

Firstly I run above compile command manually, it failed as following: 
$ /opt/freescale/usr/local/gcc-4.5.55-eglibc-2.11.55/powerpc-linux-gnu/bin/powerpc-linux-gnu-gcc -m32 -mcpu=8548 -mabi=spe -mspe -mfloat-gprs=double --sysroot=/home/yocto/poky/build_bsc9131rdb_release/tmp/sysroots/bsc9131rdb-tcbootstrap -c -isystem/opt/freescale/usr/local/gcc-4.5.55-eglibc-2.11.55/powerpc-linux-gnu/powerpc-fsl-linux-gnuspe/include  -I/home/yocto/poky/build_bsc9131rdb_release/tmp/sysroots/bsc9131rdb  -O2 -pipe -g -feliminate-unused-debug-types conftest.c
conftest.c:10:19: fatal error: stdio.h: No such file or directory
compilation terminated.

Secondly I removed --sysroot flag, the build process passed. 
$ /opt/freescale/usr/local/gcc-4.5.55-eglibc-2.11.55/powerpc-linux-gnu/bin/powerpc-linux-gnu-gcc -m32 -mcpu=8548 -mabi=spe -mspe -mfloat-gprs=double -c -isystem/opt/freescale/usr/local/gcc-4.5.55-eglibc-2.11.55/powerpc-linux-gnu/powerpc-fsl-linux-gnuspe/include  -I/home/yocto/poky/build_bsc9131rdb_release/tmp/sysroots/bsc9131rdb  -O2 -pipe -g -feliminate-unused-debug-types conftest.c

I also used the toolchain built by Yocto, the same issue happened.

I did following change in meta/conf/distro/include/tcmode-external-csl.inc, is there anything missing to use external toolchain in Yocto?
-EXTERNAL_TOOLCHAIN ?= "/usr/local/csl/${TARGET_ARCH}"
+EXTERNAL_TOOLCHAIN ?= "/opt/freescale/usr/local/gcc-4.5.55-eglibc-2.11.55/powerpc-linux-gnu"

Content of my contest.c:
#define PACKAGE_NAME "module-init-tools"
#define PACKAGE_TARNAME "module-init-tools"
#define PACKAGE_VERSION "3.16"
#define PACKAGE_STRING "module-init-tools 3.16"
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""
#define PACKAGE "module-init-tools"
#define VERSION "3.16"

#include <stdio.h>

int main ()
{
  ;
  return 0;
}


Best Regards,

Zhenhua






More information about the yocto mailing list