patches/uClibc/0.9.30.1/150-64bit-strtouq.patch
author "Bryan Hundven" <bryanhundven@gmail.com>
Thu Mar 01 15:23:49 2012 -0800 (2012-03-01)
changeset 2909 28ac8fbd9e6a
permissions -rw-r--r--
libg/eglibc: add updated eglibc 2.15

Includes a patch to remove __builtin_expect test:

In eglibc-2.15, the build breaks in configure while testing
for the existance of __builtin_expect. It fails with newer
versions of gcc.

This patch is a modification of an upstream change in glibc
mainline (to be 2.16) to fix the following error:

[CFG ] checking for __builtin_expect... no
[ERROR] configure: error: support for __builtin_expect needed

http://sourceware.org/git/?p=glibc.git;a=commit;h=3857022a761ea7251f8e5c0e45d382ebc3e34cf9

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
[yann.morin.1998@free.fr: coalesce both patches into a single changeset]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
yann@1282
     1
[PATCH]: Add strtouq alias (to strtoul) for 64bit
yann@1282
     2
yann@1282
     3
The strtouq alias was only available on 32bit, breaking compilation of stuff
yann@1282
     4
using strtouq on 64bit machines. At the same time use the correct return
yann@1282
     5
type (u_quad_t).
yann@1282
     6
yann@1282
     7
Signed-of-by: Peter Korsgaard <jacmet@sunsite.dk>
yann@1282
     8
---
yann@1282
     9
 include/stdlib.h     |    4 +++-
yann@1282
    10
 libc/stdlib/stdlib.c |    1 +
yann@1282
    11
 2 files changed, 4 insertions(+), 1 deletion(-)
yann@1282
    12
yann@1282
    13
Index: uClibc-0.9.30.1/libc/stdlib/stdlib.c
yann@1282
    14
===================================================================
yann@1282
    15
--- uClibc-0.9.30.1.orig/libc/stdlib/stdlib.c
yann@1282
    16
+++ uClibc-0.9.30.1/libc/stdlib/stdlib.c
yann@1282
    17
@@ -401,6 +401,9 @@
yann@1282
    18
 libc_hidden_proto(__XL_NPP(strtoull))
yann@1282
    19
 strong_alias(__XL_NPP(strtoul),__XL_NPP(strtoull))
yann@1282
    20
 libc_hidden_def(__XL_NPP(strtoull))
yann@1282
    21
+#if !defined(L_strtoul_l)
yann@1282
    22
+strong_alias(strtoul,strtouq)
yann@1282
    23
+#endif
yann@1282
    24
 #endif
yann@1282
    25
 
yann@1282
    26
 
yann@1282
    27
Index: uClibc-0.9.30.1/include/stdlib.h
yann@1282
    28
===================================================================
yann@1282
    29
--- uClibc-0.9.30.1.orig/include/stdlib.h
yann@1282
    30
+++ uClibc-0.9.30.1/include/stdlib.h
yann@1282
    31
@@ -203,6 +203,8 @@
yann@1282
    32
 __END_NAMESPACE_STD
yann@1282
    33
 
yann@1282
    34
 #ifdef __USE_BSD
yann@1282
    35
+#include <sys/types.h> /* for u_quad_t */
yann@1282
    36
+
yann@1282
    37
 /* Convert a string to a quadword integer.  */
yann@1282
    38
 __extension__
yann@1282
    39
 extern long long int strtoq (__const char *__restrict __nptr,
yann@1282
    40
@@ -210,7 +212,7 @@
yann@1282
    41
      __THROW __nonnull ((1)) __wur;
yann@1282
    42
 /* Convert a string to an unsigned quadword integer.  */
yann@1282
    43
 __extension__
yann@1282
    44
-extern unsigned long long int strtouq (__const char *__restrict __nptr,
yann@1282
    45
+extern u_quad_t strtouq (__const char *__restrict __nptr,
yann@1282
    46
 				       char **__restrict __endptr, int __base)
yann@1282
    47
      __THROW __nonnull ((1)) __wur;
yann@1282
    48
 #endif /* GCC and use BSD.  */