[plug] Debian Cross compiling

Cameron Patrick cameron at patrick.wattle.id.au
Sun Nov 20 11:12:21 WST 2005


Timothy White wrote:

> I want to start cross compiling from AMD64 to i386. Someone said to
> use linux32, but that only tricks tools into thinking they are running
> on a x86 and not a x86_64.

> Anyone know an easier way? Or want to try and help?

The amd64 gcc shipped with Debian and Ubuntu accept a -m32 option to
generate 32-bit code.  However you'll need 32-bit libraries installed
somewhere that gcc can find them, which doesn't appear to be the case
by default on an Ubuntu system.  My 32-bit Debian system generates
AMD64 binaries properly with "gcc -m64" so presumably if you used a
real OS you could just use gcc -m32 to do the reverse on amd64.

In general, it's probably easier to use a 32-bit chroot and build
there.  There are lots of resources around the internet about setting
these up in a sane way.

Cameron



More information about the plug mailing list