PDA

View Full Version : Cross compiler from 64 to 32 bit?



jmillikin
September 25th, 2006, 06:37 AM
I've got a 64-bit computer that I'd like to put to work as a development system. As part of this, it needs to be able to build 32-bit binaries. I've been looking through the repos for a cross compiler, but the only ones available seem to be for unusual arches. How do I set up such a cross compiler?

pay
September 25th, 2006, 10:58 AM
You could make a 32bit chroot and then compile 32 apps in that.

Mime
September 25th, 2006, 06:34 PM
Yeah that'd probably be easiest. Only other way I can think of offhand is by using the -m32 flag to force 32bit output, but that could get messy.

If you want to set up a cross compiler for something other than x86, that's a little more involved...