This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH build machinery]: Add/upgrade "recommended" versions for GMP/MPFR/MPC


As long as we've required MPFR for building GCC, we've had the notion of a
hard minimum version as well as a recommended version.  This was to
balance the ability to build GCC at all vs the desire to get bugfixes for
the library.  The compromise was to use a configure message as well as the
versions listed in the docs as a subtle nudge to upgrade while still
allowing older library releases to be used.

While upgrading MPFR's recommended version, I decided to copy this
paradigm from MPFR to GMP and MPC and upgrade the recommended versions to
the latest stable release for all three libraries.  I matched the message
printed for hard-errors during configure to the hard-minimum that is
actually enforced.

No change has been made to any of GCC's hard-requirements.  I'm merely
adding or upgrading recommended library versions.

Tested on x86_64-unknown-linux-gnu via configuring with the following
library versions which represent hard minimum (accepted but warns),
boundary condition version if applicable (same behavior) and recommended
version (accepted without complaint).  (Gmp-4.2.1 was the oldest I could
find handy, but the actual minimum of 4.2.0 should work fine too.)

gmp-4.2.1, gmp-4.3.1, gmp-4.3.2
mpfr-2.3.1, mpfr-2.4.1, mpfr-2.4.2
mpc-0.8, mpc-0.8.1

All the above versions behaved as expected.  I also did a bootstrap,
mainly to test the doc changes.

Okay for gcc trunk?  (I'll sync with src too.)

		Thanks,
		--Kaveh


2010-01-10  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* configure.ac: Add "recommended" version checks for GMP/MPC.
	Update recommended GMP/MPFR/MPC versions.
	* configure: Regenerate.

gcc:
	* doc/install.texi: Update recommended GMP/MPFR/MPC versions.

diff -rup orig/egcc-SVN20100110/configure.ac egcc-SVN20100110/configure.ac
--- orig/egcc-SVN20100110/configure.ac	2010-01-08 02:01:04.000000000 +0100
+++ egcc-SVN20100110/configure.ac	2010-01-10 18:01:54.000000000 +0100
@@ -1342,18 +1342,27 @@ if test -d ${srcdir}/gcc && test "x$have
   have_gmp=yes
   saved_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS $gmpinc"
-  # Check GMP actually works
-  AC_MSG_CHECKING([for correct version of gmp.h])
+  # Check for the recommended and required versions of GMP.
+  AC_MSG_CHECKING([for the correct version of gmp.h])
   AC_TRY_COMPILE([#include "gmp.h"],[
-  #if __GNU_MP_VERSION < 4 || (__GNU_MP_VERSION == 4 && __GNU_MP_VERSION_MINOR < 2)
+  #define GCC_GMP_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+  #define GCC_GMP_VERSION GCC_GMP_VERSION_NUM(__GNU_MP_VERSION,__GNU_MP_VERSION_MINOR,__GNU_MP_VERSION_PATCHLEVEL)
+  #if GCC_GMP_VERSION < GCC_GMP_VERSION_NUM(4,2,0)
   choke me
   #endif
-  ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); have_gmp=no])
+  ], AC_TRY_COMPILE([#include <gmp.h>],[
+  #define GCC_GMP_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+  #define GCC_GMP_VERSION GCC_GMP_VERSION_NUM(__GNU_MP_VERSION,__GNU_MP_VERSION_MINOR,__GNU_MP_VERSION_PATCHLEVEL)
+  #if GCC_GMP_VERSION < GCC_GMP_VERSION_NUM(4,3,2)
+  choke me
+  #endif
+  ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])]),
+   [AC_MSG_RESULT([no]); have_gmp=no])

   # If we have GMP, check the MPFR version.
   if test x"$have_gmp" = xyes; then
