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 examples use the ARM Cortex A8 toolchain created for the BeagleBone Black, which has the prefix arm-cortex_a8-linux-gnueabihf-
. If you built the ARM926EJ-S toolchain for the QEMU target, then the prefix will be arm-unknown-linux-gnueabi
instead.
The ARM Cortex A8 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 helloworld
program, which in the C language looks like this:
#include <stdio.h> #include <stdlib.h> int main (int argc, char *argv[]) { Â Â Â Â printf ("Hello, world!\n"); Â Â Â Â return 0; }...