[yocto] problem of toolchain install directrory

Neil.Wu at Emerson.com Neil.Wu at Emerson.com
Wed Dec 17 18:59:54 PST 2014

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

From: Liviu Gheorghisan [mailto:liviu.gheorghisan at enea.com]
Sent: Wednesday, December 17, 2014 5:47 PM
To: Wu, Neil [CLIMATE/RS/CN]; yocto at 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

$ $ arm-poky-linux-gnueabi-gcc --print-sysroot // uses the sysroot from the default instalation path, where it's not present.

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.Wu at Emerson.com<mailto:Neil.Wu at 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


Liviu Gheorghisan

Software Engineer

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20141218/383a907a/attachment.html>

More information about the yocto mailing list