this is just an idea that came to my head, a walk through should be made to discover it.
so suppose you were in a situation where these conditions exist:
- you want to cross-compile a program (obviously)
- this program has dependencies that are not easy to resolve manually
- you don't want to compile it in an emulated environment to make best use of your hardware
A wise man said that the best way to cross-compile is not to cross compile at all, he probably meant that you should emulate the target architecture, install build tools and dependencies on it, then some solutions already exist (like vagrant I suppose) that let you use your favorite IDE in host machine but actually compile inside of the emulated target machine.
This scenario sounds good but something inside of me don't like it, maybe because the compiler performance will be bottle necked by emulation technology (powerpc on qemu really sucked), so I thought of it in another way:
- again you emulate target architecture, install dependencies
- mount virtual disk to some directory (the qcow2 file in qemu)
- cross compile with the gcc flag sysroot set to the virtual disk image mount point
this should get it done