From 2523263497bf51be8e56876561449ef49a6b517f2b2a1251b328791b6207aefd Mon Sep 17 00:00:00 2001 From: Ciaran Farrell Date: Fri, 20 Dec 2013 11:31:03 +0000 Subject: [PATCH] Accepting request 211832 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. - libunistring-gnulib-ppc64le.patch: Fix imported gnulib long double math tests for little-endian PowerPC. OBS-URL: https://build.opensuse.org/request/show/211832 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libunistring?expand=0&rev=18 --- libunistring-gnulib-ppc64le.patch | 41 +++++++++++++++++++++++++++++++ libunistring.changes | 6 +++++ libunistring.spec | 8 +++++- 3 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 libunistring-gnulib-ppc64le.patch diff --git a/libunistring-gnulib-ppc64le.patch b/libunistring-gnulib-ppc64le.patch new file mode 100644 index 0000000..1b52cfe --- /dev/null +++ b/libunistring-gnulib-ppc64le.patch @@ -0,0 +1,41 @@ +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/tests/test-signbit.c b/tests/test-signbit.c +index e8ea097..7e24292 100644 +--- a/tests/test-signbit.c ++++ b/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 diff --git a/libunistring.changes b/libunistring.changes index 4876799..70df262 100644 --- a/libunistring.changes +++ b/libunistring.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Dec 18 19:56:18 UTC 2013 - uweigand@de.ibm.com + +- libunistring-gnulib-ppc64le.patch: Fix imported gnulib long double + math tests for little-endian PowerPC. + ------------------------------------------------------------------- Fri Mar 16 08:58:14 UTC 2012 - cfarrell@suse.com diff --git a/libunistring.spec b/libunistring.spec index 0c86319..5539549 100644 --- a/libunistring.spec +++ b/libunistring.spec @@ -1,7 +1,7 @@ # # spec file for package libunistring # -# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -14,6 +14,8 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # + + Name: libunistring %define lname libunistring0 Version: 0.9.3 @@ -25,6 +27,9 @@ Url: http://www.gnu.org/software/libunistring/ Source0: libunistring-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build +# Fix imported gnulib long double math tests for little-endian PowerPC +Patch1: libunistring-gnulib-ppc64le.patch + %description This portable C library implements Unicode string types in three flavours: (UTF-8, UTF-16, UTF-32), together with functions for character processing @@ -59,6 +64,7 @@ case folding and regular expressions). %prep %setup -q +%patch1 -p1 %build %configure --disable-static --disable-rpath --docdir=%_docdir/%name