Building yocto using external toolchain?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Building yocto using external toolchain?

Jump to solution
12,817 Views
Mike1z
Contributor I

Hello,

I'm new to using Yocto, and would like to avoid it's habit of rebuilding the cross compiler each time it runs a clean build.  I have previously successfully built the SDK using 'bitbake meta-toolchain', and installed it to the default location /opt/poky/1.4.1.

I can now use this SDK to build apps external to yocto.  What I want to do is have yocto always use my new pre-built toolchain, instead of recreating gcc each time I perform a build.  I've researched the web, and have seen several people allude to how to solve this problem, but I haven't see an answer yet.

The poky handbook says

"Using the external toolchains is simply a case of untarring the tarball into the root of your system (it only creates files in /usr/local/poky) and then enabling the option in local.conf. "

But it doesn't tell you how... :smileysad:.  Anybody know how to do this?

Labels (2)
1 Solution
5,557 Views
daiane_angolini
NXP Employee
NXP Employee

In my opinion, you don´t need to care about "re-building" gcc each time you have a new clean build.

The option given to you to use an external toolchain with yocto, gives you the power to actually choose which *other* toolchain you want, for example, the linaro one.

So, if you really want a *different* toolchain, I think you should work to use an external toolchain.

But, in other hand, if you only complain that build time take too much, there are other things you may change on your configuration in order to try to reduce this time.

Yocto always create a folder with the "pre-built" binaries from each package, it´s called sstate-cache. You can share this folder with your other build folders, or even with your co-workers. (https://www.yoctoproject.org/docs/current/poky-ref-manual/poky-ref-manual.html#var-SSTATE_DIR)

In my personal opinion, you should not use the meta-toolchain as "external" toolchain, you should use yocto toolchain "as-is", if you´re using an stable branch it will only be changed in case of a bugfix, and I think you want bugfixes.

Please, apologize my delay, I´ve been busy with meta-fsl-arm release these past days.... And please,  let me know your thoughts.

View solution in original post

4 Replies
5,558 Views
daiane_angolini
NXP Employee
NXP Employee

In my opinion, you don´t need to care about "re-building" gcc each time you have a new clean build.

The option given to you to use an external toolchain with yocto, gives you the power to actually choose which *other* toolchain you want, for example, the linaro one.

So, if you really want a *different* toolchain, I think you should work to use an external toolchain.

But, in other hand, if you only complain that build time take too much, there are other things you may change on your configuration in order to try to reduce this time.

Yocto always create a folder with the "pre-built" binaries from each package, it´s called sstate-cache. You can share this folder with your other build folders, or even with your co-workers. (https://www.yoctoproject.org/docs/current/poky-ref-manual/poky-ref-manual.html#var-SSTATE_DIR)

In my personal opinion, you should not use the meta-toolchain as "external" toolchain, you should use yocto toolchain "as-is", if you´re using an stable branch it will only be changed in case of a bugfix, and I think you want bugfixes.

Please, apologize my delay, I´ve been busy with meta-fsl-arm release these past days.... And please,  let me know your thoughts.

5,557 Views
manjunathjoshi
Contributor V

Hello Daiane,

Can you elaborate where exactly the changes have to made?

i am building YOCTO with poky distribution but i want linaro as external toolchain.

Regards,

Manju

0 Kudos
Reply
5,557 Views
daiane_angolini
NXP Employee
NXP Employee

Mainly local.conf

There how-to's from Linaro community showing how to configure it. It's something like adding 3 lines to your local.conf, and untar the linaro toolchain in a known place.

I prefer you take the Linaro community how-to, this way it's the most updated version.

0 Kudos
Reply
5,557 Views
manjunathjoshi
Contributor V

Hello Daiane,

Thank you for your immediate reply.

I added following lines in local.conf,

TCLIBC = "external-linaro-toolchain"

TCMODE = "external-linaro"

EXTERNAL_TOOLCHAIN = " /home/manjunath/linaro/gcc-linaro-arm-linux-gnueabihf-4.7-2013.01-20130125_linux/"

and i had to add .inc files for tclibc , tcmode and version in sources/poky/meta/conf/distro/include/

Manju