amd64/119771: troubles w/ -m32 executables on both amd64 and i386

John Baldwin jhb at
Sat Jan 19 12:10:55 PST 2008

On Saturday 19 January 2008 01:50:02 pm A.Yu.Isupov wrote:
>  >It's not clear in your report, are you recompiling the program under
>  >i386, or copying the binary from FreeBSD/amd64 to the FreeBSD/i386
>  >system?
>    Failed binary produced under FreeBSD/amd64 as static w/ -m32
>  and executed on FreeBSD/amd64 and (after copying :) on FreeBSD/i386 -
>  with the same faulty results.
>  >If you build your program under FreeBSD/i386, does your program run
>  >without these problems on i386 and amd64?
>    Yes, binary produced under FreeBSD/i386 as static have not a problem
>  during execution under both FreeBSD/i386 and FreeBSD/amd64.
>    So I conclude, that problem possibly in FreeBSD/amd64's 32-bit
>  compatibility support, at least in syscall getrlimit().

That is incorrect.  If the binary you compile doesn't run under FreeBSD/i386
either, then it is obviously _not_ a compat32 bug since FreeBSD/i386 doesn't
have compat32.  You are probably having problems because all your
<machine/foo.h> headers are amd64 headers so you end up with various types
being 64-bit that should be 32-bit and incorrect structure sizes, etc.  This
is probably causing the corruption issues you are seeing.  You can compile
your apps either on a 32-bit box or create a 32-bit chroot on your 64-bit
box (just be sure to copy an i386 to in your

John Baldwin

More information about the freebsd-amd64 mailing list