grep/grep-gnulib-ppc64le.patch
Dr. Werner Fink 923a5384a0 Accepting request 211831 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.

- grep-gnulib-ppc64le.patch: Fix imported gnulib long double math
  tests for little-endian PowerPC.

OBS-URL: https://build.opensuse.org/request/show/211831
OBS-URL: https://build.opensuse.org/package/show/Base:System/grep?expand=0&rev=36
2013-12-22 21:33:10 +00:00

42 lines
1.7 KiB
Diff

diff --git a/gnulib-tests/test-isnanl.h b/gnulib-tests/test-isnanl.h
index 06e6a7c..2df10f8 100644
--- a/gnulib-tests/test-isnanl.h
+++ b/gnulib-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/gnulib-tests/test-signbit.c b/gnulib-tests/test-signbit.c
index e8ea097..7e24292 100644
--- a/gnulib-tests/test-signbit.c
+++ b/gnulib-tests/test-signbit.c
@@ -151,6 +151,16 @@ test_signbitl ()
#define NWORDS \
((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
typedef union { long double value; unsigned int word[NWORDS]; } memory_long_double;
+
+#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