All of lore.kernel.org
 help / color / mirror / Atom feed
From: Liviu Gheorghisan <liviu.gheorghisan@enea.com>
To: <Neil.Wu@Emerson.com>, <yocto@yoctoproject.org>
Subject: Re: problem of toolchain install directrory
Date: Wed, 17 Dec 2014 11:46:31 +0200	[thread overview]
Message-ID: <549150F7.5070409@enea.com> (raw)
In-Reply-To: <3204FE6663E1F14CAF4CA6928E60C8521E220F69@USSTLZ-PMSG012.emrsn.org>

[-- Attachment #1: Type: text/plain, Size: 2214 bytes --]

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


[-- Attachment #2: Type: text/html, Size: 7618 bytes --]

  reply	other threads:[~2014-12-17  9:46 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-10  8:33 [meta-cgl][PATCH] samhain: add new recipe Li xin
2014-12-10 17:28 ` Khem Raj
2014-12-11  0:47 ` Joe MacDonald
2014-12-11  7:21   ` Alexandru Vaduva
2014-12-11  7:51     ` Alexandru Vaduva
2014-12-12 19:53       ` akuster808
2014-12-11  9:35     ` add files to dirctory in packages-split Neil.Wu
2014-12-11 10:04       ` Khem Raj
2014-12-12  1:59         ` Neil.Wu
2014-12-12  2:48           ` Khem Raj
2014-12-12  7:41             ` Neil.Wu
2014-12-17  9:30     ` problem of toolchain install directrory Neil.Wu
2014-12-17  9:46       ` Liviu Gheorghisan [this message]
2014-12-18  2:59         ` Neil.Wu
2015-01-15 10:03     ` can't find the source code of kernel Neil.Wu
2015-01-15 13:04       ` Bruce Ashfield
2015-01-16  1:13         ` Neil.Wu
2015-01-16  4:35           ` Bruce Ashfield
2015-01-20  1:48             ` Neil.Wu
2015-01-20  3:12     ` dependency eglibc resulted in conflicting PREFERRED_PROVIDER entries being found Neil.Wu
2015-01-21  6:59       ` the problem of poky 1.7 when building the custom rootfs Neil.Wu
2014-12-13 18:15 ` [meta-cgl][PATCH] samhain: add new recipe akuster808

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=549150F7.5070409@enea.com \
    --to=liviu.gheorghisan@enea.com \
    --cc=Neil.Wu@Emerson.com \
    --cc=yocto@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.