RSS | technovelty home | page of ian | ian@wienand.org
The usual case for cross-compiling is that your target is so woefully slow and under-powered that you would be insane to do anything else.
However, sometimes for one of the best reasons of all, "historical reasons", you might ship a 64-bit product but support building on 32-bit hosts, and thus cross-compile even on a very fast architecture like x86. How much does this cost, even though almost everyone is running the 32-bit cross-compiler on a modern 64-bit machine?
To test, I got a a 32-bit cross and a 64-bit native x86_64 compiler and toolchain; in this case based on gcc-4.1.2 and binutils 2.17. I then did a allyesconfig build of Linux 2.6.33 x86_64 kernel 3 times using the cross compilier toolchain and then native one. The results (in seconds):
| 32-bit | 64-bit |
|---|---|
| 6090 | 5684 |
| 6050 | 5616 |
| 6063 | 5652 |
| average | |
| 6067 | 5650 |
So, all up, ~7% less by building your 64-bit code on a 64-bit machine with a 32-bit cross-compiler.
posted at: Thu, 06 May 2010 16:50 | in /code/c | permalink | add comment (2 others)

This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.