dev-libs/gmp: fix USE=pgo builds for some systems #568320
authorMike Frysinger <vapier@gentoo.org>
Sun, 27 Nov 2016 01:05:54 +0000 (20:05 -0500)
committerMike Frysinger <vapier@gentoo.org>
Sun, 27 Nov 2016 01:07:12 +0000 (20:07 -0500)
dev-libs/gmp/files/gmp-6.1.0-tune-printf.patch [new file with mode: 0644]
dev-libs/gmp/gmp-6.1.0.ebuild
dev-libs/gmp/gmp-6.1.1.ebuild

diff --git a/dev-libs/gmp/files/gmp-6.1.0-tune-printf.patch b/dev-libs/gmp/files/gmp-6.1.0-tune-printf.patch
new file mode 100644 (file)
index 0000000..dd9d46f
--- /dev/null
@@ -0,0 +1,43 @@
+https://gmplib.org/list-archives/gmp-bugs/2016-November/004032.html
+
+From f440c9134fb89cadf54daeb59c7a0feb7470562b Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sat, 26 Nov 2016 16:35:46 -0500
+Subject: [PATCH] tune: fix spurious clock_gettime reference
+
+When running the tune program, the generated gmp-mparam.h header might
+include an invalid line leading to build failures like so:
+In file included from .../gmp-impl.h:145:0,
+                 from mp_bases.c:4:
+../gmp-mparam.h:1:1: error: unknown type name 'clock_gettime'
+ clock_gettime is 1.000ns accurate
+
+This is because the tune source has one printf that is not protected
+by the verbose flag leading it to be written to the output.
+
+Credit to Conrad Kostecki for analysis.
+
+URL: https://bugs.gentoo.org/568320
+---
+ tune/time.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/tune/time.c b/tune/time.c
+index e0d262096396..d1efb0a6d35d 100644
+--- a/tune/time.c
++++ b/tune/time.c
+@@ -773,8 +773,9 @@ cgt_works_p (void)
+     }
+ 
+   cgt_unittime = unit.tv_sec + unit.tv_nsec * 1e-9;
+-  printf ("clock_gettime is %s accurate\n",
+-        unittime_string (cgt_unittime));
++  if (speed_option_verbose)
++    printf ("clock_gettime is %s accurate\n",
++          unittime_string (cgt_unittime));
+ 
+   if (cgt_unittime < 10e-9)
+     {
+-- 
+2.11.0.rc2
+
index a511af5d3fbef8dc2b244fc7a46516e1b573cf8f..519ff18c3031d9dfe52b82f49e62cf77959b6d6f 100644 (file)
@@ -35,6 +35,7 @@ MULTILIB_WRAPPED_HEADERS=( /usr/include/gmp.h )
 src_prepare() {
        [[ -d ${FILESDIR}/${PV} ]] && EPATCH_SUFFIX="diff" EPATCH_FORCE="yes" epatch "${FILESDIR}"/${PV}
        epatch "${FILESDIR}"/${PN}-6.1.0-udiv.patch
+       epatch "${FILESDIR}"/${PN}-6.1.0-tune-printf.patch
 
        # note: we cannot run autotools here as gcc depends on this package
        elibtoolize
index adb201ec9c953188c6a4f250cf5c1fa567fb15a8..6aa461d57909c7476b754504199869a273798f55 100644 (file)
@@ -34,6 +34,7 @@ MULTILIB_WRAPPED_HEADERS=( /usr/include/gmp.h )
 src_prepare() {
        [[ -d ${FILESDIR}/${PV} ]] && EPATCH_SUFFIX="diff" EPATCH_FORCE="yes" epatch "${FILESDIR}"/${PV}
        epatch "${FILESDIR}"/${PN}-6.1.0-udiv.patch
+       epatch "${FILESDIR}"/${PN}-6.1.0-tune-printf.patch
 
        # note: we cannot run autotools here as gcc depends on this package
        elibtoolize