mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-05 19:35:52 +03:00
Update.
* include/libc-symbols.h: If HAVE_BUILTIN_EXPECT is not defined define __builtin_expect as a macro substituting to the first argument. * config.h.in: Define HAVE_BUILTIN_EXPECT. * configure.in: Add test for __builtin_expect.
This commit is contained in:
@@ -1,5 +1,11 @@
|
|||||||
1998-10-26 Ulrich Drepper <drepper@cygnus.com>
|
1998-10-26 Ulrich Drepper <drepper@cygnus.com>
|
||||||
|
|
||||||
|
* include/libc-symbols.h: If HAVE_BUILTIN_EXPECT is not defined
|
||||||
|
define __builtin_expect as a macro substituting to the first
|
||||||
|
argument.
|
||||||
|
* config.h.in: Define HAVE_BUILTIN_EXPECT.
|
||||||
|
* configure.in: Add test for __builtin_expect.
|
||||||
|
|
||||||
* sysdeps/unix/sysv/linux/bits/types.h: Include
|
* sysdeps/unix/sysv/linux/bits/types.h: Include
|
||||||
bits/pthreadtypes.h only not for POSIX 199506.
|
bits/pthreadtypes.h only not for POSIX 199506.
|
||||||
* sysdeps/unix/sysv/linux/alpha/bits/types.h: Likewise.
|
* sysdeps/unix/sysv/linux/alpha/bits/types.h: Likewise.
|
||||||
|
@@ -59,6 +59,9 @@
|
|||||||
with static variable. */
|
with static variable. */
|
||||||
#undef HAVE_DWARF2_UNWIND_INFO_STATIC
|
#undef HAVE_DWARF2_UNWIND_INFO_STATIC
|
||||||
|
|
||||||
|
/* Define if the compiler supports __builtin_expect. */
|
||||||
|
#undef HAVE_BUILTIN_EXPECT
|
||||||
|
|
||||||
/* Define if the regparm attribute shall be used for local functions
|
/* Define if the regparm attribute shall be used for local functions
|
||||||
(gcc on ix86 only). */
|
(gcc on ix86 only). */
|
||||||
#undef USE_REGPARMS
|
#undef USE_REGPARMS
|
||||||
|
40
configure
vendored
40
configure
vendored
@@ -2683,6 +2683,36 @@ EOF
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
echo $ac_n "checking for __builtin_expect""... $ac_c" 1>&6
|
||||||
|
echo "configure:2688: checking for __builtin_expect" >&5
|
||||||
|
if eval "test \"`echo '$''{'libc_cv_gcc_builtin_expect'+set}'`\" = set"; then
|
||||||
|
echo $ac_n "(cached) $ac_c" 1>&6
|
||||||
|
else
|
||||||
|
cat > conftest.c <<EOF
|
||||||
|
#line 2693 "configure"
|
||||||
|
int foo (int a)
|
||||||
|
{
|
||||||
|
a = __builtin_expect (a, 10);
|
||||||
|
return a == 10 ? 0 : 1;
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
if { ac_try='${CC-cc} $CFLAGS -nostdlib -nostartfiles
|
||||||
|
-o conftest conftest.c -lgcc >&5'; { (eval echo configure:2701: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||||
|
libc_cv_gcc_builtin_expect=yes
|
||||||
|
else
|
||||||
|
libc_cv_gcc_builtin_expect=no
|
||||||
|
fi
|
||||||
|
rm -f conftest*
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$ac_t""$libc_cv_gcc_builtin_expect" 1>&6
|
||||||
|
if test "$libc_cv_gcc_builtin_expect" = yes; then
|
||||||
|
cat >> confdefs.h <<\EOF
|
||||||
|
#define HAVE_BUILTIN_EXPECT 1
|
||||||
|
EOF
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
### End of automated tests.
|
### End of automated tests.
|
||||||
### Now run sysdeps configure fragments.
|
### Now run sysdeps configure fragments.
|
||||||
|
|
||||||
@@ -2728,7 +2758,7 @@ if test "$uname" = "sysdeps/generic"; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo $ac_n "checking OS release for uname""... $ac_c" 1>&6
|
echo $ac_n "checking OS release for uname""... $ac_c" 1>&6
|
||||||
echo "configure:2732: checking OS release for uname" >&5
|
echo "configure:2762: checking OS release for uname" >&5
|
||||||
if eval "test \"`echo '$''{'libc_cv_uname_release'+set}'`\" = set"; then
|
if eval "test \"`echo '$''{'libc_cv_uname_release'+set}'`\" = set"; then
|
||||||
echo $ac_n "(cached) $ac_c" 1>&6
|
echo $ac_n "(cached) $ac_c" 1>&6
|
||||||
else
|
else
|
||||||
@@ -2750,7 +2780,7 @@ echo "$ac_t""$libc_cv_uname_release" 1>&6
|
|||||||
uname_release="$libc_cv_uname_release"
|
uname_release="$libc_cv_uname_release"
|
||||||
|
|
||||||
echo $ac_n "checking OS version for uname""... $ac_c" 1>&6
|
echo $ac_n "checking OS version for uname""... $ac_c" 1>&6
|
||||||
echo "configure:2754: checking OS version for uname" >&5
|
echo "configure:2784: checking OS version for uname" >&5
|
||||||
if eval "test \"`echo '$''{'libc_cv_uname_version'+set}'`\" = set"; then
|
if eval "test \"`echo '$''{'libc_cv_uname_version'+set}'`\" = set"; then
|
||||||
echo $ac_n "(cached) $ac_c" 1>&6
|
echo $ac_n "(cached) $ac_c" 1>&6
|
||||||
else
|
else
|
||||||
@@ -2772,7 +2802,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo $ac_n "checking stdio selection""... $ac_c" 1>&6
|
echo $ac_n "checking stdio selection""... $ac_c" 1>&6
|
||||||
echo "configure:2776: checking stdio selection" >&5
|
echo "configure:2806: checking stdio selection" >&5
|
||||||
|
|
||||||
case $stdio in
|
case $stdio in
|
||||||
libio) cat >> confdefs.h <<\EOF
|
libio) cat >> confdefs.h <<\EOF
|
||||||
@@ -2786,7 +2816,7 @@ echo "$ac_t""$stdio" 1>&6
|
|||||||
# Test for old glibc 2.0.x headers so that they can be removed properly
|
# Test for old glibc 2.0.x headers so that they can be removed properly
|
||||||
# Search only in includedir.
|
# Search only in includedir.
|
||||||
echo $ac_n "checking for old glibc 2.0.x headers""... $ac_c" 1>&6
|
echo $ac_n "checking for old glibc 2.0.x headers""... $ac_c" 1>&6
|
||||||
echo "configure:2790: checking for old glibc 2.0.x headers" >&5
|
echo "configure:2820: checking for old glibc 2.0.x headers" >&5
|
||||||
if eval test -f "${includedir}/elfclass.h" -a -f "${includedir}/fcntlbits.h"
|
if eval test -f "${includedir}/elfclass.h" -a -f "${includedir}/fcntlbits.h"
|
||||||
then
|
then
|
||||||
old_glibc_headers=yes
|
old_glibc_headers=yes
|
||||||
@@ -2840,7 +2870,7 @@ if test $shared = default; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo $ac_n "checking whether -fPIC is default""... $ac_c" 1>&6
|
echo $ac_n "checking whether -fPIC is default""... $ac_c" 1>&6
|
||||||
echo "configure:2844: checking whether -fPIC is default" >&5
|
echo "configure:2874: checking whether -fPIC is default" >&5
|
||||||
if eval "test \"`echo '$''{'pic_default'+set}'`\" = set"; then
|
if eval "test \"`echo '$''{'pic_default'+set}'`\" = set"; then
|
||||||
echo $ac_n "(cached) $ac_c" 1>&6
|
echo $ac_n "(cached) $ac_c" 1>&6
|
||||||
else
|
else
|
||||||
|
22
configure.in
22
configure.in
@@ -987,6 +987,28 @@ static)
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
dnl Check whether compiler understands __builtin_expect.
|
||||||
|
AC_CACHE_CHECK(for __builtin_expect, libc_cv_gcc_builtin_expect,
|
||||||
|
[cat > conftest.c <<EOF
|
||||||
|
#line __oline__ "configure"
|
||||||
|
int foo (int a)
|
||||||
|
{
|
||||||
|
a = __builtin_expect (a, 10);
|
||||||
|
return a == 10 ? 0 : 1;
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
dnl No \ in command here because it ends up inside ''.
|
||||||
|
if AC_TRY_COMMAND([${CC-cc} $CFLAGS -nostdlib -nostartfiles
|
||||||
|
-o conftest conftest.c -lgcc >&AC_FD_CC]); then
|
||||||
|
libc_cv_gcc_builtin_expect=yes
|
||||||
|
else
|
||||||
|
libc_cv_gcc_builtin_expect=no
|
||||||
|
fi
|
||||||
|
rm -f conftest*])
|
||||||
|
if test "$libc_cv_gcc_builtin_expect" = yes; then
|
||||||
|
AC_DEFINE(HAVE_BUILTIN_EXPECT)
|
||||||
|
fi
|
||||||
|
|
||||||
### End of automated tests.
|
### End of automated tests.
|
||||||
### Now run sysdeps configure fragments.
|
### Now run sysdeps configure fragments.
|
||||||
|
|
||||||
|
@@ -226,6 +226,11 @@ extern const char _libc_intl_domainname[];
|
|||||||
# define internal_function /* empty */
|
# define internal_function /* empty */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Prepare for the case that `__builtin_expect' is not available. */
|
||||||
|
#ifndef HAVE_BUILTIN_EXPECT
|
||||||
|
# define __builtin_expect(expr, val) (expr)
|
||||||
|
#endif
|
||||||
|
|
||||||
/* When a reference to SYMBOL is encountered, the linker will emit a
|
/* When a reference to SYMBOL is encountered, the linker will emit a
|
||||||
warning message MSG. */
|
warning message MSG. */
|
||||||
#ifdef HAVE_GNU_LD
|
#ifdef HAVE_GNU_LD
|
||||||
|
Reference in New Issue
Block a user