Date: Tue, 20 Jul 2010 14:15:14 -0400 From: John Baldwin <jhb@freebsd.org> To: Garrett Cooper <gcooper@freebsd.org> Cc: amd64@freebsd.org, Kostik Belousov <kostikbel@gmail.com>, freebsd-arch@freebsd.org Subject: Re: uname -m/-p for compat32 binaries Message-ID: <201007201415.14497.jhb@freebsd.org> In-Reply-To: <AANLkTilwVg10TY8UWJ1XYf4qPz93bQciGPVMmW9E3OLk@mail.gmail.com> References: <20100719213054.GB2381@deviant.kiev.zoral.com.ua> <201007200907.24715.jhb@freebsd.org> <AANLkTilwVg10TY8UWJ1XYf4qPz93bQciGPVMmW9E3OLk@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday, July 20, 2010 1:51:27 pm Garrett Cooper wrote: > On Tue, Jul 20, 2010 at 6:07 AM, John Baldwin <jhb@freebsd.org> wrote: > > On Monday, July 19, 2010 5:30:54 pm Kostik Belousov wrote: > >> Hi, > >> I intend to commit the following change, that makes sysctls > >> hw.machine_arch and hw.machine to return "i386" for 32 bit > >> binaries run on amd64. In particular, 32 bit uname -m and uname -p > >> print "i386", that is good for i386 jails on amd64 kernels. > >> > >> I find the change very useful for me, but I wonder why such trivial > >> modification is not yet done. Can anybody note a possible fallout from > >> it ? > > > > Presumably ia64 and powerpc64 would need a similar change as well? It looks > > fine to me. I suspect Y! used the UNAME_* approach as it didn't add yet- > > another local diff to maintain in the kernel, and the uname fixes at Y! might > > have predated SCTL_MASK32. > > I thought amd64 was a special case because we run biarch, whereas ia64 > was always 64-bit... > > Wouldn't this change also create problems later on down the line when > we're no longer biarch? amd64 is not biarch, it just supports FreeBSD/i386 binaries similar to how FreeBSD/i386 supports Linux/i386 binaries. Kostik's patch makes a FreeBSD/i386 uname binary report that it is running under FreeBSD/i386 just as we currently make a Linux/i386 uname binary report that it is running under Linux/i386. ia64 and powerpc64 both support COMPAT_FREEBSD32 similar to amd64. COMPAT_FREEBSD32 for amd64 and ia64 supports FreeBSD/i386 binaries. COMPAT_FREEBSD32 for powerpc64 supports FreeBSD/powerpc binaries. -- John Baldwin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201007201415.14497.jhb>