ARM cross compiling in 5 minutes

I was poking around tonight and started playing with some ARM cross compiling on my x86 Xubuntu 12.10 desktop via QEMU.  If you want to start building for ARM, follow these steps

Using Synaptic install “gcc-4.6-arm-linux-gnueabi”,”qemu-kvm”,”qemu-kvm-extras” and all the dependencies. (Maybe someone can post the full “apt-get install” command as a comment)

Make a small C file.  Example

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

Build the binary: “arm-linux-gnueabi-gcc-4.6 hello.c -o hello”

Run the ARM binary using Qemu via “qemu-arm -L /usr/arm-linux-gnueabi/ ./hello”

Should output “Hello ARM World”

Pretty easy, now you have an ARM cross compiler toolchain.

Useful QEMU ARM links:

http://www.linuxforu.com/2011/06/qemu-for-embedded-systems-development-part-1/
http://www.cnx-software.com/2011/02/10/emulate-an-arm-plaform-with-qemu-on-ubuntu-10-10/
http://wiki.debian.org/QemuUserEmulation

 

No Comments

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

WordPress Themes