tools/mpfr: update to 4.2.0

Changes from versions 4.1.* to version 4.2.0:
- 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).

Remove upstreamed:
- 002-Fix-mpfr_custom_get_kind-macro-bug.patch

Refresh patches:
- 001-only_src.patch

Signed-off-by: Linhui Liu <liulinhui36@gmail.com>
This commit is contained in:
Linhui Liu 2023-01-07 09:55:28 +08:00 committed by Hauke Mehrtens
parent c4b5239b63
commit a72981b97a
3 changed files with 4 additions and 80 deletions

View File

@ -7,12 +7,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=mpfr
PKG_VERSION:=4.1.1
PKG_VERSION:=4.2.0
PKG_CPE_ID:=cpe:/a:mpfr:gnu_mpfr
PKG_SOURCE_URL:=@GNU/mpfr http://www.mpfr.org/mpfr-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_HASH:=ffd195bd567dbaffc3b98b23fd00aad0537680c9896171e44fe3ff79e28ac33d
PKG_HASH:=06a378df13501248c1b2db5aa977a2c8126ae849a9d9b7be2546fb4a9c26d993
HOST_BUILD_PARALLEL:=1
HOST_FIXUP:=autoreconf

View File

@ -1,6 +1,6 @@
--- a/Makefile.am
+++ b/Makefile.am
@@ -34,7 +34,7 @@ AUTOMAKE_OPTIONS = gnu
@@ -38,7 +38,7 @@ AUTOMAKE_OPTIONS = gnu
# old Automake version.
ACLOCAL_AMFLAGS = -I m4
@ -11,7 +11,7 @@
pkgconfig_DATA = mpfr.pc
--- a/Makefile.in
+++ b/Makefile.in
@@ -397,7 +397,7 @@ AUTOMAKE_OPTIONS = gnu
@@ -401,7 +401,7 @@ AUTOMAKE_OPTIONS = gnu
# libtoolize and in case some developer needs to switch back to an
# old Automake version.
ACLOCAL_AMFLAGS = -I m4

View File

@ -1,76 +0,0 @@
From 0ce17bae34a6c54de31b126f969d3ddd72c6bc37 Mon Sep 17 00:00:00 2001
From: Vincent Lefevre <vincent@vinc17.net>
Date: Tue, 22 Nov 2022 16:33:00 +0100
Subject: [PATCH] Fix mpfr_custom_get_kind() macro bug.
* src/mpfr.h: in the mpfr_custom_get_kind() macro, changed mpfr_ptr to
mpfr_srcptr for _x to agree with the function prototype, in order to
avoid a compilation failure of user code in some cases. This bug was
introduced by commit 9f94e0311ed53d0c64d4fbca249d19cc4888027e, which
introduced the temporary variable _x to avoid an incorrect number of
evaluations of the x argument.
* tests/tstckintc.c: improved the tests to detect this bug.
This should fix mpfr bug #1.
Bug initially reported by FX Coudert:
https://github.com/CGAL/cgal/issues/7064
It affects Fedora Linux:
https://bugzilla.redhat.com/show_bug.cgi?id=2144197
---
src/mpfr.h | 2 +-
tests/tstckintc.c | 10 +++++++---
2 files changed, 8 insertions(+), 4 deletions(-)
--- a/src/mpfr.h
+++ b/src/mpfr.h
@@ -1027,7 +1027,7 @@ __MPFR_DECLSPEC int mpfr_total_order_p (
#if __GNUC__ > 2 || __GNUC_MINOR__ >= 95
#define mpfr_custom_get_kind(x) \
__extension__ ({ \
- mpfr_ptr _x = (x); \
+ mpfr_srcptr _x = (x); \
_x->_mpfr_exp > __MPFR_EXP_INF ? \
(mpfr_int) MPFR_REGULAR_KIND * MPFR_SIGN (_x) \
: _x->_mpfr_exp == __MPFR_EXP_INF ? \
--- a/tests/tstckintc.c
+++ b/tests/tstckintc.c
@@ -295,14 +295,16 @@ static void
test_nan_inf_zero (void)
{
mpfr_ptr val;
+ mpfr_srcptr sval; /* for compilation error checking */
int sign;
int kind;
reset_stack ();
val = new_mpfr (MPFR_PREC_MIN);
+ sval = val;
mpfr_set_nan (val);
- kind = (mpfr_custom_get_kind) (val);
+ kind = (mpfr_custom_get_kind) (sval);
if (kind != MPFR_NAN_KIND)
{
printf ("mpfr_custom_get_kind error: ");
@@ -380,7 +382,8 @@ static long *
dummy_set_si (long si)
{
mpfr_t x;
- long * r = dummy_new ();
+ mpfr_srcptr px; /* for compilation error checking */
+ long *r = dummy_new ();
int i1, i2, i3, i4, i5;
/* Check that the type "void *" can be used, like with the function.
@@ -405,7 +408,8 @@ dummy_set_si (long si)
MPFR_ASSERTN (i5 == 1);
mpfr_set_si (x, si, MPFR_RNDN);
- r[0] = mpfr_custom_get_kind (x);
+ px = x;
+ r[0] = mpfr_custom_get_kind (px);
/* Check that the type "void *" can be used in C, like with the function
(forbidden in C++). Also check side effects. */