patches/eglibc/2_15/100-Remove-test-for-__builtin_expect.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>
     1 diff --git a/configure b/configure
     2 index e5e0184..85da2bc 100755
     3 --- a/configure
     4 +++ b/configure
     5 @@ -7567,40 +7567,6 @@ _ACEOF
     6  fi
     7  fi
     8  
     9 -{ $as_echo "$as_me:$LINENO: checking for __builtin_expect" >&5
    10 -$as_echo_n "checking for __builtin_expect... " >&6; }
    11 -if test "${libc_cv_gcc_builtin_expect+set}" = set; then
    12 -  $as_echo_n "(cached) " >&6
    13 -else
    14 -  cat > conftest.c <<EOF
    15 -#line $LINENO "configure"
    16 -int foo (int a)
    17 -{
    18 -  a = __builtin_expect (a, 10);
    19 -  return a == 10 ? 0 : 1;
    20 -}
    21 -EOF
    22 -if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -nostdlib -nostartfiles
    23 -			    -o conftest conftest.c -lgcc >&5'
    24 -  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    25 -  (eval $ac_try) 2>&5
    26 -  ac_status=$?
    27 -  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
    28 -  (exit $ac_status); }; }; then
    29 -  libc_cv_gcc_builtin_expect=yes
    30 -else
    31 -  libc_cv_gcc_builtin_expect=no
    32 -fi
    33 -rm -f conftest*
    34 -fi
    35 -{ $as_echo "$as_me:$LINENO: result: $libc_cv_gcc_builtin_expect" >&5
    36 -$as_echo "$libc_cv_gcc_builtin_expect" >&6; }
    37 -if test "$libc_cv_gcc_builtin_expect" = no; then
    38 -  { { $as_echo "$as_me:$LINENO: error: support for __builtin_expect needed" >&5
    39 -$as_echo "$as_me: error: support for __builtin_expect needed" >&2;}
    40 -   { (exit 1); exit 1; }; }
    41 -fi
    42 -
    43  { $as_echo "$as_me:$LINENO: checking for __builtin_memset" >&5
    44  $as_echo_n "checking for __builtin_memset... " >&6; }
    45  if test "${libc_cv_gcc_builtin_memset+set}" = set; then
    46 diff --git a/configure.in b/configure.in
    47 index 4655c8a..596443d 100644
    48 --- a/configure.in
    49 +++ b/configure.in
    50 @@ -2134,28 +2134,6 @@ if test "$libc_cv_c_asmcr0_bug" != 'no'; then
    51  fi
    52  fi
    53  
    54 -dnl Check whether compiler understands __builtin_expect.
    55 -AC_CACHE_CHECK(for __builtin_expect, libc_cv_gcc_builtin_expect,
    56 -[cat > conftest.c <<EOF
    57 -#line $LINENO "configure"
    58 -int foo (int a)
    59 -{
    60 -  a = __builtin_expect (a, 10);
    61 -  return a == 10 ? 0 : 1;
    62 -}
    63 -EOF
    64 -dnl No \ in command here because it ends up inside ''.
    65 -if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -nostdlib -nostartfiles
    66 -			    -o conftest conftest.c -lgcc >&AS_MESSAGE_LOG_FD]); then
    67 -  libc_cv_gcc_builtin_expect=yes
    68 -else
    69 -  libc_cv_gcc_builtin_expect=no
    70 -fi
    71 -rm -f conftest*])
    72 -if test "$libc_cv_gcc_builtin_expect" = no; then
    73 -  AC_MSG_ERROR([support for __builtin_expect needed])
    74 -fi
    75 -
    76  AC_CACHE_CHECK(for __builtin_memset, libc_cv_gcc_builtin_memset, [dnl
    77  cat > conftest.c <<\EOF
    78  void zero (void *x)