diff options
Diffstat (limited to 'libstdc++-v3/configure')
-rwxr-xr-x | libstdc++-v3/configure | 723 |
1 files changed, 210 insertions, 513 deletions
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index 67d2b8c..69aa246 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -2731,63 +2731,6 @@ $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_decl - -# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES -# ---------------------------------------------------- -# Tries to find if the field MEMBER exists in type AGGR, after including -# INCLUDES, setting cache variable VAR accordingly. -ac_fn_c_check_member () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 -$as_echo_n "checking for $2.$3... " >&6; } -if eval \${$4+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$5 -int -main () -{ -static $2 ac_aggr; -if (ac_aggr.$3) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$4=yes" -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$5 -int -main () -{ -static $2 ac_aggr; -if (sizeof ac_aggr.$3) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$4=yes" -else - eval "$4=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$4 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_member cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. @@ -12337,7 +12280,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12340 "configure" +#line 12283 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12443,7 +12386,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12446 "configure" +#line 12389 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -16046,7 +15989,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu old_CXXFLAGS="$CXXFLAGS" - # Do link tests if possible, instead asm tests, limited to some platforms + # Do link tests if possible, otherwise asm tests. Limited to some platforms # see discussion in PR target/40134, PR libstdc++/40133 and the thread # starting at http://gcc.gnu.org/ml/gcc-patches/2009-07/msg00322.html atomic_builtins_link_tests=no @@ -16059,326 +16002,77 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu esac fi - if test x$atomic_builtins_link_tests = xyes; then + if test "$atomic_builtins_link_tests" = yes; then - # Do link tests. + # Do link tests. - CXXFLAGS="$CXXFLAGS -fno-exceptions" + CXXFLAGS="$CXXFLAGS -fno-exceptions" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for atomic builtins for bool" >&5 -$as_echo_n "checking for atomic builtins for bool... " >&6; } -if ${glibcxx_cv_atomic_bool+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for atomic builtins for _Atomic_word" >&5 +$as_echo_n "checking for atomic builtins for _Atomic_word... " >&6; } +if ${glibcxx_cv_atomic_word+:} false; then : $as_echo_n "(cached) " >&6 else - - if test x$gcc_no_link = xyes; then - as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5 -fi -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -typedef bool atomic_type; - atomic_type c1; - atomic_type c2; - atomic_type c3(0); - // N.B. __atomic_fetch_add is not supported for bool. - __atomic_compare_exchange_n(&c1, &c2, c3, true, __ATOMIC_ACQ_REL, - __ATOMIC_RELAXED); - __atomic_test_and_set(&c1, __ATOMIC_RELAXED); - __atomic_load_n(&c1, __ATOMIC_RELAXED); - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - glibcxx_cv_atomic_bool=yes -else - glibcxx_cv_atomic_bool=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_atomic_bool" >&5 -$as_echo "$glibcxx_cv_atomic_bool" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for atomic builtins for short" >&5 -$as_echo_n "checking for atomic builtins for short... " >&6; } -if ${glibcxx_cv_atomic_short+:} false; then : - $as_echo_n "(cached) " >&6 -else - - if test x$gcc_no_link = xyes; then - as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5 -fi -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -typedef short atomic_type; - atomic_type c1; - atomic_type c2; - atomic_type c3(0); - __atomic_fetch_add(&c1, c2, __ATOMIC_RELAXED); - __atomic_compare_exchange_n(&c1, &c2, c3, true, __ATOMIC_ACQ_REL, - __ATOMIC_RELAXED); - __atomic_test_and_set(&c1, __ATOMIC_RELAXED); - __atomic_load_n(&c1, __ATOMIC_RELAXED); - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - glibcxx_cv_atomic_short=yes -else - glibcxx_cv_atomic_short=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_atomic_short" >&5 -$as_echo "$glibcxx_cv_atomic_short" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for atomic builtins for int" >&5 -$as_echo_n "checking for atomic builtins for int... " >&6; } -if ${glibcxx_cv_atomic_int+:} false; then : - $as_echo_n "(cached) " >&6 -else - - if test x$gcc_no_link = xyes; then - as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5 -fi -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -typedef int atomic_type; - atomic_type c1; - atomic_type c2; - atomic_type c3(0); - __atomic_fetch_add(&c1, c2, __ATOMIC_RELAXED); - __atomic_compare_exchange_n(&c1, &c2, c3, true, __ATOMIC_ACQ_REL, - __ATOMIC_RELAXED); - __atomic_test_and_set(&c1, __ATOMIC_RELAXED); - __atomic_load_n(&c1, __ATOMIC_RELAXED); - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - glibcxx_cv_atomic_int=yes -else - glibcxx_cv_atomic_int=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_atomic_int" >&5 -$as_echo "$glibcxx_cv_atomic_int" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for atomic builtins for long long" >&5 -$as_echo_n "checking for atomic builtins for long long... " >&6; } -if ${glibcxx_cv_atomic_long_long+:} false; then : - $as_echo_n "(cached) " >&6 -else - - if test x$gcc_no_link = xyes; then + if test x$gcc_no_link = xyes; then as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5 fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - +#include "${glibcxx_srcdir}/config/$atomic_word_dir/atomic_word.h" int main () { -typedef long long atomic_type; - atomic_type c1; - atomic_type c2; - atomic_type c3(0); - __atomic_fetch_add(&c1, c2, __ATOMIC_RELAXED); - __atomic_compare_exchange_n(&c1, &c2, c3, true, __ATOMIC_ACQ_REL, - __ATOMIC_RELAXED); - __atomic_test_and_set(&c1, __ATOMIC_RELAXED); - __atomic_load_n(&c1, __ATOMIC_RELAXED); - +_Atomic_word a = 0, b; + b = __atomic_fetch_add(&a, 1, __ATOMIC_ACQ_REL); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : - glibcxx_cv_atomic_long_long=yes + glibcxx_cv_atomic_word=yes else - glibcxx_cv_atomic_long_long=no + glibcxx_cv_atomic_word=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_atomic_long_long" >&5 -$as_echo "$glibcxx_cv_atomic_long_long" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_atomic_word" >&5 +$as_echo "$glibcxx_cv_atomic_word" >&6; } else + # Do asm tests. - # Do asm tests. - - # Compile unoptimized. - CXXFLAGS='-O0 -S' - - # Fake what AC_TRY_COMPILE does. - - cat > conftest.$ac_ext << EOF -#line 16242 "configure" -int main() -{ - typedef bool atomic_type; - atomic_type c1; - atomic_type c2; - atomic_type c3(0); - // N.B. __atomic_fetch_add is not supported for bool. - __atomic_compare_exchange_n(&c1, &c2, c3, true, __ATOMIC_ACQ_REL, - __ATOMIC_RELAXED); - __atomic_test_and_set(&c1, __ATOMIC_RELAXED); - __atomic_load_n(&c1, __ATOMIC_RELAXED); - - return 0; -} -EOF - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for atomic builtins for bool" >&5 -$as_echo_n "checking for atomic builtins for bool... " >&6; } - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - if grep __atomic_ conftest.s >/dev/null 2>&1 ; then - glibcxx_cv_atomic_bool=no - else - glibcxx_cv_atomic_bool=yes - fi - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_atomic_bool" >&5 -$as_echo "$glibcxx_cv_atomic_bool" >&6; } - rm -f conftest* - - cat > conftest.$ac_ext << EOF -#line 16277 "configure" -int main() -{ - typedef short atomic_type; - atomic_type c1; - atomic_type c2; - atomic_type c3(0); - __atomic_fetch_add(&c1, c2, __ATOMIC_RELAXED); - __atomic_compare_exchange_n(&c1, &c2, c3, true, __ATOMIC_ACQ_REL, - __ATOMIC_RELAXED); - __atomic_test_and_set(&c1, __ATOMIC_RELAXED); - __atomic_load_n(&c1, __ATOMIC_RELAXED); - - return 0; -} -EOF - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for atomic builtins for short" >&5 -$as_echo_n "checking for atomic builtins for short... " >&6; } - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - if grep __atomic_ conftest.s >/dev/null 2>&1 ; then - glibcxx_cv_atomic_short=no - else - glibcxx_cv_atomic_short=yes - fi - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_atomic_short" >&5 -$as_echo "$glibcxx_cv_atomic_short" >&6; } - rm -f conftest* + # Compile unoptimized. + CXXFLAGS='-O0 -S' - cat > conftest.$ac_ext << EOF -#line 16312 "configure" -int main() -{ - // NB: _Atomic_word not necessarily int. - typedef int atomic_type; - atomic_type c1; - atomic_type c2; - atomic_type c3(0); - __atomic_fetch_add(&c1, c2, __ATOMIC_RELAXED); - __atomic_compare_exchange_n(&c1, &c2, c3, true, __ATOMIC_ACQ_REL, - __ATOMIC_RELAXED); - __atomic_test_and_set(&c1, __ATOMIC_RELAXED); - __atomic_load_n(&c1, __ATOMIC_RELAXED); - - return 0; -} -EOF - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for atomic builtins for int" >&5 -$as_echo_n "checking for atomic builtins for int... " >&6; } - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - if grep __atomic_ conftest.s >/dev/null 2>&1 ; then - glibcxx_cv_atomic_int=no - else - glibcxx_cv_atomic_int=yes - fi - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_atomic_int" >&5 -$as_echo "$glibcxx_cv_atomic_int" >&6; } - rm -f conftest* + # Fake what AC_TRY_COMPILE does. cat > conftest.$ac_ext << EOF -#line 16348 "configure" +#line 16051 "configure" +#include "${glibcxx_srcdir}/config/$atomic_word_dir/atomic_word.h" int main() { - typedef long long atomic_type; - atomic_type c1; - atomic_type c2; - atomic_type c3(0); - __atomic_fetch_add(&c1, c2, __ATOMIC_RELAXED); - __atomic_compare_exchange_n(&c1, &c2, c3, true, __ATOMIC_ACQ_REL, - __ATOMIC_RELAXED); - __atomic_test_and_set(&c1, __ATOMIC_RELAXED); - __atomic_load_n(&c1, __ATOMIC_RELAXED); - - return 0; + _Atomic_word a = 0, b; + b = __atomic_fetch_add(&a, 1, __ATOMIC_ACQ_REL); } EOF - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for atomic builtins for long long" >&5 -$as_echo_n "checking for atomic builtins for long long... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for atomic builtins for _Atomic_word" >&5 +$as_echo_n "checking for atomic builtins for _Atomic_word... " >&6; } if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if grep __atomic_ conftest.s >/dev/null 2>&1 ; then - glibcxx_cv_atomic_long_long=no + glibcxx_cv_atomic_word=no else - glibcxx_cv_atomic_long_long=yes + glibcxx_cv_atomic_word=yes fi fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_atomic_long_long" >&5 -$as_echo "$glibcxx_cv_atomic_long_long" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_atomic_word" >&5 +$as_echo "$glibcxx_cv_atomic_word" >&6; } rm -f conftest* - fi CXXFLAGS="$old_CXXFLAGS" @@ -16389,14 +16083,12 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu - # Set atomicity_dir to builtins if all but the long long test above passes, + # Set atomicity_dir to builtins if the test above passes, # or if the builtins were already chosen (e.g. by configure.host). - if { test "$glibcxx_cv_atomic_bool" = yes \ - && test "$glibcxx_cv_atomic_short" = yes \ - && test "$glibcxx_cv_atomic_int" = yes; } \ + if test "$glibcxx_cv_atomic_word" = yes \ || test "$atomicity_dir" = "cpu/generic/atomicity_builtins"; then -$as_echo "#define _GLIBCXX_ATOMIC_BUILTINS 1" >>confdefs.h +$as_echo "#define _GLIBCXX_ATOMIC_WORD_BUILTINS 1" >>confdefs.h atomicity_dir=cpu/generic/atomicity_builtins fi @@ -16451,10 +16143,11 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #if defined __riscv + #if defined __AMDGCN__ || defined __nvptx__ + /* Yes, please. */ + #elif defined __riscv # error "Defaulting to mutex-based locks for ABI compatibility" - #endif - #if ! defined __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 + #elif ! defined __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 # error "No 2-byte compare-and-swap" #elif ! defined __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 # error "No 4-byte compare-and-swap" @@ -16501,7 +16194,7 @@ $as_echo "mutex" >&6; } # unnecessary for this test. cat > conftest.$ac_ext << EOF -#line 16504 "configure" +#line 16197 "configure" int main() { _Decimal32 d1; @@ -16543,7 +16236,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # unnecessary for this test. cat > conftest.$ac_ext << EOF -#line 16546 "configure" +#line 16239 "configure" template<typename T1, typename T2> struct same { typedef T2 type; }; @@ -52297,64 +51990,6 @@ fi fi fi - ac_fn_cxx_check_header_mongrel "$LINENO" "semaphore.h" "ac_cv_header_semaphore_h" "$ac_includes_default" -if test "x$ac_cv_header_semaphore_h" = xyes; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for POSIX Semaphores and sem_timedwait" >&5 -$as_echo_n "checking for POSIX Semaphores and sem_timedwait... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include <unistd.h> - #include <semaphore.h> - #include <limits.h> - -int -main () -{ - - #if !defined _POSIX_TIMEOUTS || _POSIX_TIMEOUTS <= 0 - # error "POSIX Timeouts option not supported" - #elif !defined _POSIX_SEMAPHORES || _POSIX_SEMAPHORES <= 0 - # error "POSIX Semaphores option not supported" - #else - #if defined SEM_VALUE_MAX - constexpr int sem_value_max = SEM_VALUE_MAX; - #elif defined _POSIX_SEM_VALUE_MAX - constexpr int sem_value_max = _POSIX_SEM_VALUE_MAX; - #else - # error "SEM_VALUE_MAX not available" - #endif - sem_t sem; - sem_init(&sem, 0, sem_value_max); - struct timespec ts = { 0 }; - sem_timedwait(&sem, &ts); - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_have_posix_semaphore=yes -else - ac_have_posix_semaphore=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - ac_have_posix_semaphore=no -fi - - - - if test $ac_have_posix_semaphore = yes ; then - -$as_echo "#define HAVE_POSIX_SEMAPHORE 1" >>confdefs.h - - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_have_posix_semaphore" >&5 -$as_echo "$ac_have_posix_semaphore" >&6; } - CXXFLAGS="$ac_save_CXXFLAGS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -53844,8 +53479,117 @@ fi BACKTRACE_CPPFLAGS="-D_GNU_SOURCE" - # libbacktrace only needs atomics for int, which we've already tested - if test "$glibcxx_cv_atomic_int" = "yes"; then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + old_CXXFLAGS="$CXXFLAGS" + + # libbacktrace's own configure.ac only tests atomics for int, + # but the code actually uses atomics for size_t and pointers as well. + if test "$atomic_builtins_link_tests" = yes; then + + CXXFLAGS='-O0' + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for atomic builtins for libbacktrace" >&5 +$as_echo_n "checking for atomic builtins for libbacktrace... " >&6; } +if ${glibcxx_cv_libbacktrace_atomics+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test x$gcc_no_link = xyes; then + as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5 +fi +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + int i = 0; + int* p = &i; + __SIZE_TYPE__ s = 0; + // backtrace_atomic_load_pointer + void* vp = __atomic_load_n(&p, __ATOMIC_ACQUIRE); + // backtrace_atomic_load_int + int i2 = __atomic_load_n(&i, __ATOMIC_ACQUIRE); + // backtrace_atomic_store_pointer + __atomic_store_n(&p, &i, __ATOMIC_RELEASE); + // backtrace_atomic_store_size_t + __atomic_store_n(&s, s, __ATOMIC_RELEASE); + // backtrace_atomic_store_int + __atomic_store_n(&i, i, __ATOMIC_RELEASE); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + glibcxx_cv_libbacktrace_atomics=yes +else + glibcxx_cv_libbacktrace_atomics=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_libbacktrace_atomics" >&5 +$as_echo "$glibcxx_cv_libbacktrace_atomics" >&6; } + + else + # Do asm tests. + + CXXFLAGS='-O0 -S' + + cat > conftest.$ac_ext << EOF +#line 53546 "configure" +#include <stddef.h> +int main() +{ + int i = 0; + int* p = &i; + __SIZE_TYPE__ s = 0; + // backtrace_atomic_load_pointer + void* vp = __atomic_load_n(&p, __ATOMIC_ACQUIRE); + // backtrace_atomic_load_int + int i2 = __atomic_load_n(&i, __ATOMIC_ACQUIRE); + // backtrace_atomic_store_pointer + __atomic_store_n(&p, &i, __ATOMIC_RELEASE); + // backtrace_atomic_store_size_t + __atomic_store_n(&s, s, __ATOMIC_RELEASE); + // backtrace_atomic_store_int + __atomic_store_n(&i, i, __ATOMIC_RELEASE); +} +EOF + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for atomic builtins for libbacktrace" >&5 +$as_echo_n "checking for atomic builtins for libbacktrace... " >&6; } + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if grep __atomic_ conftest.s >/dev/null 2>&1 ; then + glibcxx_cv_libbacktrace_atomics=no + else + glibcxx_cv_libbacktrace_atomics=yes + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_libbacktrace_atomics" >&5 +$as_echo "$glibcxx_cv_libbacktrace_atomics" >&6; } + rm -f conftest* + fi + + CXXFLAGS="$old_CXXFLAGS" + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + if test "$glibcxx_cv_libbacktrace_atomics" = yes; then BACKTRACE_CPPFLAGS="$BACKTRACE_CPPFLAGS -DHAVE_ATOMIC_FUNCTIONS=1" fi @@ -54482,6 +54226,65 @@ _ACEOF fi +# For std::chrono formatters to use tm::tm_zone + + + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + ac_save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS -std=c++20" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tm_zone member of struct tm" >&5 +$as_echo_n "checking for tm_zone member of struct tm... " >&6; } +if ${glibcxx_cv_tm_zone+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <time.h> + +int +main () +{ +struct tm t{}; t.tm_zone = (char*)0; + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + glibcxx_cv_tm_zone=yes +else + glibcxx_cv_tm_zone=no + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_tm_zone" >&5 +$as_echo "$glibcxx_cv_tm_zone" >&6; } + + if test $glibcxx_cv_tm_zone = yes; then + +$as_echo "#define _GLIBCXX_USE_STRUCT_TM_TM_ZONE 1" >>confdefs.h + + fi + + CXXFLAGS="$ac_save_CXXFLAGS" + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + # For src/c++11/shared_ptr.cc alignment. @@ -54697,112 +54500,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 -$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } -if ${ac_cv_struct_tm+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <sys/types.h> -#include <time.h> - -int -main () -{ -struct tm tm; - int *p = &tm.tm_sec; - return !p; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_struct_tm=time.h -else - ac_cv_struct_tm=sys/time.h -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 -$as_echo "$ac_cv_struct_tm" >&6; } -if test $ac_cv_struct_tm = sys/time.h; then - -$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h - -fi - -ac_fn_c_check_member "$LINENO" "struct tm" "tm_zone" "ac_cv_member_struct_tm_tm_zone" "#include <sys/types.h> -#include <$ac_cv_struct_tm> - -" -if test "x$ac_cv_member_struct_tm_tm_zone" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_TM_TM_ZONE 1 -_ACEOF - - -fi - -if test "$ac_cv_member_struct_tm_tm_zone" = yes; then - -$as_echo "#define HAVE_TM_ZONE 1" >>confdefs.h - -else - ac_fn_c_check_decl "$LINENO" "tzname" "ac_cv_have_decl_tzname" "#include <time.h> -" -if test "x$ac_cv_have_decl_tzname" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_TZNAME $ac_have_decl -_ACEOF - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5 -$as_echo_n "checking for tzname... " >&6; } -if ${ac_cv_var_tzname+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test x$gcc_no_link = xyes; then - as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5 -fi -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <time.h> -#if !HAVE_DECL_TZNAME -extern char *tzname[]; -#endif - -int -main () -{ -return tzname[0][0]; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_var_tzname=yes -else - ac_cv_var_tzname=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_var_tzname" >&5 -$as_echo "$ac_cv_var_tzname" >&6; } - if test $ac_cv_var_tzname = yes; then - -$as_echo "#define HAVE_TZNAME 1" >>confdefs.h - - fi -fi - - # Define documentation rules conditionally. # See if makeinfo has been installed and is modern enough |