Subject: Re: building 32bit binaries
To: Christoph Egger <>
From: Manuel Bouyer <>
List: port-amd64
Date: 11/25/2007 00:23:03
On Mon, Oct 22, 2007 at 03:38:42PM +0200, Christoph Egger wrote:
> I discovered another issue related to compiling 32bit binaries.
> When a .c file
> #include <stdint.h>
> it always gets the amd64 type definition.
> gcc -m32 option #define's  __i386__. So it is possible to always get
> the correct type definition either from /usr/include/i386 
> or /usr/include/amd64 depending on if gcc is called with -m32 or -m64
> (-m64 is the default).

This is not as easy as the linker scripts. The right thing would probably be
to install the i386 header in addition to the amd64 ones (this isn't too
difficult) but I've no idea how to make gcc points <machine/...> to the
right directory based on -m32/-m64. Then, in order to have gcc -m32 fully
working we'd need to build NetBSD 32bit binaries as part of the amd64 Then there's the issue that 32bit binaries are in
/emul/netbsd32, which is probably not the place where gcc expect the
libraries to be ...

To fix this immediate problem, I've just added the 2 missing i386 headers
in the xentools3-hvm package. It doesn't need the 32bit libraries.

Manuel Bouyer <>
     NetBSD: 26 ans d'experience feront toujours la difference