GNU ARM compiler

gnuarm.comIt looks like I don’t need to make my own ARM cross compiler afterall, thanks to gnuarm.com. Now I can either try to compile a bootloader and a Linux kernel for the development board, I can go for a smaller “embedded” solution, or I can try to code everything myself (I could, but I won’t).

To install the environment and not have it interfere with my running Linux installation I plan to use chroot. Chroot will change the root of the running program (for example the shell you have opened) so that it appears that it’s working in a completely isolated environment, leaving the files of the mother OS untouched. However it is not true virtualisation like VMWare or Xen, and although it is often referred to as a chroot jail it is not meant to be a safe environment. There are ways to break out of that jail and still access the files from the higher operating system. But I’m pretty confident that the ARM compiler won’t do anything like that. ­čÖé For everything to work I’ll need to make a second set of system files for the chroot environment.

So first I make a directory chroot_env in my home folder, and I use debootstrap (I use Ubuntu at home and at work, and I love it) to install a minimal Ubuntu filesystem, you need to be root for that or use sudo in Ubuntu. If you don’t have debootstrap installed, in Ubuntu you can install it with sudo apt-get install debootstap.

The command is: sudo debootstrap gutsy ~/chroot_env/ http://archive.ubuntu.com/ubuntu
Total size of all this is about 212MB.

Once the chroot environment is installed you can access it with (as root/sudo, and assuming that you installed it in your home folder): chroot ~/chroot_env

Once inside the new environment, I also need some build tools to get started:
apt-get install build-essential
I also need to install the toolchain from gnuarm.com: exit the chroot env and copy the tarball to an appropriate place in the chroot tree, enter chroot again, extract the tarball and put the path of the bin directory into your $PATH variable (placing symbolic links in the /usr/bin folder to the arm-elf-* executables works too).

2 Replies to “GNU ARM compiler”

Leave a Reply

Your email address will not be published. Required fields are marked *