[diffutils] Applied upstream gnulib fix for float test on ppc as well as correction for LDBL_MANT_DIG (bug #7335
Tim Waugh
twaugh at fedoraproject.org
Fri Nov 25 14:25:00 UTC 2011
commit 953cdeac82116b36a3060cb1f451f202d19233b3
Author: Tim Waugh <twaugh at redhat.com>
Date: Fri Nov 25 13:19:55 2011 +0000
Applied upstream gnulib fix for float test on ppc as well as correction for LDBL_MANT_DIG (bug #733536).
diffutils-ppc-float.patch | 49 +++++++++++++++++++++++++++++++++++++++++++++
diffutils.spec | 14 ++++++++++--
2 files changed, 60 insertions(+), 3 deletions(-)
---
diff --git a/diffutils-ppc-float.patch b/diffutils-ppc-float.patch
new file mode 100644
index 0000000..2a1256b
--- /dev/null
+++ b/diffutils-ppc-float.patch
@@ -0,0 +1,49 @@
+diff -up diffutils-3.2/gnulib-tests/float.c.ppc-float diffutils-3.2/gnulib-tests/float.c
+--- diffutils-3.2/gnulib-tests/float.c.ppc-float 2011-08-28 12:57:24.000000000 +0100
++++ diffutils-3.2/gnulib-tests/float.c 2011-11-25 14:13:58.090442846 +0000
+@@ -22,7 +22,7 @@
+ /* Specification. */
+ #include <float.h>
+
+-#if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__
++#if (defined _ARCH_PPC || defined _POWER) && (defined _AIX || defined __linux__) && (LDBL_MANT_DIG == 106) && defined __GNUC__
+ const union gl_long_double_union gl_LDBL_MAX =
+ { { DBL_MAX, DBL_MAX / (double)134217728UL / (double)134217728UL } };
+ #elif defined __i386__
+diff -up diffutils-3.2/gnulib-tests/float.in.h.ppc-float diffutils-3.2/gnulib-tests/float.in.h
+--- diffutils-3.2/gnulib-tests/float.in.h.ppc-float 2011-08-28 12:57:25.000000000 +0100
++++ diffutils-3.2/gnulib-tests/float.in.h 2011-11-25 14:13:58.091442827 +0000
+@@ -111,7 +111,8 @@ extern const union gl_long_double_union
+ #endif
+
+ /* On AIX 7.1 with gcc 4.2, the values of LDBL_MIN_EXP, LDBL_MIN, LDBL_MAX are
+- wrong. */
++ wrong.
++ On Linux/PowerPC with gcc 4.4, the value of LDBL_MAX is wrong. */
+ #if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__
+ # undef LDBL_MIN_EXP
+ # define LDBL_MIN_EXP DBL_MIN_EXP
+@@ -119,6 +120,8 @@ extern const union gl_long_double_union
+ # define LDBL_MIN_10_EXP DBL_MIN_10_EXP
+ # undef LDBL_MIN
+ # define LDBL_MIN 2.22507385850720138309023271733240406422e-308L /* DBL_MIN = 2^-1022 */
++#endif
++#if (defined _ARCH_PPC || defined _POWER) && (defined _AIX || defined __linux__) && (LDBL_MANT_DIG == 106) && defined __GNUC__
+ # undef LDBL_MAX
+ /* LDBL_MAX is represented as { 0x7FEFFFFF, 0xFFFFFFFF, 0x7C8FFFFF, 0xFFFFFFFF }.
+ It is not easy to define:
+diff -up diffutils-3.2/gnulib-tests/test-float.c.ppc-float diffutils-3.2/gnulib-tests/test-float.c
+--- diffutils-3.2/gnulib-tests/test-float.c.ppc-float 2011-09-01 23:38:42.000000000 +0100
++++ diffutils-3.2/gnulib-tests/test-float.c 2011-11-25 14:14:04.623319695 +0000
+@@ -325,7 +325,11 @@ test_long_double (void)
+ int n;
+
+ ASSERT (m + m > m);
++#if (defined _ARCH_PPC || defined _POWER)
++ for (n = 0; n <= 2 * DBL_MANT_DIG; n++)
++#else
+ for (n = 0; n <= 2 * LDBL_MANT_DIG; n++)
++#endif
+ {
+ volatile long double pow2_n = pow2l (n); /* 2^n */
+ volatile long double x = m + (m / pow2_n);
diff --git a/diffutils.spec b/diffutils.spec
index eb5ac91..7d63bb2 100644
--- a/diffutils.spec
+++ b/diffutils.spec
@@ -1,11 +1,12 @@
Summary: A GNU collection of diff utilities
Name: diffutils
Version: 3.2
-Release: 1%{?dist}
+Release: 2%{?dist}
Group: Applications/Text
URL: http://www.gnu.org/software/diffutils/diffutils.html
Source: ftp://ftp.gnu.org/gnu/diffutils/diffutils-%{version}.tar.xz
-Patch4: diffutils-cmp-s-empty.patch
+Patch1: diffutils-cmp-s-empty.patch
+Patch2: diffutils-ppc-float.patch
License: GPLv2+
Requires(post): /sbin/install-info
Requires(preun): /sbin/install-info
@@ -28,7 +29,10 @@ Install diffutils if you need to compare text files.
%prep
%setup -q
# For 'cmp -s', compare file sizes only if both non-zero (bug #563618).
-%patch4 -p1 -b .cmp-s-empty
+%patch1 -p1 -b .cmp-s-empty
+
+# Applied upstream gnulib fix for float test on ppc (bug #733536).
+%patch2 -p1 -b .ppc-float
%build
%configure
@@ -67,6 +71,10 @@ rm -rf $RPM_BUILD_ROOT
%{_infodir}/diffutils.info*gz
%changelog
+* Fri Nov 25 2011 Tim Waugh <twaugh at redhat.com> 3.2-2
+- Applied upstream gnulib fix for float test on ppc, as well as
+ correction for LDBL_MANT_DIG definition (bug #733536).
+
* Fri Sep 2 2011 Tim Waugh <twaugh at redhat.com> 3.2-1
- 3.2.
More information about the scm-commits
mailing list