npryce / rusty-pi

142 stars 15 forks source link

Compiling the compiler on OS X? #2

Open chrisballinger opened 9 years ago

chrisballinger commented 9 years ago

It seems like the RPi tools repo only works on Linux machines. Any ideas how I could build the cross-compiler on OS X?

abl commented 9 years ago

The problem I'm hitting is that the recipe for the rPi compiler in crosstool-ng wants gdb-7.8 and the sources it has listed no longer host it.

The steps are pretty simple:

  1. Install crosstool-ng (and other dependencies)
  2. Create two disk images, one to hold the source and the other to hold the output (crosstool requires a case-sensitive filesystem)
  3. Mount those images in the places where crosstool-ng expects them
  4. Configure ct-ng in the output filesytem - ct-ng armv6-rpi-linux-gnueabi
  5. ct-ng build to create the crosscompiler

https://gist.github.com/abl/974e6880e1873d86652c is my attempt to make a simple script to handle this.