This one is actually just a copy/paste from the master branch. It includes a fix to the problem of cross compilers compiling binaries with the building system's ld.so in mind, I take no credit for this. -- Marek.