Created by: jgmdev
Date: 06/13/2015 @ 7:07:54 pm
When I bought my raspberry pi I got the B model first version. This version suffers a lot from power and usb issues even with an external powered usb hub. As a consequence my pi started to lock down so I couldn't build wxPHP for the Pi. I was preparing to put it to rest, but I noticed the arm deb for raspbian of previous 126.96.36.199 version was downloaded more than 100 times. I decided to give it a go and try to compile for the pi using Qemu, for those that may be using wxPHP on their Pi's.
After searching the Internet for howto's about "raspbian on qemu", I found I needed a special kernel compiled for qemu, as the binary (qemu-system-arm) and parameters required to make it boot. I found this project rpiqemuwindows which is for raspbian qemu emulation on Windows, but I use Linux. With no previous experience with qemu I decided to download the provided zip files and inspected the commands used to launch the qemu instance with raspbian. The zip file includes a kernel and raspbian image from 2012.
After getting chroot access to rapsbian I started compiling wxPHP, but... I also noticed it was darn slow, what a party pooper :(. The qemu emulation/translation for the arm architecture is slow or it is limiting the cpu clock rate some how. In my despair I stopped the compilation process and finally, I gave up! Then I looked back and saw my Odroid U2 idling on a special furniture prepared just for it, and I thought, "wait a second, this thing has an arm cpu on it maybe I can chroot to the raspbian image and compile for the raspberry pi with it :D". Took the raspbian-tools and stripped the qemu bits, placed them on my Odroid U2 and bang!!! the chroot worked perfectly, I could even use all 4 cores of the odroid and 2 gigs of ram for compiling.
Conclusion, I build wxPHP in about 1 hour with the Odroid U2 which would have taken almost 1 day if building on the raspberry pi or 2-3 days with qemu :D. Thanks to Jeffrey Fernandez for sharing the raspbian-tools and everyone who shares knowledge on the Internet. And just like that there are now raspbian binaries of wxPHP even if just used by 2 or 3 of those 100 hundred downloads :D.