changeset 6326:97b1c6e0a2cb

Fix linux-ppc::glibc-core (glibc-2.3) strtol_l.c
author Masamichi Hosoda <trueroad@users.noreply.github.com>
date Wed, 28 Jan 2015 21:15:55 +0900
parents a700f836485c
children 58f938d06e4e
files patches/glibc-2.3-linux-ppc-sysdeps-generic-strtol_l.patch
diffstat 1 files changed, 42 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/patches/glibc-2.3-linux-ppc-sysdeps-generic-strtol_l.patch	Tue Jan 20 23:46:14 2015 +0900
+++ b/patches/glibc-2.3-linux-ppc-sysdeps-generic-strtol_l.patch	Wed Jan 28 21:15:55 2015 +0900
@@ -1,7 +1,17 @@
+http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=2d1e6277e92bd907578cd01d017b1d6aa34485be
+
 --- a/sysdeps/generic/strtol_l.c	2004-06-16 04:54:57.000000000 +0900
-+++ b/sysdeps/generic/strtol_l.c	2015-01-20 23:22:32.816966100 +0900
-@@ -170,8 +170,7 @@
++++ b/sysdeps/generic/strtol_l.c	2015-01-28 20:05:02.461060800 +0900
+@@ -168,10 +168,15 @@
+ /* Define tables of maximum values and remainders in order to detect
+    overflow.  Do this at compile-time in order to avoid the runtime
     overhead of the division.  */
++extern const unsigned long __strtol_ul_max_tab[] attribute_hidden;
++extern const unsigned char __strtol_ul_rem_tab[] attribute_hidden;
++#if defined(QUAD) && __WORDSIZE == 32
++extern const unsigned long long __strtol_ull_max_tab[] attribute_hidden;
++extern const unsigned char __strtol_ull_rem_tab[] attribute_hidden;
++#endif
  
  #define DEF(TYPE, NAME)							   \
 -  const TYPE NAME[] attribute_hidden					   \
@@ -10,3 +20,33 @@
    {									   \
      F(2), F(3), F(4), F(5), F(6), F(7), F(8), F(9), F(10), 		   \
      F(11), F(12), F(13), F(14), F(15), F(16), F(17), F(18), F(19), F(20),  \
+@@ -179,20 +184,22 @@
+     F(31), F(32), F(33), F(34), F(35), F(36)				   \
+   }
+ 
+-#define F(X)	ULONG_MAX / X
++#if !UNSIGNED && !defined (USE_WIDE_CHAR) && !defined (QUAD)
++# define F(X)	ULONG_MAX / X
+   DEF (unsigned long, __strtol_ul_max_tab);
+-#undef F
+-#if defined(QUAD) && __WORDSIZE == 32
++# undef F
++# define F(X)	ULONG_MAX % X
++  DEF (unsigned char, __strtol_ul_rem_tab);
++# undef F
++#endif
++#if !UNSIGNED && !defined (USE_WIDE_CHAR) && defined (QUAD) \
++    && __WORDSIZE == 32
+ # define F(X)	ULONG_LONG_MAX / X
+   DEF (unsigned long long, __strtol_ull_max_tab);
+ # undef F
+ # define F(X)	ULONG_LONG_MAX % X
+   DEF (unsigned char, __strtol_ull_rem_tab);
+ # undef F
+-#else
+-# define F(X)	ULONG_MAX % X
+-  DEF (unsigned char, __strtol_ul_rem_tab);
+-# undef F
+ #endif
+ #undef DEF
+