3
0
forked from pool/findutils

Accepting request 211844 from Base:System

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. (forwarded request 211828 from uweigand)

OBS-URL: https://build.opensuse.org/request/show/211844
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/findutils?expand=0&rev=49
This commit is contained in:
Tomáš Chvátal 2013-12-22 18:32:21 +00:00 committed by Git OBS Bridge
commit 55c243eeb8
3 changed files with 69 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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}