patches/eglibc/2_15/100-Remove-test-for-__builtin_expect.patch
author Matthieu Crapet <mcrapet@gmail.com>
Wed Jun 06 12:03:12 2012 +0200 (2012-06-06)
changeset 2991 252ade1e9e17
permissions -rw-r--r--
libc/eglibc: fix missing LIBC_TRY_CC_OPTION definition (eglibc 2.15)

Upstream SVN is currently broken:
http://www.eglibc.org/svn/branches/eglibc-2_15/libc/

LIBC_TRY_CC_OPTION macro is not defined in aclocal.m4.
This patch fix the configure script.

Once upstream branch will be fixed this patch could be reverted.

Related patch (committed to eglibc trunk):
Use autoconf macro for testing compiler options with empty input
http://sourceware.org/ml/libc-alpha/2012-03/msg00816.html

Signed-off-by: Matthieu Crapet <mcrapet@gmail.com>

diff -r 1f6c8e4b2b92 -r d10afc5bcc25
patches/eglibc/2_15/110-aclocal-LIBC_TRY_CC_OPTION.patch
     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)