Re: 32-bit uname with 64-bit kernel
On Thu, Aug 05, 2010 at 09:06:41PM +0200, Aurelien Jarno wrote:
> On Thu, Aug 05, 2010 at 01:34:17PM -0400, Ed Maste wrote:
> > On Thu, Aug 05, 2010 at 01:16:21PM -0400, Tuco wrote:
> > > I found this problem when running uname inside a 32-bit chroot, 'uname
> > > -m' prints amd64! This often breaks configure scripts and build
> > > systems.
> > >
> > > With this glibc patch, uname corrects the output after it has been
> > > obtained with sysctl.
> > >
> > > Can I commit this? Is glibc-bsd/glibc-ports/kfreebsd/uname.c the right
> > > place, or should I send it in a bug report?
> > I'd recommend you apply FreeBSD r210369 to the kernel instead.
> > When compat32 binary asks for the value of hw.machine_arch, report
> > the name of 32bit sibling architecture instead of the host one. Do
> > the same for hw.machine on amd64.
> > Add a safety belt debug.adaptive_machine_arch sysctl, to turn the
> > substitution off.
> > Reviewed by: jhb, nwhitehorn
> > MFC after: 2 weeks
> > http://svn.freebsd.org/viewvc/base?view=revision&revision=210369
> I haven't tried it, but it indeed looks the way to do.
It indeed works well and is what we want. I have just added the patch
to the SVN, it will be in the next upload.
Thanks for pointing me on this patch.
Aurelien Jarno GPG: 1024D/F1BCDB73