Hello Liviu, Thank you very much for your reply. I got a very useful information from your reply.
At the beginning , I want to add the cross compiler to eclipse project and not use the default installer directory, but it appears the above problem. In eclipse project, the setting as these: Properties -- Setting--CrossSetting --Prefilx: arm-poky-linux-gnueabi- Properties--Setting -- CrossSetting--Path: /opt/poky/mycompiler/sysroots/ i686-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi You give me the idea to add the sysroot path: Properties -- Setting -- Cross GCC compiler -MisCellaneous: --sysroot=/opt/poky/mycompiler/sysroots/ armv5te-poky-linux-gnueabi Now, everything is ok . Thank you again for your help. Best wishes Neil From: Liviu Gheorghisan [mailto:liviu.gheorghi...@enea.com] Sent: Wednesday, December 17, 2014 5:47 PM To: Wu, Neil [CLIMATE/RS/CN]; yocto@yoctoproject.org Subject: Re: [yocto] problem of toolchain install directrory Hello Neil, Your problem is that the toolchain is installed with the location of the sysroot hardcoded as the default installation path for the tool-chain. You can see this location with: $ arm-poky-linux-gnueabi-gcc --print-sysroot // or whatever cross-compiler you built However, after you source the environment script for the toolchain: $ source environment-setup-armv7a-vfp-neon-poky-linux-gnueabi the environment variables related to the toolchain will be updated accordingly, taking care of this problem. So, use $CC instead of directly calling the gcc cross compiler arm-poky-linux-gnueabi-gcc (or whatever the platform you're building for). Check the difference with this: $ echo $CC arm-poky-linux-gnueabi-gcc -march=armv7-a -mthumb-interwork -mfloat-abi=softfp -mfpu=neon --sysroot=/home/livghe/work/ab/sdk/sysroots/armv7a-vfp-neon-poky-linux-gnueabi $ $CC --print-sysroot // uses the correct sysroot /home/livghe/work/ab/sdk/sysroots/armv7a-vfp-neon-poky-linux-gnueabi $ $ arm-poky-linux-gnueabi-gcc --print-sysroot // uses the sysroot from the default instalation path, where it's not present. /opt/poky/4.0/sysroots/armv7a-vfp-neon-poky-linux-gnueabi So, you should always use the env variables ($CC, $AR, $LDFLAGS, etc) after sourcing the environment script from the toolchain instalation path, and not the toolchain executables directly, because the environment variables add some useful flags, not only related to the sysroot, but also to the type of CPU, etc. - Liviu On 12/17/2014 11:30 AM, neil...@emerson.com<mailto:neil...@emerson.com> wrote: Hello ,all I build the toolchain via bitbake core-image-minimal -c populate_sdk. Then I install the toolchain. If I install the toolchain in default directory(default: /opt/poky/1.7.1), everything is ok. But, if I not install in the default directory, it will appears the problem that can't find the system header files. Example: stdio.h Why is this ? Whether I need to do some other operation. If you know please help me ! Thank you very much. Best wishes Neil -- Liviu Gheorghisan Software Engineer http://www.enea.com
-- _______________________________________________ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto