Bug#890466: rrdtool: FTBFS on m68k: math not IEEE-compliant

2018-02-14 Thread Aaron M. Ucko
Source: rrdtool
Version: 1.7.0-1
Severity: normal
User: debian-68k@lists.debian.org
Usertags: m68k

The build of rrdtool 1.7.0-1 for m68k (admittedly not a release
architecture) failed, per the below excerpt from
https://buildd.debian.org/status/fetch.php?pkg=rrdtool&arch=m68k&ver=1.7.0-1&stamp=1518247574&raw=0:

  IEEE Math Checks
  checking for fpclassify... no
  checking for fpclassify with ... yes
  checking for isinf... yes
  checking whether isfinite is broken... no
  checking if IEEE math works out of the box... not isinf(oo) ... no
  checking if IEEE math works with the -ieee switch... no
  checking if IEEE math works with the -qfloat=nofold switch... no
  checking if IEEE math works with the -w -qflttrap=enable:zerodivide... no
  checking if IEEE math works with the -mieee switch... no
  checking if IEEE math works with the -q float=rndsngl switch... no
  checking if IEEE math works with the -OPT:IEEE_NaN_inf=ON switch... no
  checking if IEEE math works with the -OPT:IEEE_comparisons=ON switch... no
  checking if IEEE math works with fpsetmask(0)... no
  checking if IEEE math works with signal(SIGFPE,SIG_IGN)... not isinf(oo) ... 
no
  configure: error: 
  Your Compiler does not do proper IEEE math ... Please find out how to
  make IEEE math work with your compiler and let me know (t...@oetiker.ch).
  Check config.log to see what went wrong ...

Could you (or the porters, X-Debbugs-Cc:ed) please take a look?

Thanks!

-- 
Aaron M. Ucko, KB1CJC (amu at alum.mit.edu, ucko at debian.org)
http://www.mit.edu/~amu/ | http://stuff.mit.edu/cgi/finger/?a...@monk.mit.edu



Re: gcc isinf(1.0/0.0) fails on m68k

2018-02-14 Thread Finn Thain
On Sun, 11 Feb 2018, Jean-Michel Vourg?re wrote:

> Hi
> 
> Last build of rrdtool failed on m68k, because gcc IEEE stack pre-check fails 
> [1].
> 
> The autoconf runs this:
> 
> #include 
> int main(void){
>double rrdnan,rrdinf,rrdc,rrdzero;
>;
>/* some math to see if we get a floating point exception */
>rrdzero=sin(0.0); /* don't let the compiler optimize us away */
>rrdnan=0.0/rrdzero; /* especially here */
>rrdinf=1.0/rrdzero; /* and here. I want to know if it can do the magic */
> /* at run time without sig fpe */
>rrdc = rrdinf + rrdnan;
>rrdc = rrdinf / rrdnan;
>if (! isnan(rrdnan)) {printf ("not isnan(NaN) ... "); return 1;}
>if (rrdnan == rrdnan) {printf ("nan == nan ... "); return 1;}
>if (! isinf(rrdinf)) {printf ("not isinf(oo) ... "); return 1;}
>if (! isinf(-rrdinf)) {printf ("not isinf(-oo) ... "); return 1;}
>if (! rrdinf > 0) {printf ("not inf > 0 ... "); return 1;}
>if (! -rrdinf < 0) {printf ("not -inf < 0 ... "); return 1;}
>return 0;
> }
> 
> This returned 0 in previous builds [2], but now we get
> "not isinf(oo)"
> 
> I can't find anything changed upstream in these tests compared to last 
> successfull build.
> 
> Any ideas/thoughts?
> 

This seems to be a regression in Debian's C compiler. I came across a 
similar failure recently, which we found using the 'paranoia' floating 
point test suite from netlib.org.

The C version of 'paranoia' when run on a machine with physical 68882 
works fine when built with an old compiler. And the Fortran version 
(dpara.f) built with a recent f77 compiler also works fine on physical 
68882.

But recent Debian C compilers for m68k don't give the expected results.

BTW, it could be that running test suites on 680x0 emulators is 
contributing to the problem. For example, dpara.f under Qemu prints some 
weird output:

 Searching for overflow threshold:
 Can " z = -y " overflow?  trying it on  y =  -i.f^@^@^@^D^@^@^@E+00
 Seems O.K.
 Overflow threshold is  v =   1.79769313+308
 Overflow saturates at  sat =   i.f^@769313+308

I haven't tried this under Aranym.

[Jean-Michel, Stan, please note that there is a bug tracker entry for this 
issue now, #890466, Cc'd].

> 
> 
> [1] Last failed build:
> https://buildd.debian.org/status/fetch.php?
> pkg=rrdtool&arch=m68k&ver=1.7.0-1&stamp=1518247574&raw=0
> 
> [2] Previous build, sucessfull:
> https://buildd.debian.org/status/fetch.php?
> pkg=rrdtool&arch=m68k&ver=1.6.0-1%2Bb3&stamp=1500859583&raw=0

--