libg/eglibc: add updated eglibc 2.15
author"Bryan Hundven" <bryanhundven@gmail.com>
Thu Mar 01 15:23:49 2012 -0800 (2012-03-01)
changeset 290928ac8fbd9e6a
parent 2908 dcdb309b7967
child 2910 cc170c96362c
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>
config/libc/eglibc.in
patches/eglibc/2_15/100-Remove-test-for-__builtin_expect.patch
     1.1 --- a/config/libc/eglibc.in	Tue Mar 06 21:36:10 2012 +0100
     1.2 +++ b/config/libc/eglibc.in	Thu Mar 01 15:23:49 2012 -0800
     1.3 @@ -18,6 +18,12 @@
     1.4  # Don't remove next line
     1.5  # CT_INSERT_VERSION_BELOW
     1.6  
     1.7 +config LIBC_EGLIBC_V_2_15
     1.8 +    bool
     1.9 +    prompt "2_15"
    1.10 +    depends on EXPERIMENTAL
    1.11 +    select LIBC_EGLIBC_2_15_or_later
    1.12 +
    1.13  config LIBC_EGLIBC_V_2_14
    1.14      bool
    1.15      prompt "2_14"
    1.16 @@ -83,6 +89,7 @@
    1.17      string
    1.18  # Don't remove next line
    1.19  # CT_INSERT_VERSION_STRING_BELOW
    1.20 +    default "2_15" if LIBC_EGLIBC_V_2_15
    1.21      default "2_14" if LIBC_EGLIBC_V_2_14
    1.22      default "2_13" if LIBC_EGLIBC_V_2_13
    1.23      default "2_12" if LIBC_EGLIBC_V_2_12
    1.24 @@ -95,6 +102,10 @@
    1.25      default "2_5" if LIBC_EGLIBC_V_2_5
    1.26      default "trunk" if LIBC_EGLIBC_V_TRUNK
    1.27  
    1.28 +config LIBC_EGLIBC_2_15_or_later
    1.29 +    bool
    1.30 +    select LIBC_EGLIBC_2_14_or_later
    1.31 +
    1.32  config LIBC_EGLIBC_2_14_or_later
    1.33      bool
    1.34      select LIBC_EGLIBC_2_13_or_later
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/patches/eglibc/2_15/100-Remove-test-for-__builtin_expect.patch	Thu Mar 01 15:23:49 2012 -0800
     2.3 @@ -0,0 +1,78 @@
     2.4 +diff --git a/configure b/configure
     2.5 +index e5e0184..85da2bc 100755
     2.6 +--- a/configure
     2.7 ++++ b/configure
     2.8 +@@ -7567,40 +7567,6 @@ _ACEOF
     2.9 + fi
    2.10 + fi
    2.11 + 
    2.12 +-{ $as_echo "$as_me:$LINENO: checking for __builtin_expect" >&5
    2.13 +-$as_echo_n "checking for __builtin_expect... " >&6; }
    2.14 +-if test "${libc_cv_gcc_builtin_expect+set}" = set; then
    2.15 +-  $as_echo_n "(cached) " >&6
    2.16 +-else
    2.17 +-  cat > conftest.c <<EOF
    2.18 +-#line $LINENO "configure"
    2.19 +-int foo (int a)
    2.20 +-{
    2.21 +-  a = __builtin_expect (a, 10);
    2.22 +-  return a == 10 ? 0 : 1;
    2.23 +-}
    2.24 +-EOF
    2.25 +-if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -nostdlib -nostartfiles
    2.26 +-			    -o conftest conftest.c -lgcc >&5'
    2.27 +-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    2.28 +-  (eval $ac_try) 2>&5
    2.29 +-  ac_status=$?
    2.30 +-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
    2.31 +-  (exit $ac_status); }; }; then
    2.32 +-  libc_cv_gcc_builtin_expect=yes
    2.33 +-else
    2.34 +-  libc_cv_gcc_builtin_expect=no
    2.35 +-fi
    2.36 +-rm -f conftest*
    2.37 +-fi
    2.38 +-{ $as_echo "$as_me:$LINENO: result: $libc_cv_gcc_builtin_expect" >&5
    2.39 +-$as_echo "$libc_cv_gcc_builtin_expect" >&6; }
    2.40 +-if test "$libc_cv_gcc_builtin_expect" = no; then
    2.41 +-  { { $as_echo "$as_me:$LINENO: error: support for __builtin_expect needed" >&5
    2.42 +-$as_echo "$as_me: error: support for __builtin_expect needed" >&2;}
    2.43 +-   { (exit 1); exit 1; }; }
    2.44 +-fi
    2.45 +-
    2.46 + { $as_echo "$as_me:$LINENO: checking for __builtin_memset" >&5
    2.47 + $as_echo_n "checking for __builtin_memset... " >&6; }
    2.48 + if test "${libc_cv_gcc_builtin_memset+set}" = set; then
    2.49 +diff --git a/configure.in b/configure.in
    2.50 +index 4655c8a..596443d 100644
    2.51 +--- a/configure.in
    2.52 ++++ b/configure.in
    2.53 +@@ -2134,28 +2134,6 @@ if test "$libc_cv_c_asmcr0_bug" != 'no'; then
    2.54 + fi
    2.55 + fi
    2.56 + 
    2.57 +-dnl Check whether compiler understands __builtin_expect.
    2.58 +-AC_CACHE_CHECK(for __builtin_expect, libc_cv_gcc_builtin_expect,
    2.59 +-[cat > conftest.c <<EOF
    2.60 +-#line $LINENO "configure"
    2.61 +-int foo (int a)
    2.62 +-{
    2.63 +-  a = __builtin_expect (a, 10);
    2.64 +-  return a == 10 ? 0 : 1;
    2.65 +-}
    2.66 +-EOF
    2.67 +-dnl No \ in command here because it ends up inside ''.
    2.68 +-if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -nostdlib -nostartfiles
    2.69 +-			    -o conftest conftest.c -lgcc >&AS_MESSAGE_LOG_FD]); then
    2.70 +-  libc_cv_gcc_builtin_expect=yes
    2.71 +-else
    2.72 +-  libc_cv_gcc_builtin_expect=no
    2.73 +-fi
    2.74 +-rm -f conftest*])
    2.75 +-if test "$libc_cv_gcc_builtin_expect" = no; then
    2.76 +-  AC_MSG_ERROR([support for __builtin_expect needed])
    2.77 +-fi
    2.78 +-
    2.79 + AC_CACHE_CHECK(for __builtin_memset, libc_cv_gcc_builtin_memset, [dnl
    2.80 + cat > conftest.c <<\EOF
    2.81 + void zero (void *x)