|
Message-ID: <20201203190608.GB534@brightrain.aerifal.cx> Date: Thu, 3 Dec 2020 14:06:10 -0500 From: Rich Felker <dalias@...c.org> To: Marius Hillenbrand <mhillen@...ux.ibm.com> Cc: musl@...ts.openwall.com Subject: Re: [PATCH] s390x: derive float_t from compiler or default to float On Thu, Dec 03, 2020 at 05:53:52PM +0100, Marius Hillenbrand wrote: > On 12/2/20 8:13 PM, Rich Felker wrote: > > On Wed, Dec 02, 2020 at 06:09:44PM +0100, Marius Hillenbrand wrote: > >> On 12/2/20 5:01 PM, Rich Felker wrote: > >>> On Wed, Dec 02, 2020 at 09:25:04AM -0500, Rich Felker wrote: > [...] > >>> I'm looking at > >>> https://gcc.gnu.org/pipermail/gcc-patches/2020-November/560225.html > >>> which seems to be what you're talking about, and don't understand how > >>> it's intended to work. It looks like it's running a test for target > >>> behavior on the host compiler (there is no target compiler at the > >>> point this test is run). Looking again, I guess that's why it's under > >>> a condition for build==host==target. > >> > >> Right, that's the patch. The check only applies to a "native build", > >> with the assumption that the build environment is the same as the > >> intended target environment. > >> > >>> What happens when cross > >>> compiling? Do you get the old behavior unless manually setting > >>> --disable-s390-excess-float-precision? > >> > >> When cross compiling, we get the new behavior (the setting starts at > >> "auto", which is never resolved to yes or no; so the AC_DEFINE is left out). > >> > >> In any case, manually setting > >> --enable/disable-s390-excess-float-precision takes precedence. > > > > FWIW this means building GCC 11 for any older version of glibc or musl > > will give a broken configuration unless you pass > > --disable-s390-excess-float-precision to configure. I'm not sure if > > anything should be done about that; at least I might want to handle it > > in mcm... > > I will look into handling cross compiles in a more differentiating way... I can't think of any valid way to detect (note: at configure time you might not even have libc available) but it might be more reasonable to take the conservative default and assume a libc that can't handle the new definition. For example compiling old musl with the new definition will be caused the math library to be miscompiled. > > In any case this probably means I should include your patch in this > > release cycle so at least current version builds right. > > > > BTW is there a -m option to override at runtime in order to test both > > behaviors, so you don't have to build a new GCC from scratch to do it? > > Yes, in the current GCC, -fexcess-precision=standard or fast switches > between the two behaviors (i.e., both __FLT_EVAL_METHOD__ and emitted > code; "fast" corresponds to the "new" behavior). I mean in a GCC 11 built for the new behavior, where -fexcess-precision=standard will no longer give __FLT_EVAL_METHOD__==1 because float_t is expected to be defined as float and FLT_EVAL_METHOD as 0. Is there a -m option to tell it "behave like old GCC, where -fexcess-precision=standard implies evaluation in double? Rich
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.