StephanTLavavej / mingw-distro

MinGW distro build scripts.
502 stars 55 forks source link

MPFR 4.0.1 bootstrap comparison failure #49

Closed StephanTLavavej closed 6 years ago

StephanTLavavej commented 6 years ago

GCC 7.3.0, GMP 6.1.2, and MPFR 3.1.6 bootstrap successfully. However, MPFR 4.0.1 fails with:

Comparing stages 2 and 3
Bootstrap comparison failure!
mpfr/src/gmp_op.o differs
make[2]: *** [Makefile:25002: compare] Error 1
MrM21632 commented 6 years ago

Not sure how helpful this is now, but I was able to get GCC 8.1.0 to compile with MPFR 4.0.1. All I did was patch the source using this diff file, and it was able to pass the bootstrap comparison:

diff -Naurd mpfr-4.0.1-old/src/get_ld.c mpfr-4.0.1-new/src/get_ld.c
--- mpfr-4.0.1-old/src/get_ld.c 2018-01-09 07:30:58.000000000 -0500
+++ mpfr-4.0.1-new/src/get_ld.c 2018-05-31 13:59:46.011946500 -0400
@@ -164,6 +164,8 @@
           mpfr_exp_t sh; /* exponent shift -> x/2^sh is in the double range */
           mpfr_t y, z;
           int sign;
+          MPFR_SAVE_EXPO_DECL (expo);
+          MPFR_SAVE_EXPO_MARK (expo);

           /* First round x to the target long double precision, so that
              all subsequent operations are exact (this avoids double rounding

I'm not sure if this is necessary for it to work (EDIT: It isn't), but this was a change you made to the MPFR source, so I figured I might as well. I am also using ISL 0.19, MPC 1.1.0, and GMP 6.1.2.

As for GCC 7.3.0, I'm still not sure why MPFR 4.0.1 causes the comparison step to fail.

StephanTLavavej commented 6 years ago

It looks like MPFR 4.0.1 contains that change, but at different source lines in that function. (I don't manually patch MPFR, I just apply its official patches.) So this would seem to indicate that GCC 8.1.0 no longer suffers from this problem, although I was unable to find any other reports of this in GCC Bugzilla. Thanks!

MrM21632 commented 6 years ago

Yep, it is there,. Somehow I missed it at first. Glad I could be of help.