pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang/gcc6 Fix building with mpfr 4.0.0



details:   https://anonhg.NetBSD.org/pkgsrc/rev/41371c0338cf
branches:  trunk
changeset: 374792:41371c0338cf
user:      adam <adam%pkgsrc.org@localhost>
date:      Mon Jan 29 14:02:08 2018 +0000

description:
Fix building with mpfr 4.0.0

diffstat:

 lang/gcc6/distinfo                         |   4 +++-
 lang/gcc6/patches/patch-mpc_src_mpc-impl.h |  17 +++++++++++++++++
 lang/gcc6/patches/patch-mpc_src_mul.c      |  27 +++++++++++++++++++++++++++
 3 files changed, 47 insertions(+), 1 deletions(-)

diffs (67 lines):

diff -r b27b1495eaf0 -r 41371c0338cf lang/gcc6/distinfo
--- a/lang/gcc6/distinfo        Mon Jan 29 13:55:30 2018 +0000
+++ b/lang/gcc6/distinfo        Mon Jan 29 14:02:08 2018 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.8 2017/07/04 21:56:40 maya Exp $
+$NetBSD: distinfo,v 1.9 2018/01/29 14:02:08 adam Exp $
 
 SHA1 (gcc-6.4.0.tar.xz) = f237974b2d3af0f60936ce6a2f35b912a91e0239
 RMD160 (gcc-6.4.0.tar.xz) = 63c16a8f5df0c2c2db3355ff1e984ad6b3653ab3
@@ -38,3 +38,5 @@
 SHA1 (patch-libstdc++-v3_config_os_bsd_netbsd_ctype__configure__char.cc) = b63c2682336c9b6f0e0d7b900d6f40ad6e7a5ec4
 SHA1 (patch-libstdc++-v3_config_os_bsd_netbsd_ctype__inline.h) = 626fc1f9c035ac5cef30a92d525af4e778835ebf
 SHA1 (patch-libstdc++-v3_libsupc++_unwind-cxx.h) = 9784bfa4323f8498b36565d0fea28fce69ffdbb1
+SHA1 (patch-mpc_src_mpc-impl.h) = b447abccc4d715690ca10d4734ac5c35652768e1
+SHA1 (patch-mpc_src_mul.c) = d34ee11845ca20a376dd80a907b5ab96b81933f6
diff -r b27b1495eaf0 -r 41371c0338cf lang/gcc6/patches/patch-mpc_src_mpc-impl.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/gcc6/patches/patch-mpc_src_mpc-impl.h        Mon Jan 29 14:02:08 2018 +0000
@@ -0,0 +1,17 @@
+$NetBSD: patch-mpc_src_mpc-impl.h,v 1.1 2018/01/29 14:02:08 adam Exp $
+
+Work around macros removed in mpfr 4.0.0.
+
+--- mpc/src/mpc-impl.h.orig    2018-01-29 13:32:27.000000000 +0000
++++ mpc/src/mpc-impl.h
+@@ -60,8 +60,8 @@ along with this program. If not, see htt
+    mpfr_setsign (x, y, 0, rnd) : \
+    mpfr_copysign (x, y, z, rnd))
+    /* work around spurious signs in nan */
+-#define MPFR_ADD_ONE_ULP(x) mpfr_add_one_ulp (x, GMP_RNDN)
+-#define MPFR_SUB_ONE_ULP(x) mpfr_sub_one_ulp (x, GMP_RNDN)
++#define MPFR_ADD_ONE_ULP(x) (mpfr_sgn(x) > 0 ? mpfr_nextabove(x) : mpfr_nextbelow(x))
++#define MPFR_SUB_ONE_ULP(x) (mpfr_sgn(x) > 0 ? mpfr_nextbelow(x) : mpfr_nextabove(x))
+    /* drop unused rounding mode from macroes */
+ #define MPFR_SWAP(a,b) do { mpfr_srcptr tmp; tmp = a; a = b; b = tmp; } while (0)
+ 
diff -r b27b1495eaf0 -r 41371c0338cf lang/gcc6/patches/patch-mpc_src_mul.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/gcc6/patches/patch-mpc_src_mul.c     Mon Jan 29 14:02:08 2018 +0000
@@ -0,0 +1,27 @@
+$NetBSD: patch-mpc_src_mul.c,v 1.1 2018/01/29 14:02:08 adam Exp $
+
+Avoid conflict with mpfr_fmma introduced in mpfr 4.0.0.
+
+--- mpc/src/mul.c.orig 2018-01-29 13:19:07.000000000 +0000
++++ mpc/src/mul.c
+@@ -172,7 +172,7 @@ mul_imag (mpc_ptr z, mpc_srcptr x, mpc_s
+ 
+ 
+ static int
+-mpfr_fmma (mpfr_ptr z, mpfr_srcptr a, mpfr_srcptr b, mpfr_srcptr c,
++gcc_mpfr_fmma (mpfr_ptr z, mpfr_srcptr a, mpfr_srcptr b, mpfr_srcptr c,
+            mpfr_srcptr d, int sign, mpfr_rnd_t rnd)
+ {
+    /* Computes z = ab+cd if sign >= 0, or z = ab-cd if sign < 0.
+@@ -337,9 +337,9 @@ mpc_mul_naive (mpc_ptr z, mpc_srcptr x, 
+    else
+       rop [0] = z [0];
+ 
+-   inex = MPC_INEX (mpfr_fmma (mpc_realref (rop), mpc_realref (x), mpc_realref (y), mpc_imagref (x),
++   inex = MPC_INEX (gcc_mpfr_fmma (mpc_realref (rop), mpc_realref (x), mpc_realref (y), mpc_imagref (x),
+                                mpc_imagref (y), -1, MPC_RND_RE (rnd)),
+-                    mpfr_fmma (mpc_imagref (rop), mpc_realref (x), mpc_imagref (y), mpc_imagref (x),
++                    gcc_mpfr_fmma (mpc_imagref (rop), mpc_realref (x), mpc_imagref (y), mpc_imagref (x),
+                                mpc_realref (y), +1, MPC_RND_IM (rnd)));
+ 
+    mpc_set (z, rop, MPC_RNDNN);



Home | Main Index | Thread Index | Old Index