O'Reilly logo

Mastering Embedded Linux Programming by Chris Simmonds

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Anatomy of a toolchain

To get an idea of what is in a typical toolchain, I want to examine the crosstool-NG toolchain you have just created.

The toolchain is in the directory ~/x-tools/arm-cortex_a8-linux-gnueabihf/bin. In there you will find the cross compiler, arm-cortex_a8-linux-gnueabihf-gcc. To make use of it, you need to add the directory to your path using the following command:

$ PATH=~/x-tools/arm-cortex_a8-linux-gnueabihf/bin:$PATH

Now you can take a simple hello world program that looks like this:

#include <stdio.h>
#include <stdlib.h>
int main (int argc, char *argv[])
{
  printf ("Hello, world!\n");
  return 0;
}

And compile it like this:

$ arm-cortex_a8-linux-gnueabihf-gcc helloworld.c -o helloworld

You can confirm that it has been cross ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required