-    dnl MPFR 2.3.1 is acceptable, but MPFR 2.3.2 is better.
-    AC_MSG_CHECKING([for correct version of mpfr.h])
+    # Check for the recommended and required versions of MPFR.
+    AC_MSG_CHECKING([for the correct version of mpfr.h])
     AC_TRY_COMPILE([#include <gmp.h>
     #include <mpfr.h>],[
     #if MPFR_VERSION < MPFR_VERSION_NUM(2,3,1)
@@ -1361,7 +1370,7 @@ if test -d ${srcdir}/gcc && test "x$have
     #endif
     ], AC_TRY_COMPILE([#include <gmp.h>
     #include <mpfr.h>],[
-    #if MPFR_VERSION < MPFR_VERSION_NUM(2,3,2)
+    #if MPFR_VERSION < MPFR_VERSION_NUM(2,4,2)
     choke me
     #endif
     ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])]),
@@ -1370,12 +1379,18 @@ if test -d ${srcdir}/gcc && test "x$have

   # Check for the MPC header version.
   if test x"$have_gmp" = xyes ; then
+    # Check for the recommended and required versions of MPC.
     AC_MSG_CHECKING([for the correct version of mpc.h])
     AC_TRY_COMPILE([#include <mpc.h>],[
-    #if MPC_VERSION < MPC_VERSION_NUM (0,8,0)
+    #if MPC_VERSION < MPC_VERSION_NUM(0,8,0)
     choke me
     #endif
-    ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); have_gmp=no])
+    ], AC_TRY_COMPILE([#include <mpc.h>],[
+    #if MPC_VERSION < MPC_VERSION_NUM(0,8,1)
+    choke me
+    #endif
+    ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])]),
+     [AC_MSG_RESULT([no]); have_gmp=no])
   fi

   # Now check the MPFR library.
@@ -1407,8 +1422,10 @@ if test -d ${srcdir}/gcc && test "x$have

   CFLAGS="$saved_CFLAGS"

+# The library versions listed in the error message below should match
+# the HARD-minimums enforced above.
   if test x$have_gmp != xyes; then
-    AC_MSG_ERROR([Building GCC requires GMP 4.2+, MPFR 2.3.2+ and MPC 0.8.0+.
+    AC_MSG_ERROR([Building GCC requires GMP 4.2+, MPFR 2.3.1+ and MPC 0.8.0+.
 Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
 their locations.  Source code for these libraries can be found at
 their respective hosting sites as well as at
diff -rup orig/egcc-SVN20100110/gcc/doc/install.texi egcc-SVN20100110/gcc/doc/install.texi
--- orig/egcc-SVN20100110/gcc/doc/install.texi	2009-12-16 02:00:42.000000000 +0100
+++ egcc-SVN20100110/gcc/doc/install.texi	2010-01-10 17:48:48.000000000 +0100
@@ -302,7 +302,7 @@ Necessary (only on some platforms) to un
 systems' @command{tar} programs will also work, only try GNU
 @command{tar} if you have problems.

-@item GNU Multiple Precision Library (GMP) version 4.2 (or later)
+@item GNU Multiple Precision Library (GMP) version 4.3.2 (or later)

 Necessary to build GCC@.  If you do not have it installed in your
 library search path, you will have to configure with the
@@ -311,7 +311,7 @@ and @option{--with-gmp-include}.  Altern
 distribution is found in a subdirectory of your GCC sources named
 @file{gmp}, it will be built together with GCC@.

-@item MPFR Library version 2.3.2 (or later)
+@item MPFR Library version 2.4.2 (or later)

 Necessary to build GCC@.  It can be downloaded from
 @uref{http://www.mpfr.org/}.  The @option{--with-mpfr} configure
@@ -321,7 +321,7 @@ default library search path.  See also @
 distribution is found in a subdirectory of your GCC sources named
 @file{mpfr}, it will be built together with GCC@.

-@item MPC Library version 0.8.0 (or later)
+@item MPC Library version 0.8.1 (or later)

 Necessary to build GCC@.  It can be downloaded from
 @uref{http://www.multiprecision.org/}.  The @option{--with-mpc}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]