[yocto] Cross compiler in yocto

Alex J Lennon ajlennon at dynamicdevices.co.uk
Mon Jun 23 10:42:37 PDT 2014


On 23/06/2014 18:28, Bharath Chandra wrote:
> Hi,
>
> I am new to yocto. I have a gumstix board which is up and running, but
> it does not have GCC on it. I have to compile and run some c programs
> on my image. What is the process to do that?? Is there any
> documentation available about the cross compiler. Kindly provide me
> any pointer which would help.
>

The beauty of Yocto is that it handles this for you. When you first run
Yocto bitbake for a particular MACHINE target it will build a
cross-compiler, and associated supporting utilities from source for that
target. These are the -native packages that are built. 'Native' in Yocto
terminology means "something that run on the build host".

It'll then move onto cross-compiling other configured packages for the
target, which is all driven by meta-data and meta-data dependencies
which are encapsulated in the 'recipes'.

My personal experience fwiw is that the easiest way to cross-compile
projects to run on the target of your choice is to create an autotools
configuration for your project, which then makes it fairly trivial to
create a Yocto recipe to cross-compile that project and to package it up
into the target image.

I have already mentioned this link today, and at the risk of repeating
myself I would hope that this walkthrough would show you how to use
various flavours of an autotooled project and associated recipe to
cross-compile and package your application.

https://wiki.yoctoproject.org/wiki/index.php?title=Building_your_own_recipes_from_first_principles

The example used is here

https://github.com/DynamicDevices/bbexample

This is loosely based on the documentation here

http://www.niksula.hut.fi/~mkomu/docs/autohowto.html

You will of course wish to spend some time with the Yocto Quickstart too
I imagine

http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html

Regards,

Alex



More information about the yocto mailing list