mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-12-15 06:54:05 +08:00
revert: acinclude.m4 ([GLIBCXX_ENABLE_ATOMIC_BUILTINS]): Do link tests when possible.
2009-05-06 Paolo Carlini <paolo.carlini@oracle.com> Revert: 2009-05-03 Paolo Carlini <paolo.carlini@oracle.com> * acinclude.m4 ([GLIBCXX_ENABLE_ATOMIC_BUILTINS]): Do link tests when possible. * configure: Regenerate. From-SVN: r147154
This commit is contained in:
parent
7dd1ab8497
commit
326bc15919
@ -1,3 +1,12 @@
|
||||
2009-05-06 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
Revert:
|
||||
2009-05-03 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
* acinclude.m4 ([GLIBCXX_ENABLE_ATOMIC_BUILTINS]): Do link tests when
|
||||
possible.
|
||||
* configure: Regenerate.
|
||||
|
||||
2009-05-05 Jonathan Wakely <jwakely.gcc@gmail.com>
|
||||
|
||||
PR libstdc++/39909
|
||||
|
@ -2429,7 +2429,8 @@ dnl is intended to be an all-or-nothing switch, so all the atomic operations
|
||||
dnl that are used should be checked.
|
||||
dnl
|
||||
dnl Note:
|
||||
dnl libgomp and libgfortran use a link test, see CHECK_SYNC_FETCH_AND_ADD.
|
||||
dnl libgomp and libgfortran do this with a link test, instead of an asm test.
|
||||
dnl see: CHECK_SYNC_FETCH_AND_ADD
|
||||
dnl
|
||||
dnl Defines:
|
||||
dnl _GLIBCXX_ATOMIC_BUILTINS_1
|
||||
@ -2441,110 +2442,12 @@ AC_DEFUN([GLIBCXX_ENABLE_ATOMIC_BUILTINS], [
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_CPLUSPLUS
|
||||
old_CXXFLAGS="$CXXFLAGS"
|
||||
|
||||
# Do link tests if possible, instead asm tests.
|
||||
if test x$gcc_no_link != xyes; then
|
||||
|
||||
# Can do link tests.
|
||||
|
||||
CXXFLAGS="$CXXFLAGS -fno-exceptions"
|
||||
|
||||
AC_MSG_CHECKING([for atomic builtins for bool])
|
||||
AC_CACHE_VAL(glibcxx_cv_atomic_bool, [
|
||||
AC_TRY_LINK(
|
||||
[ ],
|
||||
[typedef bool atomic_type;
|
||||
atomic_type c1;
|
||||
atomic_type c2;
|
||||
const atomic_type c3(0);
|
||||
__sync_fetch_and_add(&c1, c2);
|
||||
__sync_val_compare_and_swap(&c1, c3, c2);
|
||||
__sync_lock_test_and_set(&c1, c3);
|
||||
__sync_lock_release(&c1);
|
||||
__sync_synchronize();],
|
||||
[glibcxx_cv_atomic_bool=yes],
|
||||
[glibcxx_cv_atomic_bool=no])
|
||||
])
|
||||
if test $glibcxx_cv_atomic_bool = yes; then
|
||||
AC_DEFINE(_GLIBCXX_ATOMIC_BUILTINS_1, 1,
|
||||
[Define if builtin atomic operations for bool are supported on this host.])
|
||||
fi
|
||||
AC_MSG_RESULT($glibcxx_cv_atomic_bool)
|
||||
|
||||
AC_MSG_CHECKING([for atomic builtins for short])
|
||||
AC_CACHE_VAL(glibcxx_cv_atomic_short, [
|
||||
AC_TRY_LINK(
|
||||
[ ],
|
||||
[typedef short atomic_type;
|
||||
atomic_type c1;
|
||||
atomic_type c2;
|
||||
const atomic_type c3(0);
|
||||
__sync_fetch_and_add(&c1, c2);
|
||||
__sync_val_compare_and_swap(&c1, c3, c2);
|
||||
__sync_lock_test_and_set(&c1, c3);
|
||||
__sync_lock_release(&c1);
|
||||
__sync_synchronize();],
|
||||
[glibcxx_cv_atomic_short=yes],
|
||||
[glibcxx_cv_atomic_short=no])
|
||||
])
|
||||
if test $glibcxx_cv_atomic_short = yes; then
|
||||
AC_DEFINE(_GLIBCXX_ATOMIC_BUILTINS_2, 1,
|
||||
[Define if builtin atomic operations for short are supported on this host.])
|
||||
fi
|
||||
AC_MSG_RESULT($glibcxx_cv_atomic_short)
|
||||
|
||||
AC_MSG_CHECKING([for atomic builtins for int])
|
||||
AC_CACHE_VAL(glibcxx_cv_atomic_int, [
|
||||
AC_TRY_LINK(
|
||||
[ ],
|
||||
[typedef int atomic_type;
|
||||
atomic_type c1;
|
||||
atomic_type c2;
|
||||
const atomic_type c3(0);
|
||||
__sync_fetch_and_add(&c1, c2);
|
||||
__sync_val_compare_and_swap(&c1, c3, c2);
|
||||
__sync_lock_test_and_set(&c1, c3);
|
||||
__sync_lock_release(&c1);
|
||||
__sync_synchronize();],
|
||||
[glibcxx_cv_atomic_int=yes],
|
||||
[glibcxx_cv_atomic_int=no])
|
||||
])
|
||||
if test $glibcxx_cv_atomic_int = yes; then
|
||||
AC_DEFINE(_GLIBCXX_ATOMIC_BUILTINS_4, 1,
|
||||
[Define if builtin atomic operations for int are supported on this host.])
|
||||
fi
|
||||
AC_MSG_RESULT($glibcxx_cv_atomic_int)
|
||||
|
||||
AC_MSG_CHECKING([for atomic builtins for long long])
|
||||
AC_CACHE_VAL(glibcxx_cv_atomic_long_long, [
|
||||
AC_TRY_LINK(
|
||||
[ ],
|
||||
[typedef long long atomic_type;
|
||||
atomic_type c1;
|
||||
atomic_type c2;
|
||||
const atomic_type c3(0);
|
||||
__sync_fetch_and_add(&c1, c2);
|
||||
__sync_val_compare_and_swap(&c1, c3, c2);
|
||||
__sync_lock_test_and_set(&c1, c3);
|
||||
__sync_lock_release(&c1);
|
||||
__sync_synchronize();],
|
||||
[glibcxx_cv_atomic_long_long=yes],
|
||||
[glibcxx_cv_atomic_long_long=no])
|
||||
])
|
||||
if test $glibcxx_cv_atomic_long_long = yes; then
|
||||
AC_DEFINE(_GLIBCXX_ATOMIC_BUILTINS_8, 1,
|
||||
[Define if builtin atomic operations for long long are supported on this host.])
|
||||
fi
|
||||
AC_MSG_RESULT($glibcxx_cv_atomic_long_long)
|
||||
|
||||
else
|
||||
|
||||
# Do asm tests.
|
||||
|
||||
|
||||
# Compile unoptimized.
|
||||
CXXFLAGS='-O0 -S'
|
||||
|
||||
# Fake what AC_TRY_COMPILE does.
|
||||
# Fake what AC_TRY_COMPILE does, without linking as this is
|
||||
# unnecessary for a builtins test.
|
||||
|
||||
cat > conftest.$ac_ext << EOF
|
||||
[#]line __oline__ "configure"
|
||||
@ -2566,14 +2469,14 @@ EOF
|
||||
AC_MSG_CHECKING([for atomic builtins for bool])
|
||||
if AC_TRY_EVAL(ac_compile); then
|
||||
if grep __sync_ conftest.s >/dev/null 2>&1 ; then
|
||||
glibcxx_cv_atomic_bool=no
|
||||
enable_atomic_builtinsb=no
|
||||
else
|
||||
AC_DEFINE(_GLIBCXX_ATOMIC_BUILTINS_1, 1,
|
||||
[Define if builtin atomic operations for bool are supported on this host.])
|
||||
glibcxx_cv_atomic_bool=yes
|
||||
enable_atomic_builtinsb=yes
|
||||
fi
|
||||
fi
|
||||
AC_MSG_RESULT($glibcxx_cv_atomic_bool)
|
||||
AC_MSG_RESULT($enable_atomic_builtinsb)
|
||||
rm -f conftest*
|
||||
|
||||
cat > conftest.$ac_ext << EOF
|
||||
@ -2596,14 +2499,14 @@ EOF
|
||||
AC_MSG_CHECKING([for atomic builtins for short])
|
||||
if AC_TRY_EVAL(ac_compile); then
|
||||
if grep __sync_ conftest.s >/dev/null 2>&1 ; then
|
||||
glibcxx_cv_atomic_short=no
|
||||
enable_atomic_builtinss=no
|
||||
else
|
||||
AC_DEFINE(_GLIBCXX_ATOMIC_BUILTINS_2, 1,
|
||||
[Define if builtin atomic operations for short are supported on this host.])
|
||||
glibcxx_cv_atomic_short=yes
|
||||
enable_atomic_builtinss=yes
|
||||
fi
|
||||
fi
|
||||
AC_MSG_RESULT($glibcxx_cv_atomic_short)
|
||||
AC_MSG_RESULT($enable_atomic_builtinss)
|
||||
rm -f conftest*
|
||||
|
||||
cat > conftest.$ac_ext << EOF
|
||||
@ -2627,14 +2530,14 @@ EOF
|
||||
AC_MSG_CHECKING([for atomic builtins for int])
|
||||
if AC_TRY_EVAL(ac_compile); then
|
||||
if grep __sync_ conftest.s >/dev/null 2>&1 ; then
|
||||
glibcxx_cv_atomic_int=no
|
||||
enable_atomic_builtinsi=no
|
||||
else
|
||||
AC_DEFINE(_GLIBCXX_ATOMIC_BUILTINS_4, 1,
|
||||
[Define if builtin atomic operations for int are supported on this host.])
|
||||
glibcxx_cv_atomic_int=yes
|
||||
enable_atomic_builtinsi=yes
|
||||
fi
|
||||
fi
|
||||
AC_MSG_RESULT($glibcxx_cv_atomic_int)
|
||||
AC_MSG_RESULT($enable_atomic_builtinsi)
|
||||
rm -f conftest*
|
||||
|
||||
cat > conftest.$ac_ext << EOF
|
||||
@ -2657,23 +2560,22 @@ EOF
|
||||
AC_MSG_CHECKING([for atomic builtins for long long])
|
||||
if AC_TRY_EVAL(ac_compile); then
|
||||
if grep __sync_ conftest.s >/dev/null 2>&1 ; then
|
||||
glibcxx_cv_atomic_long_long=no
|
||||
enable_atomic_builtinsll=no
|
||||
else
|
||||
AC_DEFINE(_GLIBCXX_ATOMIC_BUILTINS_8, 1,
|
||||
[Define if builtin atomic operations for long long are supported on this host.])
|
||||
glibcxx_cv_atomic_long_long=yes
|
||||
enable_atomic_builtinsll=yes
|
||||
fi
|
||||
fi
|
||||
AC_MSG_RESULT($glibcxx_cv_atomic_long_long)
|
||||
AC_MSG_RESULT($enable_atomic_builtinsll)
|
||||
rm -f conftest*
|
||||
|
||||
fi
|
||||
|
||||
CXXFLAGS="$old_CXXFLAGS"
|
||||
AC_LANG_RESTORE
|
||||
|
||||
# Set atomicity_dir to builtins if either of above tests pass.
|
||||
if test $glibcxx_cv_atomic_int = yes || test $glibcxx_cv_atomic_bool = yes ; then
|
||||
if test $enable_atomic_builtinsi = yes || test $enable_atomic_builtinsb = yes ; then
|
||||
atomicity_dir=cpu/generic/atomicity_builtins
|
||||
fi
|
||||
|
||||
|
369
libstdc++-v3/configure
vendored
369
libstdc++-v3/configure
vendored
@ -14757,336 +14757,14 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
|
||||
|
||||
old_CXXFLAGS="$CXXFLAGS"
|
||||
|
||||
# Do link tests if possible, instead asm tests.
|
||||
if test x$gcc_no_link != xyes; then
|
||||
|
||||
# Can do link tests.
|
||||
|
||||
CXXFLAGS="$CXXFLAGS -fno-exceptions"
|
||||
|
||||
echo "$as_me:$LINENO: checking for atomic builtins for bool" >&5
|
||||
echo $ECHO_N "checking for atomic builtins for bool... $ECHO_C" >&6
|
||||
if test "${glibcxx_cv_atomic_bool+set}" = set; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
|
||||
if test x$gcc_no_link = xyes; then
|
||||
{ { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
|
||||
echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
|
||||
{ (exit 1); exit 1; }; }
|
||||
fi
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
typedef bool atomic_type;
|
||||
atomic_type c1;
|
||||
atomic_type c2;
|
||||
const atomic_type c3(0);
|
||||
__sync_fetch_and_add(&c1, c2);
|
||||
__sync_val_compare_and_swap(&c1, c3, c2);
|
||||
__sync_lock_test_and_set(&c1, c3);
|
||||
__sync_lock_release(&c1);
|
||||
__sync_synchronize();
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
rm -f conftest.$ac_objext conftest$ac_exeext
|
||||
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
|
||||
(eval $ac_link) 2>conftest.er1
|
||||
ac_status=$?
|
||||
grep -v '^ *+' conftest.er1 >conftest.err
|
||||
rm -f conftest.er1
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); } &&
|
||||
{ ac_try='test -z "$ac_cxx_werror_flag"
|
||||
|| test ! -s conftest.err'
|
||||
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||
(eval $ac_try) 2>&5
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; } &&
|
||||
{ ac_try='test -s conftest$ac_exeext'
|
||||
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||
(eval $ac_try) 2>&5
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; }; then
|
||||
glibcxx_cv_atomic_bool=yes
|
||||
else
|
||||
echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
glibcxx_cv_atomic_bool=no
|
||||
fi
|
||||
rm -f conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
|
||||
fi
|
||||
|
||||
if test $glibcxx_cv_atomic_bool = yes; then
|
||||
|
||||
cat >>confdefs.h <<\_ACEOF
|
||||
#define _GLIBCXX_ATOMIC_BUILTINS_1 1
|
||||
_ACEOF
|
||||
|
||||
fi
|
||||
echo "$as_me:$LINENO: result: $glibcxx_cv_atomic_bool" >&5
|
||||
echo "${ECHO_T}$glibcxx_cv_atomic_bool" >&6
|
||||
|
||||
echo "$as_me:$LINENO: checking for atomic builtins for short" >&5
|
||||
echo $ECHO_N "checking for atomic builtins for short... $ECHO_C" >&6
|
||||
if test "${glibcxx_cv_atomic_short+set}" = set; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
|
||||
if test x$gcc_no_link = xyes; then
|
||||
{ { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
|
||||
echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
|
||||
{ (exit 1); exit 1; }; }
|
||||
fi
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
typedef short atomic_type;
|
||||
atomic_type c1;
|
||||
atomic_type c2;
|
||||
const atomic_type c3(0);
|
||||
__sync_fetch_and_add(&c1, c2);
|
||||
__sync_val_compare_and_swap(&c1, c3, c2);
|
||||
__sync_lock_test_and_set(&c1, c3);
|
||||
__sync_lock_release(&c1);
|
||||
__sync_synchronize();
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
rm -f conftest.$ac_objext conftest$ac_exeext
|
||||
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
|
||||
(eval $ac_link) 2>conftest.er1
|
||||
ac_status=$?
|
||||
grep -v '^ *+' conftest.er1 >conftest.err
|
||||
rm -f conftest.er1
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); } &&
|
||||
{ ac_try='test -z "$ac_cxx_werror_flag"
|
||||
|| test ! -s conftest.err'
|
||||
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||
(eval $ac_try) 2>&5
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; } &&
|
||||
{ ac_try='test -s conftest$ac_exeext'
|
||||
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||
(eval $ac_try) 2>&5
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; }; then
|
||||
glibcxx_cv_atomic_short=yes
|
||||
else
|
||||
echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
glibcxx_cv_atomic_short=no
|
||||
fi
|
||||
rm -f conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
|
||||
fi
|
||||
|
||||
if test $glibcxx_cv_atomic_short = yes; then
|
||||
|
||||
cat >>confdefs.h <<\_ACEOF
|
||||
#define _GLIBCXX_ATOMIC_BUILTINS_2 1
|
||||
_ACEOF
|
||||
|
||||
fi
|
||||
echo "$as_me:$LINENO: result: $glibcxx_cv_atomic_short" >&5
|
||||
echo "${ECHO_T}$glibcxx_cv_atomic_short" >&6
|
||||
|
||||
echo "$as_me:$LINENO: checking for atomic builtins for int" >&5
|
||||
echo $ECHO_N "checking for atomic builtins for int... $ECHO_C" >&6
|
||||
if test "${glibcxx_cv_atomic_int+set}" = set; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
|
||||
if test x$gcc_no_link = xyes; then
|
||||
{ { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
|
||||
echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
|
||||
{ (exit 1); exit 1; }; }
|
||||
fi
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
typedef int atomic_type;
|
||||
atomic_type c1;
|
||||
atomic_type c2;
|
||||
const atomic_type c3(0);
|
||||
__sync_fetch_and_add(&c1, c2);
|
||||
__sync_val_compare_and_swap(&c1, c3, c2);
|
||||
__sync_lock_test_and_set(&c1, c3);
|
||||
__sync_lock_release(&c1);
|
||||
__sync_synchronize();
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
rm -f conftest.$ac_objext conftest$ac_exeext
|
||||
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
|
||||
(eval $ac_link) 2>conftest.er1
|
||||
ac_status=$?
|
||||
grep -v '^ *+' conftest.er1 >conftest.err
|
||||
rm -f conftest.er1
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); } &&
|
||||
{ ac_try='test -z "$ac_cxx_werror_flag"
|
||||
|| test ! -s conftest.err'
|
||||
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||
(eval $ac_try) 2>&5
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; } &&
|
||||
{ ac_try='test -s conftest$ac_exeext'
|
||||
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||
(eval $ac_try) 2>&5
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; }; then
|
||||
glibcxx_cv_atomic_int=yes
|
||||
else
|
||||
echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
glibcxx_cv_atomic_int=no
|
||||
fi
|
||||
rm -f conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
|
||||
fi
|
||||
|
||||
if test $glibcxx_cv_atomic_int = yes; then
|
||||
|
||||
cat >>confdefs.h <<\_ACEOF
|
||||
#define _GLIBCXX_ATOMIC_BUILTINS_4 1
|
||||
_ACEOF
|
||||
|
||||
fi
|
||||
echo "$as_me:$LINENO: result: $glibcxx_cv_atomic_int" >&5
|
||||
echo "${ECHO_T}$glibcxx_cv_atomic_int" >&6
|
||||
|
||||
echo "$as_me:$LINENO: checking for atomic builtins for long long" >&5
|
||||
echo $ECHO_N "checking for atomic builtins for long long... $ECHO_C" >&6
|
||||
if test "${glibcxx_cv_atomic_long_long+set}" = set; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
|
||||
if test x$gcc_no_link = xyes; then
|
||||
{ { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
|
||||
echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
|
||||
{ (exit 1); exit 1; }; }
|
||||
fi
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
typedef long long atomic_type;
|
||||
atomic_type c1;
|
||||
atomic_type c2;
|
||||
const atomic_type c3(0);
|
||||
__sync_fetch_and_add(&c1, c2);
|
||||
__sync_val_compare_and_swap(&c1, c3, c2);
|
||||
__sync_lock_test_and_set(&c1, c3);
|
||||
__sync_lock_release(&c1);
|
||||
__sync_synchronize();
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
rm -f conftest.$ac_objext conftest$ac_exeext
|
||||
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
|
||||
(eval $ac_link) 2>conftest.er1
|
||||
ac_status=$?
|
||||
grep -v '^ *+' conftest.er1 >conftest.err
|
||||
rm -f conftest.er1
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); } &&
|
||||
{ ac_try='test -z "$ac_cxx_werror_flag"
|
||||
|| test ! -s conftest.err'
|
||||
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||
(eval $ac_try) 2>&5
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; } &&
|
||||
{ ac_try='test -s conftest$ac_exeext'
|
||||
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||
(eval $ac_try) 2>&5
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; }; then
|
||||
glibcxx_cv_atomic_long_long=yes
|
||||
else
|
||||
echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
glibcxx_cv_atomic_long_long=no
|
||||
fi
|
||||
rm -f conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
|
||||
fi
|
||||
|
||||
if test $glibcxx_cv_atomic_long_long = yes; then
|
||||
|
||||
cat >>confdefs.h <<\_ACEOF
|
||||
#define _GLIBCXX_ATOMIC_BUILTINS_8 1
|
||||
_ACEOF
|
||||
|
||||
fi
|
||||
echo "$as_me:$LINENO: result: $glibcxx_cv_atomic_long_long" >&5
|
||||
echo "${ECHO_T}$glibcxx_cv_atomic_long_long" >&6
|
||||
|
||||
else
|
||||
|
||||
# Do asm tests.
|
||||
|
||||
# Compile unoptimized.
|
||||
CXXFLAGS='-O0 -S'
|
||||
|
||||
# Fake what AC_TRY_COMPILE does.
|
||||
# Fake what AC_TRY_COMPILE does, without linking as this is
|
||||
# unnecessary for a builtins test.
|
||||
|
||||
cat > conftest.$ac_ext << EOF
|
||||
#line 15089 "configure"
|
||||
#line 14767 "configure"
|
||||
int main()
|
||||
{
|
||||
typedef bool atomic_type;
|
||||
@ -15110,22 +14788,22 @@ echo $ECHO_N "checking for atomic builtins for bool... $ECHO_C" >&6
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; then
|
||||
if grep __sync_ conftest.s >/dev/null 2>&1 ; then
|
||||
glibcxx_cv_atomic_bool=no
|
||||
enable_atomic_builtinsb=no
|
||||
else
|
||||
|
||||
cat >>confdefs.h <<\_ACEOF
|
||||
#define _GLIBCXX_ATOMIC_BUILTINS_1 1
|
||||
_ACEOF
|
||||
|
||||
glibcxx_cv_atomic_bool=yes
|
||||
enable_atomic_builtinsb=yes
|
||||
fi
|
||||
fi
|
||||
echo "$as_me:$LINENO: result: $glibcxx_cv_atomic_bool" >&5
|
||||
echo "${ECHO_T}$glibcxx_cv_atomic_bool" >&6
|
||||
echo "$as_me:$LINENO: result: $enable_atomic_builtinsb" >&5
|
||||
echo "${ECHO_T}$enable_atomic_builtinsb" >&6
|
||||
rm -f conftest*
|
||||
|
||||
cat > conftest.$ac_ext << EOF
|
||||
#line 15128 "configure"
|
||||
#line 14806 "configure"
|
||||
int main()
|
||||
{
|
||||
typedef short atomic_type;
|
||||
@ -15149,22 +14827,22 @@ echo $ECHO_N "checking for atomic builtins for short... $ECHO_C" >&6
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; then
|
||||
if grep __sync_ conftest.s >/dev/null 2>&1 ; then
|
||||
glibcxx_cv_atomic_short=no
|
||||
enable_atomic_builtinss=no
|
||||
else
|
||||
|
||||
cat >>confdefs.h <<\_ACEOF
|
||||
#define _GLIBCXX_ATOMIC_BUILTINS_2 1
|
||||
_ACEOF
|
||||
|
||||
glibcxx_cv_atomic_short=yes
|
||||
enable_atomic_builtinss=yes
|
||||
fi
|
||||
fi
|
||||
echo "$as_me:$LINENO: result: $glibcxx_cv_atomic_short" >&5
|
||||
echo "${ECHO_T}$glibcxx_cv_atomic_short" >&6
|
||||
echo "$as_me:$LINENO: result: $enable_atomic_builtinss" >&5
|
||||
echo "${ECHO_T}$enable_atomic_builtinss" >&6
|
||||
rm -f conftest*
|
||||
|
||||
cat > conftest.$ac_ext << EOF
|
||||
#line 15167 "configure"
|
||||
#line 14845 "configure"
|
||||
int main()
|
||||
{
|
||||
// NB: _Atomic_word not necessarily int.
|
||||
@ -15189,22 +14867,22 @@ echo $ECHO_N "checking for atomic builtins for int... $ECHO_C" >&6
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; then
|
||||
if grep __sync_ conftest.s >/dev/null 2>&1 ; then
|
||||
glibcxx_cv_atomic_int=no
|
||||
enable_atomic_builtinsi=no
|
||||
else
|
||||
|
||||
cat >>confdefs.h <<\_ACEOF
|
||||
#define _GLIBCXX_ATOMIC_BUILTINS_4 1
|
||||
_ACEOF
|
||||
|
||||
glibcxx_cv_atomic_int=yes
|
||||
enable_atomic_builtinsi=yes
|
||||
fi
|
||||
fi
|
||||
echo "$as_me:$LINENO: result: $glibcxx_cv_atomic_int" >&5
|
||||
echo "${ECHO_T}$glibcxx_cv_atomic_int" >&6
|
||||
echo "$as_me:$LINENO: result: $enable_atomic_builtinsi" >&5
|
||||
echo "${ECHO_T}$enable_atomic_builtinsi" >&6
|
||||
rm -f conftest*
|
||||
|
||||
cat > conftest.$ac_ext << EOF
|
||||
#line 15207 "configure"
|
||||
#line 14885 "configure"
|
||||
int main()
|
||||
{
|
||||
typedef long long atomic_type;
|
||||
@ -15228,21 +14906,20 @@ echo $ECHO_N "checking for atomic builtins for long long... $ECHO_C" >&6
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; then
|
||||
if grep __sync_ conftest.s >/dev/null 2>&1 ; then
|
||||
glibcxx_cv_atomic_long_long=no
|
||||
enable_atomic_builtinsll=no
|
||||
else
|
||||
|
||||
cat >>confdefs.h <<\_ACEOF
|
||||
#define _GLIBCXX_ATOMIC_BUILTINS_8 1
|
||||
_ACEOF
|
||||
|
||||
glibcxx_cv_atomic_long_long=yes
|
||||
enable_atomic_builtinsll=yes
|
||||
fi
|
||||
fi
|
||||
echo "$as_me:$LINENO: result: $glibcxx_cv_atomic_long_long" >&5
|
||||
echo "${ECHO_T}$glibcxx_cv_atomic_long_long" >&6
|
||||
echo "$as_me:$LINENO: result: $enable_atomic_builtinsll" >&5
|
||||
echo "${ECHO_T}$enable_atomic_builtinsll" >&6
|
||||
rm -f conftest*
|
||||
|
||||
fi
|
||||
|
||||
CXXFLAGS="$old_CXXFLAGS"
|
||||
ac_ext=c
|
||||
@ -15253,7 +14930,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
|
||||
|
||||
|
||||
# Set atomicity_dir to builtins if either of above tests pass.
|
||||
if test $glibcxx_cv_atomic_int = yes || test $glibcxx_cv_atomic_bool = yes ; then
|
||||
if test $enable_atomic_builtinsi = yes || test $enable_atomic_builtinsb = yes ; then
|
||||
atomicity_dir=cpu/generic/atomicity_builtins
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user