Compiling a Linux program for ARM architecture - running on a host OS

13,091

For ARM-Linux application development the preferable choice is a Linux Host(x86) machine with a ARM toolchain installed in it. In Ubuntu Desktop machine you can use the following command to install ARM toolchain:

apt-get install gcc-arm-linux-gnueabi

After toolchain installation you can use the following command for cross compilation:

gcc-arm-linux-gnueabi-gcc -o hello hello.c

Using this toolchain you can cross-compile your C program using Standard C library without the need of startup code. Applications can be cross-compiled at your Host Linux(x86) platform and run on Target Linux(ARM) platform.

Windows version of ARM-Linux Toolchain is also available. You can get it from here.

Linaro Developers Wiki - an open organization focused on improving Linux on ARM, will be a good reference for your work.

Share:
13,091
Admin
Author by

Admin

Updated on June 15, 2022

Comments

  • Admin
    Admin almost 2 years

    I have a ARM Coretex-A8 development board from Freescale (i.MX53) running Linux Ubuntu. It boots up just fine and I can access the system with mouse/keyboard/terminal.

    To get started I would like to make an application running on the board inside the host OS, just as you do when you run application on your PC.

    My problem is to compile my test program, using toolchains like YAGARTO which is based on gcc i end up in trouble with the linking bacause I have not defined any startup script.

    I find lot of information on building "bare metal" configurations (inluding compiling the kernel and make load and link scripts), but not anything usefull for making a application running on a host OS.

    My development environment is running on Windows 7. I also have the option to run on Linux X86, but i doubt this whould help me making ARM applications.