Step 1: Install the arm-linux-gcc

Unzip it in /usr/local/armgcc and then add the path in the path like this:export PATH=/usr/local/armgcc/bin:$PATH

Step 2: Create a sample helloword in C and make the cross-compiler for arm

Create a C program helloworld.c

#include <stdio.h>
main(){
printf (“Hello World!\n”);
}

Make a normal build: gcc helloworld.c -o helloNormal

Then do:file helloNormal

The output will be the one below, which shows that this file is compiled to processor pc:helloNormal: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU / Linux 2.6.15, not stripped

With this file is not possible to run at friendlyarm they still did not cross-compiler.

To generate the binary cross-compiled arm to do so:arm-linux-gcc -s helloworld.c -o helloArm

Now we have a program in C that can run on FriendlyArm, to be sure, let’s check the file:file helloArm

The output will be the one below, which shows that this file is compiled to FriendlyArm:helloArm: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.14, stripped

Okay, now just put the file in helloArm FriendlyArm and run:./helloArm