My adventures with cross compiling for Raspberry Pi

In case anyone else is attempting to do this with the basic instructions as documented here, I discovered the following while trying to make it work. also note there are other options as well such as distcc, and this which looks promising as well.

My setup: 0.8.4 linux armv6 package; OSX 10.9 macbook; running 32 bit Ubuntu 10.04LTS on Virtualbox 4.3.20 for the cross compile.

Things that I noticed:

1.) All the instructions on the official guide are required. (including getting the dependencies on the RPi first, coping files over into $RPI_ROOT and $RPI_TOOLS, fixing PKG_CONFIG_PATH and the qualified library paths fix relating to libdl

2.) In addition, the $RPI_ROOT folder not only needs to have the /usr copied from the SD card, you will also need:

  • /etc/debian_version - just a text file with the version number. this part of the armv6 makefile checks for the existence of this file. without it, it will default to armv6l-unknown-linux-gnueabihf as the compiler, which does not exist in the $RPI_TOOLS folder.
  • /opt/vc - also referenced a number of times in the makefile as well.

Hope this proves to be useful! (and please correct me if I’m doing anything wrong! :smile: )

edit: if anyone else with more thorough knowledge can confirm that the above steps are indeed required, I’d be happy to submit a pull request to the documentation page!