[glibc/f18] use uint64_t for __bswap64 (#859428).

Siddhesh Poyarekar siddhesh at fedoraproject.org
Thu Dec 6 08:43:25 UTC 2012


commit 75e9dce5d306f5957ee22efa4944d0d2a79d3d24
Author: Siddhesh Poyarekar <siddhesh.poyarekar at gmail.com>
Date:   Thu Dec 6 14:12:44 2012 +0530

    use uint64_t for __bswap64 (#859428).

 glibc-rh859428.patch |   57 ++++++++++++++++++++++++++++++++++++++++++++++++++
 glibc.spec           |    7 +++++-
 2 files changed, 63 insertions(+), 1 deletions(-)
---
diff --git a/glibc-rh859428.patch b/glibc-rh859428.patch
new file mode 100644
index 0000000..0493d2a
--- /dev/null
+++ b/glibc-rh859428.patch
@@ -0,0 +1,57 @@
+commit d394eb742a3565d7fe7a4b02710a60b5f219ee64
+Author: H.J. Lu <hjl.tools at gmail.com>
+Date:   Fri Oct 12 09:21:47 2012 -0700
+
+    Use __uint64_t in x86 __bswap_64
+
+diff --git a/sysdeps/x86/bits/byteswap.h b/sysdeps/x86/bits/byteswap.h
+index 4178439..babe567 100644
+--- a/sysdeps/x86/bits/byteswap.h
++++ b/sysdeps/x86/bits/byteswap.h
+@@ -24,6 +24,7 @@
+ #define _BITS_BYTESWAP_H 1
+ 
+ #include <features.h>
++#include <bits/types.h>
+ #include <bits/wordsize.h>
+ 
+ /* Swap bytes in 16 bit value.  */
+@@ -104,15 +105,15 @@ __bswap_32 (unsigned int __bsx)
+ 		     | (((x) & 0x00000000000000ffull) << 56)))
+ 
+ # if __GNUC_PREREQ (4, 2)
+-static __inline unsigned long long int
+-__bswap_64 (unsigned long long int __bsx)
++static __inline __uint64_t
++__bswap_64 (__uint64_t __bsx)
+ {
+   return __builtin_bswap64 (__bsx);
+ }
+ # elif __WORDSIZE == 64
+ #  define __bswap_64(x) \
+      (__extension__							      \
+-      ({ register unsigned long __v, __x = (x);				      \
++      ({ register __uint64_t __v, __x = (x);				      \
+ 	 if (__builtin_constant_p (__x))				      \
+ 	   __v = __bswap_constant_64 (__x);				      \
+ 	 else								      \
+@@ -121,7 +122,7 @@ __bswap_64 (unsigned long long int __bsx)
+ # else
+ #  define __bswap_64(x) \
+      (__extension__                                                           \
+-      ({ union { __extension__ unsigned long long int __ll;                   \
++      ({ union { __extension__ __uint64_t __ll;		                      \
+ 		 unsigned int __l[2]; } __w, __r;                             \
+ 	 if (__builtin_constant_p (x))                                        \
+ 	   __r.__ll = __bswap_constant_64 (x);                                \
+@@ -144,8 +145,8 @@ __bswap_64 (unsigned long long int __bsx)
+       | (((x) & 0x000000000000ff00ull) << 40)				      \
+       | (((x) & 0x00000000000000ffull) << 56))
+ 
+-static __inline unsigned long long int
+-__bswap_64 (unsigned long long int __bsx)
++static __inline __uint64_t
++__bswap_64 (__uint64_t __bsx)
+ {
+   return __bswap_constant_64 (__bsx);
+ }
diff --git a/glibc.spec b/glibc.spec
index cda5676..37b3f80 100644
--- a/glibc.spec
+++ b/glibc.spec
@@ -28,7 +28,7 @@
 Summary: The GNU libc libraries
 Name: glibc
 Version: %{glibcversion}
-Release: 25%{?dist}
+Release: 26%{?dist}
 # GPLv2+ is used in a bunch of programs, LGPLv2+ is used for libraries.
 # Things that are linked directly into dynamically linked programs
 # and shared libraries (e.g. crt files, lib*_nonshared.a) have an additional
@@ -122,6 +122,7 @@ Patch1042: %{name}-rh865520.patch
 Patch1045: %{name}-rh852445.patch
 Patch1047: %{name}-rh804768.patch
 Patch1048: %{name}-rh804768-2.patch
+Patch1049: %{name}-rh859428.patch
 
 #
 # Patches submitted, but not yet approved upstream.
@@ -467,6 +468,7 @@ rm -rf %{glibcportsdir}
 %patch0046 -p1
 %patch1047 -p1
 %patch1048 -p1
+%patch1049 -p1
 
 # On powerpc32, hp timing is only available in power4/power6
 # libs, not in base, so pre-power4 dynamic linker is incompatible
@@ -1273,6 +1275,9 @@ rm -f *.filelist*
 %endif
 
 %changelog
+* Thu Dec  6 2012 Siddhesh Poyarekar <siddhesh at redhat.com> - 2.16-26
+  - use uint64_t for __bswap64 (#859428).
+
 * Wed Nov 28 2012 Patsy Franklin <pfrankli at redhat.com> - 2.16-25
   - Backport of upstream BZ #5298. Don't flush buffer for ftell.
     Compute offsets from write pointers instead.  (#577950)


More information about the scm-commits mailing list