Date: Sat, 19 Jan 2008 14:52:37 -0500 From: John Baldwin <jhb@freebsd.org> To: freebsd-amd64@freebsd.org, "A.Yu.Isupov" <isupov@moonhe.jinr.ru> Subject: Re: amd64/119771: troubles w/ -m32 executables on both amd64 and i386 Message-ID: <200801191452.38343.jhb@freebsd.org> In-Reply-To: <200801191850.m0JIo2v1043021@freefall.freebsd.org> References: <200801191850.m0JIo2v1043021@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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 ld-elf.so.1 to ld-elf32.so.1 in your chroot). -- John Baldwin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200801191452.38343.jhb>