On Wed, 6 Aug 2025, Tobias Burnus wrote:

> This patch updates contrib/download_prerequisites to download
> newer versions (the latest) of GMP, MPFR and MPC.
> 
> Main reason is a newer MPFR that provides C23 functions,
> additionally, the usual bug fixes or the new "away from zero"
> rounding in MPC might turn out to be useful. GMP also claims
> better support for some newer archs.
> 
> Current GCC mainline already uses the MPFR 4.2+ functions for
> (a)sinpi, (a)cospi, (a)tanpi, and atan2pi, where (e.g.)
> 'sinpi(n) == sin(n*pi)': In the middle end as C23 builtin
> and additionally in the gfortran FE as those are also F2023
> functions. There are additional C23 functions that will profit
> from MPFR support, but still have to be added. See PR 118592
> (esp. comment 2) for the list - and below for the list of
> new MPFR functions 4.2+ brings.
> 
> Note: ISL (0.24, latest 0.27) and gettext (0.22, latest 0.26)
> have not been updated; that's deferred to a future patch (soon,
> if deemed useful, or eventually). See below for some details.
> 
> * * *
> 
> Remarks:
> 
> * download_prerequisites uses
>   http://gcc.gnu.org/pub/gcc/infrastructure/
>   i.e. before the commit, the new files have to be placed
>   there.
> 
> * download_prerequisites is just a convenience script;
>   users could freely use a newer or older version of the
>   libraries (or none for optional ones like ISL) - what
>   counts is: https://gcc.gnu.org/install/prerequisites.html
> 
>   Still, it makes sense that it works for most or all
>   out of the box, esp. on older, non-standard systems.
> 
> * Newer ISL versions require C++17, such that a build will
>   fail with older compiler like, e.g., GCC-10.5 fails (albeit
>   some older ones work with -std=c++1y). - GCC currently
>   requires an ISO C++14 compiler (>= GCC 5.4). As there are
>   no ISL changes that seem to be extremely important, an
>   update does not seem to be sensible.
> 
> * Newer gettext version: Gettext 0.26 (released Jul 20, 2025)
>   contains a long-overdue update of the gcc-internal-format
>   and gfc-internal-format checkings, useful to avoid argument
>   bugs in the .po translation.
>   Thus, there is some merit in doing an update, but not in
>   this patch - and some more testing/checking seems to be
>   sensible before doing it.
> 
> * For GMP, I see that for Fedora, a C23 patch exists for
>   'configure', but for SUSE not. It also seems to build fine
>   with GCC 15 here, i.e. the patch does not seem to be
>   required and the old, currently downloaded GMP has
>   the same configure check, unsurprisingly.
>   There are a few other changes to GMP in the distros, but
>   none seem to be really affected by 6.2 → 6.3, but I might
>   have missed something.
>   MPFR and MPC do not seem to have any changes in distros.
> 
> [As all libraries are out for a while, the hope is that
> serious build errors would have lead to a new minor release,
> but that's just a hope.]
> 
> * * *
> 
> The GMP, MPFR, MPC version, used for the patch and to be added
> to http://gcc.gnu.org/pub/gcc/infrastructure/ are:
> 
> * GMP 6.3.0 (2023-07-30, latest) [currently: 6.2.0]
> - https://gmplib.org/
> - For better compatibility, not the .xz file but the .bz2 file
>   has been used → https://gmplib.org/download/gmp/
> 
> * MPFR 4.2.2 (2025-03-20, latest) [currently: 4.1.0]:
> - https://www.mpfr.org/mpfr-current/
> 
> * MPC 1.3.1 (December 2022, latest) [currently: 1.2.1]:
> - https://www.multiprecision.org/mpc/download.html
> - Requires GMP 5.0.0+ and MPFR 4.1.0+
> 
> * * *
> 
> Testing:
> 
> An in-tree bootstrap GCC mainline with only the three libraries
> suggested has been done on:
> 
> * x86-64 GNU Linux with a GCC 15 system compiler
>   + running the testsuite (which hopefully picked up the just
>   build libraries and not the system's ones).
> 
> * on cfarm13 5.10.0-32-amd64 with GCC 10.2.1 (Debian 11/bullseye)
>   + a partial testsuite run
> 
> * on cfarm70 4.9.0-19-amd64 (Debian 9.13 (stretch); gcc 6.3.0)
>   successfully building the stage1 compiler but stopping half-way
>   through stage1 library build. (Slow system!)
> 
> 
> Otherwise, on #gcc IRC on Tue Jul 15 2025:
> 
> - Iain pointed out to the ISL issue and remarked:
> "AFAIK the other pre-reqs build fine in-tree (I've been using gmp-6.3,
>  mpfr 4.2.1, mpc-1.2.1 and gettext-0.22.5) - but sure I tried mpc-1.3.1
>  on at least one system."
> 
> * * *
> 
> OK for mainline? (Requires a prior update of 'infrastructure').

-gmp='gmp-6.2.1.tar.bz2'
-mpfr='mpfr-4.1.0.tar.bz2'
-mpc='mpc-1.2.1.tar.gz'
+gmp='gmp-6.3.0.tar.xz'
+mpfr='mpfr-4.2.2.tar.bz2'
+mpc='mpc-1.3.0.tar.gz'
 isl='isl-0.24.tar.bz2'
 gettext='gettext-0.22.tar.gz'
 
diff --git a/contrib/prerequisites.md5 b/contrib/prerequisites.md5
index 716a9ff910c..96b9802d901 100644
--- a/contrib/prerequisites.md5
+++ b/contrib/prerequisites.md5
@@ -1,5 +1,5 @@
-28971fc21cf028042d4897f02fd355ea  gmp-6.2.1.tar.bz2
-44b892bc5a45bafb4294d134e13aad1d  mpfr-4.1.0.tar.bz2
-9f16c976c25bb0f76b50be749cd7a3a8  mpc-1.2.1.tar.gz
+c1cd6ef33085e9cb818b9b08371f9000  gmp-6.3.0.tar.bz2

above you have gmp-6.3.0.tar.xz but the md5sums have gmp-6.3.0.tar.bz2

I have placed the respective .bz2 files in infrastructure.

Richard.


> * * *
> 
> Tobias
> 
> PS: CHANGES from the respective NEW files.
> I additionally note that MPFR's configure now uses '#include "gmp.c"'
> instead of '#include <gmp.h>' which together with other configure
> changes (see below) might actually improve the build experience.
> 
> 
> GMP 6.2.0 to 6.3.1 - from the NEWS file:
> 
>   BUGS FIXED
>   * A possible overflow of type int is avoided for mpz_cmp on huge operands.
>   * A possible error condition when a malformed file is read with
>     mpz_inp_raw is now correctly handled.
> 
>   FEATURES
>   * New public function mpz_prevprime, companion of the existing
>     mpz_nextprime.
>   * New documented pointer types mpz_ptr, mpz_srcptr, and similar for
>     other GMP types. Refer to the manual for full list and suggested
>     usage. These types have been present in gmp.h at least since
>     GMP-4.0, but previously not advertised to users.
>   * Support for 64-bit Arm under Macos.
>   * Support for the loongarch64 CPU family.
>   * Support for building with LTO, link-time optimisations.
> 
>   SPEEDUPS
>   * New special code for base = 2 in mpz_powm reduces the average time
>     for the functions that test primality.
>   * Speedup for the function mpz_nextprime on large operands.
>   * Speedup for multiplications (some sizes only) thanks to new
>     internal functions to compute small negacyclic products.
>   * Special assembly code for IBM z13 and later "mainframe" CPUs, resulting in
>     a huge speedup.
>   * Improved assembly for several 64-bit x86 CPUs, Risc-V, 64-bit Arm.
> 
> 
> MPFR 4.1.0 to 4.2.2 - from the NEWS file:
> 
> - In order to resolve a portability issue with the _Float128 fallback to
>   __float128 for binary128 support (e.g. with Clang and glibc 2.41), the
>   prototypes of the corresponding conversion functions had to be changed,
>   with _Float128 replaced by mpfr_float128, where mpfr_float128 is a macro
>   defined as _Float128 by default. This changes neither the ABI nor the API
>   (except that the end user of MPFR would need to define mpfr_float128 as
>   the actual type for the binary128 format if this is not the standard
>   _Float128 type).
> - Other bug fixes (see <https://www.mpfr.org/mpfr-4.2.1/#fixed> and/or the
>   ChangeLog file). In particular, the formatted output functions behaved
>   incorrectly with %c on the value 0; such a use is uncommon, but this bug
>   may have security implications.
> - Improved MPFR manual.
> - Detect the use of GMP's buggy vsnprintf replacement at configure time.
>   With it, the tests of "%a" will be disabled to avoid an assertion failure
>   in the MPFR testsuite. A warning will be displayed in the configure output
>   in such a case.
> - Bug fixes (see <https://www.mpfr.org/mpfr-4.2.0/#fixed> and/or the
>   ChangeLog file).
> - Improved MPFR manual.
> - Configure tests: replaced the test of the link with GMP, in order to
>   avoid the use of a function without a prototype (Autoconf issue), as
>   this is obsolescent in ISO C. The new test should be more robust.
> - The "fondue savoyarde" release.
> - Binary compatible with MPFR 4.0.* and 4.1.*, though some minor changes in
>   the behavior of the formatted output functions may be visible, regarded
>   as underspecified behavior or bug fixes (see below).
> - New functions mpfr_cosu, mpfr_sinu, mpfr_tanu, mpfr_acosu, mpfr_asinu,
>   mpfr_atanu and mpfr_atan2u.
> - New functions mpfr_cospi, mpfr_sinpi, mpfr_tanpi, mpfr_acospi, mpfr_asinpi,
>   mpfr_atanpi and mpfr_atan2pi.
> - New functions mpfr_log2p1, mpfr_log10p1, mpfr_exp2m1, mpfr_exp10m1 and
>   mpfr_compound_si.
> - New functions mpfr_fmod_ui, mpfr_powr, mpfr_pown, mpfr_pow_uj, mpfr_pow_sj
>   and mpfr_rootn_si (mpfr_pown is actually a macro defined as an alias for
>   mpfr_pow_sj).
> - Bug fixes.
>   In particular, for the formatted output functions (mpfr_printf, etc.),
>   the case where the precision consists only of a period has been fixed
>   to be like ".0" as specified in the ISO C standard, and the manual has
>   been corrected and clarified.
>   The macros of the custom interface have also been fixed: they now behave
>   like functions (except a minor limitation for mpfr_custom_init_set).
> 
> 
> MPC 1.2.1 to 1.3.1 - from the NEWS file:
> 
>   - Bug fix: It is again possible to include mpc.h without including
>     stdio.h.
>   - New function: mpc_agm
>   - New rounding modes "away from zero", indicated by the letter "A" and
>     corresponding to MPFR_RNDA on the designated real or imaginary part.
>   - New experimental ball arithmetic.
>   - New experimental function: mpc_eta_fund
>   - Bug fixes:
>     - mpc_asin for asin(z) with small |Re(z)| and tiny |Im(z)|
>     - mpc_pow_fr: sign of zero part of result when the base has up to sign
>       the same real and imaginary part, and the exponent is an even
>       positive integer
>     - mpc_fma: the returned 'int' value was incorrect in some cases
>     (indicating
>       whether the rounded real/imaginary parts were smaller/equal/greater
>       than the exact values), but the computed complex value was correct.
>   - Remove the unmaintained Makefile.vc; build files for Visual Studio
>     can be found at https://github.com/BrianGladman/mpc .
> 

-- 
Richard Biener <rguent...@suse.de>
SUSE Software Solutions Germany GmbH,
Frankenstrasse 146, 90461 Nuernberg, Germany;
GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)

Reply via email to