Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Oct 2017 18:58:25 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Steve Kargl <sgk@troutmask.apl.washington.edu>
Cc:        linimon@lonesome.com, Don Lewis <truckman@FreeBSD.org>, list1@gjunka.com,  freebsd-ports@freebsd.org
Subject:   Re: portmaster, portupgrade, etc
Message-ID:  <20171005155825.GM95911@kib.kiev.ua>
In-Reply-To: <20171005152520.GA96545@troutmask.apl.washington.edu>
References:  <20171004232819.GA86102@troutmask.apl.washington.edu> <201710050027.v950RBFT047711@gw.catspoiler.org> <20171005083558.GD95911@kib.kiev.ua> <20171005145116.GA96180@troutmask.apl.washington.edu> <20171005145941.GL95911@kib.kiev.ua> <20171005152520.GA96545@troutmask.apl.washington.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Oct 05, 2017 at 08:25:20AM -0700, Steve Kargl wrote:
> On Thu, Oct 05, 2017 at 05:59:41PM +0300, Konstantin Belousov wrote:
> > On Thu, Oct 05, 2017 at 07:51:16AM -0700, Steve Kargl wrote:
> > > On Thu, Oct 05, 2017 at 11:35:58AM +0300, Konstantin Belousov wrote:
> > > > On Wed, Oct 04, 2017 at 05:27:11PM -0700, Don Lewis wrote:
> > > > > > The system in question is my last i686 laptop, which I 
> > > > > > use for libm development and testing.  Once I cannot use
> > > > > > that laptop (whether hardware failure or inability to 
> > > > > > update the installed ports), I'll stop worrying about a
> > > > > > functional libm on 32-bit hardware.
> > > > > 
> > > > > As an aside, this sort of thing could be done in an i386 VM or maybe an
> > > > > i386 jail on amd64 hardware.
> > > > 
> > > > You do not need even a jail for this. Base cc -m32 works on amd64 for
> > > > long time, and 32bit binaries can be executed from host environment,
> > > > assuming all third-party libs are provided somewhere in the 32bit
> > > > variant.
> > > > 
> > > > The environment with regard to the hardware configuration should be
> > > > identical to modern i386-arch machine with SSE2.  Incompatibilities are
> > > > considered as bugs and are usually fixed fast when reported.
> > > 
> > > Does this required WITH_LIB32=yes in src.conf?
> > Yes, but this is the default.
> > 
> > > 
> > > More concerning is that the FPU on i686 is set-up in npx to
> > > use 53-bit precision instead of 64-bit.  See x86/fpu.h where
> > > there is a large comment and the settings
> > > 
> > > #define __INITIAL_FPUCW__       0x037F
> > > #define __INITIAL_FPUCW_I386__  0x127F
> > > #define __INITIAL_NPXCW__       __INITIAL_FPUCW_I386__
> > > 
> > > Does cc -m32 on amd64 cause the amd64 fpu to act (exactly?) like
> > > and i387?
> > It is not cc -m32.
> > 
> > Kernel sets up x87 FPU differently for 64 and 32bit processes. See
> > ia32_setregs() where pcb is adjusted for 32bit, and r189423.
> 
> Yes, I know the kernel sets up npx on i686.  If one is testing libm
> changes or new code for libm, then cc -m32 will be insufficient in
> testing the behavior one might get from i387 in 53-bit mode as 
> oppose to 64-bit.  This is the reason the macro LD80C exists in
> math_private.h.
Again, if there is any bug in setting FPU environment for 32bit process,
i.e. an inconsistency between native i386 kernel and compat32 on amd64,
explain it or better, provide the test case.  It will be fixed quickly.

Currently I am not aware of any.

> 
> Which brings me back to my i686 laptop with limited resources.
> If portmgr makes it impractical/impossible to easily install ports
> without a sledge hammer, then testing possible future patches to 
> libm will simply skip i686 class hardware.
> 
> -- 
> Steve



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20171005155825.GM95911>