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