Hello, I am running various versions of raspbian (2 wheezy and 1 jessie) on 3 Raspberry Pis and trying to learn new stuff with hardware.
However, building software on the Pi, especially the older hardware, is very slow, and as I invariably forget things and want to do it again its frustrating.
Is anybody here adept at cross-compiling for their Pi from Linux, (64 bit) or using armhf emulation on qemu or VirtualBox or KVM and building images that way?
who could maybe share their own experiences, the relative merits of each, etc.
Yes, we do this all the time at work when we're building software for ARM devices. not only do x86 desktops or servers have more and faster cores than an ARM board like a Pi, but they can have dozens or hundreds of GB of RAM and big fast SSDs.
Generally the best way:
1) set up qemu-arm-static with binfmt_misc so that you can run arm linux elf binaries from the x86 command line the same as if they were x86 binaries.
2) get a root file system for armhf or armel or whatever you want. I prefer to expand it on the host file system but you can also put it on a disk image and mount that
3) copy qemu-arm-static to the same relative place in the ARM root filesystem as it is in the host file system e.g. /usr/bin/qemu-arm-static. If you don't use a disk image then you can hard link it instead of copying
4) use chroot to switch into the ARM root filesystem. You need to set up a few things for /proc and maybe /dev before doing the chroot. Any chroot tutorial will go through that.
On the fastest current x86 chips, qemu is a little bit slower than a core on a Pi 2 or Pi 3 (and quite a lot slower than an Odroid C2 or better XU4). But if you have a server with 36 cores and 128 GB of RAM then you're flying overall :-)