Cross compiling to the Raspberry Pi
• Mark Eschbach
My Raspberry Pi is old, like second gen Model B. In terms of computational power, it pales in comparison to the system it sits next to: a dual xeon hexcore running at more than 4x clock ccyles per CPU. I’ve had it for so long in stand by I forgot the hardward details of it. Luckly Ozzmaker published how to get the info. There is a table at the bottom where you can match your hardware revision from to find the model you are using. The Pi B 2.0 runs ARMv6l with hardware floating point, or at least that is my theory right now. I’ll have to test that once I get the compiler up and running.
I know there are tool chains out there to cross compile. While I was building my microkernel I use to hand compile these. It was slow and error proned. It would be nice to avoid hours long compilation for my Raspberry Pi’s software if I could use the workstation. This should cut the compilation time significantly.
The search
First nice path would be to install the tools through Ubuntu’s package management system. This led me through a rabbit hole of development packages the cross compliation tools wanted to install, including removing libc-dev-i386
. This was the path suggested by Hackaday. Since this was the first serious approach I was excited but sad.
There was a lot of talk on StackOverflow without any luck.
On the third or fourth page I journied across Videgro’s method. Fairly straight forward approach of using the Raspberry Pi’s precompile tool chain. Clone from the repository then use arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/bin/arm-bcm2708hardfp-linux-gnueabi-gcc
as your GCC driver.