From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id CAB7DE008A7; Wed, 17 Dec 2014 01:46:41 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,HTML_MESSAGE autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.0 HTML_MESSAGE BODY: HTML included in message Received: from mx-3.enea.com (sestofw01.enea.se [192.36.1.252]) by yocto-www.yoctoproject.org (Postfix) with SMTP id 15530E003AB for ; Wed, 17 Dec 2014 01:46:37 -0800 (PST) Received: from [192.168.14.95] (192.168.14.95) by smtp.enea.com (172.21.1.208) with Microsoft SMTP Server id 14.3.158.1; Wed, 17 Dec 2014 10:46:31 +0100 Message-ID: <549150F7.5070409@enea.com> Date: Wed, 17 Dec 2014 11:46:31 +0200 From: Liviu Gheorghisan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: , References: <20141211004713.GC4102@mentor.com> <1077253035.5058800.1418282511482.JavaMail.yahoo@jws10079.mail.ne1.yahoo.com> <3204FE6663E1F14CAF4CA6928E60C8521E220F69@USSTLZ-PMSG012.emrsn.org> In-Reply-To: <3204FE6663E1F14CAF4CA6928E60C8521E220F69@USSTLZ-PMSG012.emrsn.org> X-Originating-IP: [192.168.14.95] Subject: Re: problem of toolchain install directrory X-BeenThere: yocto@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Discussion of all things Yocto Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 09:46:41 -0000 Content-Type: multipart/alternative; boundary="------------050303060403060002030903" --------------050303060403060002030903 Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 8bit 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.Wu@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 --------------050303060403060002030903 Content-Type: text/html; charset="windows-1252" Content-Transfer-Encoding: 8bit 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.Wu@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
--------------050303060403060002030903--