From d75cc88bd0044eabf79bbaeba23fc570e01162e6e1d06c2bf24cdfac626da83a Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Fri, 20 Dec 2013 11:56:13 +0000 Subject: [PATCH] Accepting request 211828 from openSUSE:Factory:PowerLE The "gnulib" package contains a number of floating-point test cases that do not work correctly with the PowerPC long double ("double double") format. These tests "accidentally" succeeded anyway in the big-endian variant, but are now actually failing in little-endian mode. As is usual for gnulib, those tests end up copied into the source code of various packages that use gnulib, including coreutils, findutils, grep, and libunistring. A patch to fix the tests for ppc64le has been submitted to upstream to the bug-gnulib mailing list. We'll work with upstream of the other affected packages to make sure the copies are refreshed. - findutils-gnulib-ppc64le.patch: Fix imported gnulib long double math tests for little-endian PowerPC. OBS-URL: https://build.opensuse.org/request/show/211828 OBS-URL: https://build.opensuse.org/package/show/Base:System/findutils?expand=0&rev=54 --- findutils-gnulib-ppc64le.patch | 60 ++++++++++++++++++++++++++++++++++ findutils.changes | 6 ++++ findutils.spec | 3 ++ 3 files changed, 69 insertions(+) create mode 100644 findutils-gnulib-ppc64le.patch diff --git a/findutils-gnulib-ppc64le.patch b/findutils-gnulib-ppc64le.patch new file mode 100644 index 0000000..784b2d6 --- /dev/null +++ b/findutils-gnulib-ppc64le.patch @@ -0,0 +1,60 @@ +diff --git a/tests/test-isfinite.c b/tests/test-isfinite.c +index 9e8dd0d..a762ceb 100644 +--- a/tests/test-isfinite.c ++++ b/tests/test-isfinite.c +@@ -152,6 +152,15 @@ test_isfinitel () + /* A bit pattern that is different from a Quiet NaN. With a bit of luck, + it's a Signalling NaN. */ + { ++#if defined __powerpc__ && LDBL_MANT_DIG == 106 ++ /* This is PowerPC "double double", a pair of two doubles. Inf and Nan are ++ represented as the corresponding 64-bit IEEE values in the first double; ++ the second is ignored. Manipulate only the first double. */ ++ #undef NWORDS ++ #define NWORDS \ ++ ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) ++#endif ++ + memory_long_double m; + m.value = zerol / zerol; + # if LDBL_EXPBIT0_BIT > 0 +diff --git a/tests/test-isinf.c b/tests/test-isinf.c +index 276e480..eb1b7f2 100644 +--- a/tests/test-isinf.c ++++ b/tests/test-isinf.c +@@ -158,6 +158,15 @@ test_isinfl () + /* A bit pattern that is different from a Quiet NaN. With a bit of luck, + it's a Signalling NaN. */ + { ++#if defined __powerpc__ && LDBL_MANT_DIG == 106 ++ /* This is PowerPC "double double", a pair of two doubles. Inf and Nan are ++ represented as the corresponding 64-bit IEEE values in the first double; ++ the second is ignored. Manipulate only the first double. */ ++ #undef NWORDS ++ #define NWORDS \ ++ ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) ++#endif ++ + memory_long_double m; + m.value = zerol / zerol; + # if LDBL_EXPBIT0_BIT > 0 +diff --git a/tests/test-isnanl.h b/tests/test-isnanl.h +index 06e6a7c..2df10f8 100644 +--- a/tests/test-isnanl.h ++++ b/tests/test-isnanl.h +@@ -51,6 +51,15 @@ main () + /* A bit pattern that is different from a Quiet NaN. With a bit of luck, + it's a Signalling NaN. */ + { ++#if defined __powerpc__ && LDBL_MANT_DIG == 106 ++ /* This is PowerPC "double double", a pair of two doubles. Inf and Nan are ++ represented as the corresponding 64-bit IEEE values in the first double; ++ the second is ignored. Manipulate only the first double. */ ++ #undef NWORDS ++ #define NWORDS \ ++ ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) ++#endif ++ + memory_long_double m; + m.value = NaNl (); + # if LDBL_EXPBIT0_BIT > 0 diff --git a/findutils.changes b/findutils.changes index 166f02b..f19d671 100644 --- a/findutils.changes +++ b/findutils.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Dec 18 19:19:34 UTC 2013 - uweigand@de.ibm.com + +- findutils-gnulib-ppc64le.patch: Fix imported gnulib long double + math tests for little-endian PowerPC. + ------------------------------------------------------------------- Thu Dec 5 20:55:16 CET 2013 - pth@suse.de diff --git a/findutils.spec b/findutils.spec index 4b3a735..14fe3e6 100644 --- a/findutils.spec +++ b/findutils.spec @@ -26,6 +26,8 @@ Group: Productivity/File utilities Source: http://alpha.gnu.org/gnu/%{name}/%{name}-%{version}.tar.gz # adds a new option -xautofs to find to not descend into directories on autofs file systems Patch0: findutils-4.4.2-xautofs.patch +# Fix imported gnulib long double math tests for little-endian PowerPC +Patch1: findutils-gnulib-ppc64le.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %if 0%{?suse_version} > 1100 BuildRequires: libselinux-devel @@ -53,6 +55,7 @@ useful for finding things on your system. %prep %setup -q %patch0 +%patch1 -p1 %build %if 0%{?qemu_user_space_build}