public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-libs/mpc/, dev-libs/mpc/files/
@ 2017-12-26 16:40 Sergei Trofimovich
  0 siblings, 0 replies; 3+ messages in thread
From: Sergei Trofimovich @ 2017-12-26 16:40 UTC (permalink / raw
  To: gentoo-commits

commit:     cdf7f5c37e8a3dfacfbf5fc81a6a2a8ef3b77a9a
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 26 16:39:25 2017 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Tue Dec 26 16:39:56 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cdf7f5c3

dev-libs/mpc: fix build failure against mpfr-4.0.0, bug #642300

mprf-4.0.0 introduced new 'mpfr_fmma' symbol that collides
with mpc's 'mpfr_fmma' symbol.

It's a backport of upstream commit
https://scm.gforge.inria.fr/anonscm/gitweb?p=mpc/mpc.git;a=commitdiff;h=36a84f43f326de14db888ba07936cc9621c23f19
("use mpfr_fmma and mpfr_fmms if provided by mpfr")
which does the following to mitigate build failure:
- rename local symbol to 'mpc_fmma' to avoid collision
- reuse mpfr's symbol if that exists

Reported-by: Perfect Gentleman
Closes: https://bugs.gentoo.org/642300
Package-Manager: Portage-2.3.19, Repoman-2.3.6

 dev-libs/mpc/files/mpc-1.0.3-mpfr-4.0.0.patch | 85 +++++++++++++++++++++++++++
 dev-libs/mpc/mpc-1.0.3.ebuild                 |  1 +
 2 files changed, 86 insertions(+)

diff --git a/dev-libs/mpc/files/mpc-1.0.3-mpfr-4.0.0.patch b/dev-libs/mpc/files/mpc-1.0.3-mpfr-4.0.0.patch
new file mode 100644
index 00000000000..7f9f7e2b974
--- /dev/null
+++ b/dev-libs/mpc/files/mpc-1.0.3-mpfr-4.0.0.patch
@@ -0,0 +1,85 @@
+https://bugs.gentoo.org/642300
+
+From 36a84f43f326de14db888ba07936cc9621c23f19 Mon Sep 17 00:00:00 2001
+From: Paul Zimmermann <Paul.Zimmermann@inria.fr>
+Date: Sun, 10 Jan 2016 23:19:37 +0100
+Subject: [PATCH] use mpfr_fmma and mpfr_fmms if provided by mpfr
+
+---
+ configure.ac | 16 ++++++++++++++++
+ src/mul.c    | 15 ++++++++++++---
+ 2 files changed, 28 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index b6fa199..bdb21ff 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -165,6 +165,22 @@ AC_LINK_IFELSE(
+         AC_MSG_ERROR([libmpfr not found or uses a different ABI (including static vs shared).])
+         ])
+ 
++AC_MSG_CHECKING(for mpfr_fmma)
++LIBS="-lmpfr $LIBS"
++AC_LINK_IFELSE(
++        [AC_LANG_PROGRAM(
++                [[#include "mpfr.h"]],
++                [[mpfr_t x; mpfr_fmma (x, x, x, x, x, 0);]]
++        )],
++        [
++	AC_MSG_RESULT(yes)
++	AC_DEFINE(HAVE_MPFR_FMMA, 1, [mpfr_fmma is present])
++	],
++        [
++        AC_MSG_RESULT(no)
++	AC_DEFINE(HAVE_MPFR_FMMA, 0, [mpfr_fmma	is not present])
++        ])
++
+ # Check for a recent GMP
+ # We only guarantee that with a *functional* and recent enough GMP version,
+ # MPC will compile; we do not guarantee that GMP will compile.
+diff --git a/src/mul.c b/src/mul.c
+index 3c9c0a7..8c4afe4 100644
+--- a/src/mul.c
++++ b/src/mul.c
+@@ -175,8 +175,9 @@ mul_imag (mpc_ptr z, mpc_srcptr x, mpc_srcptr y, mpc_rnd_t rnd)
+ #define MPFR_EXP(x)       ((x)->_mpfr_exp)
+ #define MPFR_LIMB_SIZE(x) ((MPFR_PREC (x) - 1) / GMP_NUMB_BITS + 1)
+ 
++#if HAVE_MPFR_FMMA == 0
+ static int
+-mpfr_fmma (mpfr_ptr z, mpfr_srcptr a, mpfr_srcptr b, mpfr_srcptr c,
++mpc_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.
+@@ -359,6 +360,7 @@ mpfr_fmma (mpfr_ptr z, mpfr_srcptr a, mpfr_srcptr b, mpfr_srcptr c,
+    return inex;
+ }
++#endif
+ 
+ 
+ int
+ mpc_mul_naive (mpc_ptr z, mpc_srcptr x, mpc_srcptr y, mpc_rnd_t rnd)
+@@ -375,10 +377,17 @@ mpc_mul_naive (mpc_ptr z, mpc_srcptr x, mpc_srcptr y, mpc_rnd_t rnd)
+    else
+       rop [0] = z [0];
+ 
+-   inex = MPC_INEX (mpfr_fmma (mpc_realref (rop), mpc_realref (x), mpc_realref (y), mpc_imagref (x),
+-                               mpc_imagref (y), -1, MPC_RND_RE (rnd)),
++#if HAVE_MPFR_FMMA
++   inex = MPC_INEX (mpfr_fmms (mpc_realref (rop), mpc_realref (x), mpc_realref (y), mpc_imagref (x),
++                               mpc_imagref (y), MPC_RND_RE (rnd)),
+                     mpfr_fmma (mpc_imagref (rop), mpc_realref (x), mpc_imagref (y), mpc_imagref (x),
++                               mpc_realref (y), MPC_RND_IM (rnd)));
++#else
++   inex = MPC_INEX (mpc_fmma (mpc_realref (rop), mpc_realref (x), mpc_realref (y), mpc_imagref (x),
++                               mpc_imagref (y), -1, MPC_RND_RE (rnd)),
++                    mpc_fmma (mpc_imagref (rop), mpc_realref (x), mpc_imagref (y), mpc_imagref (x),
+                                mpc_realref (y), +1, MPC_RND_IM (rnd)));
++#endif
+ 
+    mpc_set (z, rop, MPC_RNDNN);
+    if (overlap)
+-- 
+2.15.1
+

diff --git a/dev-libs/mpc/mpc-1.0.3.ebuild b/dev-libs/mpc/mpc-1.0.3.ebuild
index 198111c0b08..ac5e3396ddd 100644
--- a/dev-libs/mpc/mpc-1.0.3.ebuild
+++ b/dev-libs/mpc/mpc-1.0.3.ebuild
@@ -19,6 +19,7 @@ DEPEND=">=dev-libs/gmp-4.3.2[${MULTILIB_USEDEP},static-libs?]
 RDEPEND="${DEPEND}"
 
 src_prepare() {
+	epatch "${FILESDIR}"/${P}-mpfr-4.0.0.patch
 	elibtoolize #347317
 }
 


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/mpc/, dev-libs/mpc/files/
@ 2017-12-29 10:43 Sergei Trofimovich
  0 siblings, 0 replies; 3+ messages in thread
From: Sergei Trofimovich @ 2017-12-29 10:43 UTC (permalink / raw
  To: gentoo-commits

commit:     66cdca4a0b121ae77b2530b080e414f96569206a
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 29 10:43:01 2017 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Fri Dec 29 10:43:26 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=66cdca4a

dev-libs/mpc: remove eautoreconf call from ebuild, bug #642300

As mpc is one of bootstrap libraries it's highly undesirable
to depend on autotools. Early autotools requirement breaks
prefix bootstrap for example. See https://bugs.gentoo.org/642300

The change updates patch to modify both configure.ac and configure.

Bug: https://bugs.gentoo.org/642576
Closes: https://bugs.gentoo.org/642300
Package-Manager: Portage-2.3.19, Repoman-2.3.6

 dev-libs/mpc/files/mpc-1.0.3-mpfr-4.0.0.patch | 44 +++++++++++++++++++++++++++
 dev-libs/mpc/mpc-1.0.3-r1.ebuild              |  3 +-
 2 files changed, 45 insertions(+), 2 deletions(-)

diff --git a/dev-libs/mpc/files/mpc-1.0.3-mpfr-4.0.0.patch b/dev-libs/mpc/files/mpc-1.0.3-mpfr-4.0.0.patch
index 7f9f7e2b974..72d6f2217ca 100644
--- a/dev-libs/mpc/files/mpc-1.0.3-mpfr-4.0.0.patch
+++ b/dev-libs/mpc/files/mpc-1.0.3-mpfr-4.0.0.patch
@@ -80,6 +80,50 @@ index 3c9c0a7..8c4afe4 100644
  
     mpc_set (z, rop, MPC_RNDNN);
     if (overlap)
+--- a/configure
++++ b/configure
+@@ -13835,6 +13835,41 @@ else
+ $as_echo "no" >&6; }
+         as_fn_error $? "libmpfr not found or uses a different ABI (including static vs shared)." "$LINENO" 5
+ 
++fi
++rm -f core conftest.err conftest.$ac_objext \
++    conftest$ac_exeext conftest.$ac_ext
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for mpfr_fmma" >&5
++$as_echo_n "checking for mpfr_fmma... " >&6; }
++LIBS="-lmpfr $LIBS"
++cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h.  */
++#include "mpfr.h"
++int
++main ()
++{
++mpfr_t x; mpfr_fmma (x, x, x, x, x, 0);
++
++  ;
++  return 0;
++}
++_ACEOF
++if ac_fn_c_try_link "$LINENO"; then :
++
++	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
++$as_echo "yes" >&6; }
++
++$as_echo "#define HAVE_MPFR_FMMA 1" >>confdefs.h
++
++
++else
++
++        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++
++$as_echo "#define HAVE_MPFR_FMMA 0" >>confdefs.h
++
++
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
 -- 
 2.15.1
 

diff --git a/dev-libs/mpc/mpc-1.0.3-r1.ebuild b/dev-libs/mpc/mpc-1.0.3-r1.ebuild
index c3508234133..43c7e147e0d 100644
--- a/dev-libs/mpc/mpc-1.0.3-r1.ebuild
+++ b/dev-libs/mpc/mpc-1.0.3-r1.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=6
 
-inherit autotools eutils libtool multilib-minimal
+inherit eutils libtool multilib-minimal
 
 DESCRIPTION="A library for multiprecision complex arithmetic with exact rounding"
 HOMEPAGE="http://mpc.multiprecision.org/"
@@ -26,7 +26,6 @@ PATCHES=(
 src_prepare() {
 	default
 
-	eautoreconf
 	elibtoolize #347317
 }
 


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/mpc/, dev-libs/mpc/files/
@ 2022-12-10 18:19 Sam James
  0 siblings, 0 replies; 3+ messages in thread
From: Sam James @ 2022-12-10 18:19 UTC (permalink / raw
  To: gentoo-commits

commit:     5331483004ab6e2e16577d7d230b7d0b588325ed
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 10 18:19:27 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Dec 10 18:19:36 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=53314830

dev-libs/mpc: backport mpc.h fix

Fixes building e.g. GCC.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-libs/mpc/files/mpc-1.3.0-header.patch          | 31 ++++++++++++++++++++++
 .../mpc/{mpc-1.3.0.ebuild => mpc-1.3.0-r1.ebuild}  |  4 +++
 2 files changed, 35 insertions(+)

diff --git a/dev-libs/mpc/files/mpc-1.3.0-header.patch b/dev-libs/mpc/files/mpc-1.3.0-header.patch
new file mode 100644
index 000000000000..80f1d113f90c
--- /dev/null
+++ b/dev-libs/mpc/files/mpc-1.3.0-header.patch
@@ -0,0 +1,31 @@
+https://gitlab.inria.fr/mpc/mpc/-/commit/e944aa454e60cbff8ab4e8c70dd974083398378f
+https://sympa.inria.fr/sympa/arc/mpc-discuss/2022-12/msg00034.html
+
+From e944aa454e60cbff8ab4e8c70dd974083398378f Mon Sep 17 00:00:00 2001
+From: Paul Zimmermann <Paul.Zimmermann@inria.fr>
+Date: Sat, 10 Dec 2022 08:47:51 +0100
+Subject: [PATCH] functions with FILE arguments should be defined only when
+ stdio.h is included
+
+--- a/src/mpc.h
++++ b/src/mpc.h
+@@ -270,6 +270,7 @@ __MPC_DECLSPEC long double _Complex mpc_get_ldc (mpc_srcptr, mpc_rnd_t);
+ __MPC_DECLSPEC int mpc_inp_str    (mpc_ptr, FILE *, size_t *, int, mpc_rnd_t);
+ __MPC_DECLSPEC size_t mpc_out_str (FILE *, int, size_t, mpc_srcptr, mpc_rnd_t);
+ __MPC_DECLSPEC void mpcb_out_str  (FILE *f, mpcb_srcptr);
++__MPC_DECLSPEC void mpcr_out_str (FILE *f, mpcr_srcptr r);
+ #endif
+ 
+ __MPC_DECLSPEC int mpcr_inf_p (mpcr_srcptr r);
+@@ -284,7 +285,6 @@ __MPC_DECLSPEC void mpcr_set_ui64_2si64 (mpcr_ptr r, uint64_t mant,
+    int64_t exp);
+ __MPC_DECLSPEC void mpcr_max (mpcr_ptr r, mpcr_srcptr s, mpcr_srcptr t);
+ __MPC_DECLSPEC int64_t mpcr_get_exp (mpcr_srcptr r);
+-__MPC_DECLSPEC void mpcr_out_str (FILE *f, mpcr_srcptr r);
+ __MPC_DECLSPEC void mpcr_mul (mpcr_ptr r, mpcr_srcptr s, mpcr_srcptr t);
+ __MPC_DECLSPEC void mpcr_mul_2ui (mpcr_ptr r, mpcr_srcptr s,
+    unsigned long int e);
+-- 
+GitLab
+
+

diff --git a/dev-libs/mpc/mpc-1.3.0.ebuild b/dev-libs/mpc/mpc-1.3.0-r1.ebuild
similarity index 95%
rename from dev-libs/mpc/mpc-1.3.0.ebuild
rename to dev-libs/mpc/mpc-1.3.0-r1.ebuild
index aa330fda2d8a..58311b7a2ead 100644
--- a/dev-libs/mpc/mpc-1.3.0.ebuild
+++ b/dev-libs/mpc/mpc-1.3.0-r1.ebuild
@@ -27,6 +27,10 @@ DEPEND="
 "
 RDEPEND="${DEPEND}"
 
+PATCHES=(
+	"${FILESDIR}"/${P}-header.patch
+)
+
 multilib_src_configure() {
 	ECONF_SOURCE="${S}" econf $(use_enable static-libs static)
 }


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-12-10 18:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-26 16:40 [gentoo-commits] repo/gentoo:master commit in: dev-libs/mpc/, dev-libs/mpc/files/ Sergei Trofimovich
  -- strict thread matches above, loose matches on Subject: below --
2017-12-29 10:43 Sergei Trofimovich
2022-12-10 18:19 Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox