Autoconf documents AC_LANG_SAVE, AC_LANG_CPLUSPLUS etc. as deprecated. libstdc++-v3/ChangeLog:
* acinclude.m4 (GLIBCXX_LANG_PUSH, GLIBCXX_LANG_POP): New macros to replace uses of AC_LANG_SAVE, AC_LANG_CPLUSPLUS, and AC_LANG_RESTORE. * configure: Regenerate. --- Tomasz pointed out that we're using deprecated macros. This would replace them with the modern Autoconf macros, but I'm not sure it's really an improvement, or necessary. Should we bother? Tested x86_64-linux. libstdc++-v3/acinclude.m4 | 290 +++++++++++++---------------------- libstdc++-v3/configure | 307 ++++++++++++++++++++++++++++++-------- 2 files changed, 349 insertions(+), 248 deletions(-) diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index a0094c2dd95..86f974feb6f 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -118,6 +118,27 @@ AC_DEFUN([GLIBCXX_CONFIGURE], [ GLIBCXX_CHECK_HOST ]) +dnl +dnl Sets the current language for compilation tests to C++ and saves the +dnl current values of CXXFLAGS and LIBS so they can be restored afterwards. +dnl This should be paired with GLIBCXX_LANG_POP. +dnl +AC_DEFUN([GLIBCXX_LANG_PUSH],[ + AC_LANG_PUSH(C++) + ac_save_CXXFLAGS="$CXXFLAGS" + ac_save_LIBS="$LIBS" +]) + +dnl +dnl Restores the current language for compilation tests to the previous value +dnl and restores the previous values of CXXFLAGS and LIBS. +dnl This should be paired with GLIBCXX_LANG_PUSH. +dnl +AC_DEFUN([GLIBCXX_LANG_POP],[ + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" + AC_LANG_POP(C++) +]) dnl dnl Tests for newer compiler features, or features that are present in newer @@ -135,27 +156,18 @@ AC_DEFUN([GLIBCXX_CHECK_COMPILER_FEATURES], [ # All these tests are for C++; save the language and the compiler flags. # The CXXFLAGS thing is suspicious, but based on similar bits previously # found in GLIBCXX_CONFIGURE. - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - ac_test_CXXFLAGS="${CXXFLAGS+set}" - ac_save_CXXFLAGS="$CXXFLAGS" + GLIBCXX_LANG_PUSH # Check for -ffunction-sections -fdata-sections AC_MSG_CHECKING([for g++ that supports -ffunction-sections -fdata-sections]) CXXFLAGS='-g -Werror -ffunction-sections -fdata-sections' AC_TRY_COMPILE([int foo; void bar() { };],, [ac_fdsections=yes], [ac_fdsections=no]) - if test "$ac_test_CXXFLAGS" = set; then - CXXFLAGS="$ac_save_CXXFLAGS" - else - # this is the suspicious part - CXXFLAGS='' - fi if test x"$ac_fdsections" = x"yes"; then SECTION_FLAGS='-ffunction-sections -fdata-sections' fi AC_MSG_RESULT($ac_fdsections) - AC_LANG_RESTORE + GLIBCXX_LANG_POP AC_SUBST(SECTION_FLAGS) ]) @@ -329,8 +341,7 @@ AC_DEFUN([GLIBCXX_CHECK_SETRLIMIT_ancilliary], [ ]) AC_DEFUN([GLIBCXX_CHECK_SETRLIMIT], [ - AC_LANG_SAVE - AC_LANG_CPLUSPLUS + GLIBCXX_LANG_PUSH setrlimit_have_headers=yes AC_CHECK_HEADERS(unistd.h sys/time.h sys/resource.h, [], @@ -364,7 +375,7 @@ AC_DEFUN([GLIBCXX_CHECK_SETRLIMIT], [ "make check"]) fi fi - AC_LANG_RESTORE + GLIBCXX_LANG_POP ]) @@ -374,9 +385,7 @@ dnl Define HAVE_S_ISREG / HAVE_S_IFREG appropriately. dnl AC_DEFUN([GLIBCXX_CHECK_S_ISREG_OR_S_IFREG], [ - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - ac_save_CXXFLAGS="$CXXFLAGS" + GLIBCXX_LANG_PUSH CXXFLAGS="$CXXFLAGS -fno-exceptions" AC_MSG_CHECKING([for S_ISREG or S_IFREG]) @@ -410,8 +419,7 @@ AC_DEFUN([GLIBCXX_CHECK_S_ISREG_OR_S_IFREG], [ fi AC_MSG_RESULT($res) - CXXFLAGS="$ac_save_CXXFLAGS" - AC_LANG_RESTORE + GLIBCXX_LANG_POP ]) @@ -420,9 +428,7 @@ dnl Check whether poll is available in <poll.h>, and define HAVE_POLL. dnl AC_DEFUN([GLIBCXX_CHECK_POLL], [ - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - ac_save_CXXFLAGS="$CXXFLAGS" + GLIBCXX_LANG_PUSH CXXFLAGS="$CXXFLAGS -fno-exceptions" AC_CACHE_CHECK([for poll], glibcxx_cv_POLL, [ @@ -438,8 +444,7 @@ AC_DEFUN([GLIBCXX_CHECK_POLL], [ AC_DEFINE(HAVE_POLL, 1, [Define if poll is available in <poll.h>.]) fi - CXXFLAGS="$ac_save_CXXFLAGS" - AC_LANG_RESTORE + GLIBCXX_LANG_POP ]) @@ -448,9 +453,7 @@ dnl Check whether writev is available in <sys/uio.h>, and define HAVE_WRITEV. dnl AC_DEFUN([GLIBCXX_CHECK_WRITEV], [ - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - ac_save_CXXFLAGS="$CXXFLAGS" + GLIBCXX_LANG_PUSH CXXFLAGS="$CXXFLAGS -fno-exceptions" AC_CACHE_CHECK([for writev], glibcxx_cv_WRITEV, [ @@ -465,8 +468,7 @@ AC_DEFUN([GLIBCXX_CHECK_WRITEV], [ AC_DEFINE(HAVE_WRITEV, 1, [Define if writev is available in <sys/uio.h>.]) fi - CXXFLAGS="$ac_save_CXXFLAGS" - AC_LANG_RESTORE + GLIBCXX_LANG_POP ]) @@ -474,9 +476,7 @@ dnl dnl Check whether LFS support is available. dnl AC_DEFUN([GLIBCXX_CHECK_LFS], [ - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - ac_save_CXXFLAGS="$CXXFLAGS" + GLIBCXX_LANG_PUSH CXXFLAGS="$CXXFLAGS -fno-exceptions" AC_CACHE_CHECK([for LFS support], glibcxx_cv_LFS, [ GCC_TRY_COMPILE_OR_LINK( @@ -513,8 +513,7 @@ AC_DEFUN([GLIBCXX_CHECK_LFS], [ AC_DEFINE(_GLIBCXX_USE_FSEEKO_FTELLO, 1, [Define if fseeko and ftello are available.]) fi - CXXFLAGS="$ac_save_CXXFLAGS" - AC_LANG_RESTORE + GLIBCXX_LANG_POP ]) @@ -866,15 +865,12 @@ AC_DEFUN([GLIBCXX_ENABLE_C99], [ GLIBCXX_ENABLE(c99,$1,,[turns on ISO/IEC 9899:1999 support]) if test x"$enable_c99" = x"yes"; then - AC_LANG_SAVE - AC_LANG_CPLUSPLUS + GLIBCXX_LANG_PUSH # Use -std=c++98 (instead of -std=gnu++98) because leaving __STRICT_ANSI__ # undefined may cause fake C99 facilities, like pre-standard snprintf, # to be spuriously enabled. - ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS -std=c++98" - ac_save_LIBS="$LIBS" ac_save_gcc_no_link="$gcc_no_link" if test x$gcc_no_link != xyes; then @@ -1095,18 +1091,13 @@ AC_DEFUN([GLIBCXX_ENABLE_C99], [ fi gcc_no_link="$ac_save_gcc_no_link" - LIBS="$ac_save_LIBS" - CXXFLAGS="$ac_save_CXXFLAGS" - AC_LANG_RESTORE + GLIBCXX_LANG_POP - AC_LANG_SAVE - AC_LANG_CPLUSPLUS + GLIBCXX_LANG_PUSH # Use -std=c++11 and test again for C99 library feature in C++11 mode. # For the reasons given above we use -std=c++11 not -std=gnu++11. - ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS -std=c++11" - ac_save_LIBS="$LIBS" ac_save_gcc_no_link="$gcc_no_link" if test x$gcc_no_link != xyes; then @@ -1709,9 +1700,7 @@ AC_DEFUN([GLIBCXX_ENABLE_C99], [ fi gcc_no_link="$ac_save_gcc_no_link" - LIBS="$ac_save_LIBS" - CXXFLAGS="$ac_save_CXXFLAGS" - AC_LANG_RESTORE + GLIBCXX_LANG_POP fi AC_MSG_CHECKING([for fully enabled ISO C99 support]) @@ -1749,11 +1738,8 @@ AC_DEFUN([GLIBCXX_ENABLE_LIBSTDCXX_TIME], [ [use KIND for check type], [permit yes|no|rt]) - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - ac_save_CXXFLAGS="$CXXFLAGS" + GLIBCXX_LANG_PUSH CXXFLAGS="$CXXFLAGS -fno-exceptions" - ac_save_LIBS="$LIBS" ac_has_clock_monotonic=no ac_has_clock_realtime=no @@ -1984,9 +1970,7 @@ AC_DEFUN([GLIBCXX_ENABLE_LIBSTDCXX_TIME], [ AC_SUBST(GLIBCXX_LIBS) - CXXFLAGS="$ac_save_CXXFLAGS" - LIBS="$ac_save_LIBS" - AC_LANG_RESTORE + GLIBCXX_LANG_POP ]) dnl @@ -1997,9 +1981,7 @@ AC_DEFUN([GLIBCXX_CHECK_GETTIMEOFDAY], [ AC_MSG_CHECKING([for gettimeofday]) - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - ac_save_CXXFLAGS="$CXXFLAGS" + GLIBCXX_LANG_PUSH CXXFLAGS="$CXXFLAGS -fno-exceptions" ac_has_gettimeofday=no; @@ -2018,8 +2000,7 @@ AC_DEFUN([GLIBCXX_CHECK_GETTIMEOFDAY], [ [ Defined if gettimeofday is available. ]) fi - CXXFLAGS="$ac_save_CXXFLAGS" - AC_LANG_RESTORE + GLIBCXX_LANG_POP ]) dnl @@ -2028,12 +2009,10 @@ dnl facilities in Chapter 8, "C compatibility". dnl AC_DEFUN([GLIBCXX_CHECK_C99_TR1], [ - AC_LANG_SAVE - AC_LANG_CPLUSPLUS + GLIBCXX_LANG_PUSH # Use -std=c++98 because -std=gnu++98 leaves __STRICT_ANSI__ # undefined and fake C99 facilities may be spuriously enabled. - ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS -std=c++98" # Check for the existence of <complex.h> complex math functions used @@ -2389,8 +2368,7 @@ AC_DEFUN([GLIBCXX_CHECK_C99_TR1], [ # Check for the existence of the <stdalign.h> header. AC_CHECK_HEADERS(stdalign.h) - CXXFLAGS="$ac_save_CXXFLAGS" - AC_LANG_RESTORE + GLIBCXX_LANG_POP ]) dnl @@ -2401,9 +2379,7 @@ AC_DEFUN([GLIBCXX_CHECK_UCHAR_H], [ # Test uchar.h. AC_CHECK_HEADERS(uchar.h, ac_has_uchar_h=yes, ac_has_uchar_h=no) - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - ac_save_CXXFLAGS="$CXXFLAGS" + GLIBCXX_LANG_PUSH CXXFLAGS="$CXXFLAGS -std=c++11" if test x"$ac_has_uchar_h" = x"yes"; then @@ -2478,8 +2454,7 @@ AC_DEFUN([GLIBCXX_CHECK_UCHAR_H], [ imported into namespace std in <cuchar> for C++20.]) fi - CXXFLAGS="$ac_save_CXXFLAGS" - AC_LANG_RESTORE + GLIBCXX_LANG_POP ]) @@ -2552,11 +2527,9 @@ dnl Check whether required C++ overloads are present in <stdio.h>. dnl AC_DEFUN([GLIBCXX_CHECK_STDIO_PROTO], [ - AC_LANG_SAVE - AC_LANG_CPLUSPLUS + GLIBCXX_LANG_PUSH # Use C++11 because a conforming <stdio.h> won't define gets for C++14, # and we don't need a declaration for C++14 anyway. - ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS -std=gnu++11" AC_CACHE_CHECK([for gets declaration], glibcxx_cv_gets, [ @@ -2575,8 +2548,7 @@ AC_DEFUN([GLIBCXX_CHECK_STDIO_PROTO], [ AC_DEFINE(HAVE_GETS, 1, [Define if gets is available in <stdio.h> before C++14.]) fi - CXXFLAGS="$ac_save_CXXFLAGS" - AC_LANG_RESTORE + GLIBCXX_LANG_POP ]) dnl @@ -2585,9 +2557,7 @@ dnl types are present in <math.h>. dnl AC_DEFUN([GLIBCXX_CHECK_MATH11_PROTO], [ - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - ac_save_CXXFLAGS="$CXXFLAGS" + GLIBCXX_LANG_PUSH CXXFLAGS="$CXXFLAGS -std=c++11" case "$host" in @@ -2721,8 +2691,7 @@ AC_DEFUN([GLIBCXX_CHECK_MATH11_PROTO], [ ;; esac - CXXFLAGS="$ac_save_CXXFLAGS" - AC_LANG_RESTORE + GLIBCXX_LANG_POP ]) dnl @@ -3507,8 +3476,7 @@ dnl ENABLE_FLOAT128 dnl AC_DEFUN([GLIBCXX_ENABLE_FLOAT128], [ - AC_LANG_SAVE - AC_LANG_CPLUSPLUS + GLIBCXX_LANG_PUSH # Fake what AC_TRY_COMPILE does, without linking as this is # unnecessary for this test. @@ -3539,7 +3507,7 @@ EOF GLIBCXX_CONDITIONAL(ENABLE_FLOAT128, test $enable_float128 = yes) rm -f conftest* - AC_LANG_RESTORE + GLIBCXX_LANG_POP ]) dnl @@ -3572,8 +3540,7 @@ AC_DEFUN([GLIBCXX_ENABLE_WCHAR_T], [ if test x"$enable_wchar_t" = x"yes"; then - AC_LANG_SAVE - AC_LANG_CPLUSPLUS + GLIBCXX_LANG_PUSH if test x"$ac_has_wchar_h" = xyes && test x"$ac_has_wctype_h" = xyes; then @@ -3643,7 +3610,7 @@ AC_DEFUN([GLIBCXX_ENABLE_WCHAR_T], [ enable_wchar_t=no fi - AC_LANG_RESTORE + GLIBCXX_LANG_POP fi if test x"$enable_wchar_t" = x"yes"; then @@ -3675,10 +3642,8 @@ AC_DEFUN([GLIBCXX_ENABLE_PCH], [ if test $enable_libstdcxx_pch = yes; then AC_CACHE_CHECK([for compiler with PCH support], [glibcxx_cv_prog_CXX_pch], - [ac_save_CXXFLAGS="$CXXFLAGS" + [GLIBCXX_LANG_PUSH CXXFLAGS="$CXXFLAGS -Werror -Winvalid-pch -Wno-deprecated" - AC_LANG_SAVE - AC_LANG_CPLUSPLUS echo '#include <math.h>' > conftest.h if $CXX $CXXFLAGS $CPPFLAGS -x c++-header conftest.h \ -o conftest.h.gch 1>&5 2>&1 && @@ -3691,8 +3656,7 @@ AC_DEFUN([GLIBCXX_ENABLE_PCH], [ glibcxx_cv_prog_CXX_pch=no fi rm -f conftest* - CXXFLAGS=$ac_save_CXXFLAGS - AC_LANG_RESTORE + GLIBCXX_LANG_POP ]) enable_libstdcxx_pch=$glibcxx_cv_prog_CXX_pch fi @@ -3724,9 +3688,9 @@ dnl Note: dnl libgomp and libgfortran use a link test, see CHECK_SYNC_FETCH_AND_ADD. dnl AC_DEFUN([GLIBCXX_ENABLE_ATOMIC_BUILTINS], [ - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - old_CXXFLAGS="$CXXFLAGS" + GLIBCXX_LANG_PUSH + # Compile unoptimized. + CXXFLAGS='-O0' # Do link tests if possible, instead asm tests, limited to some platforms # see discussion in PR target/40134, PR libstdc++/40133 and the thread @@ -3947,8 +3911,7 @@ EOF fi - CXXFLAGS="$old_CXXFLAGS" - AC_LANG_RESTORE + GLIBCXX_LANG_POP # Set atomicity_dir to builtins if all but the long long test above passes, # or if the builtins were already chosen (e.g. by configure.host). @@ -4015,9 +3978,7 @@ AC_DEFUN([GLIBCXX_ENABLE_LOCK_POLICY], [ AC_MSG_CHECKING([for lock policy for shared_ptr reference counts]) if test x"$libstdcxx_atomic_lock_policy" = x"auto"; then - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - ac_save_CXXFLAGS="$CXXFLAGS" + GLIBCXX_LANG_PUSH dnl Why do we care about 2-byte CAS on targets with 4-byte _Atomic_word?! dnl Why don't we check 8-byte CAS for sparc64, where _Atomic_word is long?! @@ -4035,8 +3996,7 @@ AC_DEFUN([GLIBCXX_ENABLE_LOCK_POLICY], [ ],, [libstdcxx_atomic_lock_policy=atomic], [libstdcxx_atomic_lock_policy=mutex]) - AC_LANG_RESTORE - CXXFLAGS="$ac_save_CXXFLAGS" + GLIBCXX_LANG_POP fi if test x"$libstdcxx_atomic_lock_policy" = x"atomic"; then @@ -4365,10 +4325,8 @@ AC_DEFUN([GLIBCXX_CHECK_GTHREADS], [ if test x$enable_libstdcxx_threads = xauto || test x$enable_libstdcxx_threads = xyes; then - AC_LANG_SAVE - AC_LANG_CPLUSPLUS + GLIBCXX_LANG_PUSH - ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS -fno-exceptions \ -I${toplevel_srcdir}/libgcc -I${toplevel_builddir}/libgcc" @@ -4488,8 +4446,7 @@ AC_DEFUN([GLIBCXX_CHECK_GTHREADS], [ fi AC_MSG_RESULT([$ac_have_posix_semaphore]) - CXXFLAGS="$ac_save_CXXFLAGS" - AC_LANG_RESTORE + GLIBCXX_LANG_POP ]) @@ -4555,9 +4512,7 @@ dnl Check whether get_nprocs is available in <sys/sysinfo.h>, and define _GLIBCX dnl AC_DEFUN([GLIBCXX_CHECK_GET_NPROCS], [ - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - ac_save_CXXFLAGS="$CXXFLAGS" + GLIBCXX_LANG_PUSH CXXFLAGS="$CXXFLAGS -fno-exceptions" AC_CACHE_CHECK([for get_nprocs], @@ -4572,8 +4527,7 @@ AC_DEFUN([GLIBCXX_CHECK_GET_NPROCS], [ AC_DEFINE(_GLIBCXX_USE_GET_NPROCS, 1, [Define if get_nprocs is available in <sys/sysinfo.h>.]) fi - CXXFLAGS="$ac_save_CXXFLAGS" - AC_LANG_RESTORE + GLIBCXX_LANG_POP ]) dnl @@ -4581,9 +4535,7 @@ dnl Check whether sysconf(_SC_NPROCESSORS_ONLN) is available in <unistd.h>, and dnl AC_DEFUN([GLIBCXX_CHECK_SC_NPROCESSORS_ONLN], [ - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - ac_save_CXXFLAGS="$CXXFLAGS" + GLIBCXX_LANG_PUSH CXXFLAGS="$CXXFLAGS -fno-exceptions" AC_CACHE_CHECK([for _SC_NPROCESSORS_ONLN], @@ -4598,8 +4550,7 @@ AC_DEFUN([GLIBCXX_CHECK_SC_NPROCESSORS_ONLN], [ AC_DEFINE(_GLIBCXX_USE_SC_NPROCESSORS_ONLN, 1, [Define if _SC_NPROCESSORS_ONLN is available in <unistd.h>.]) fi - CXXFLAGS="$ac_save_CXXFLAGS" - AC_LANG_RESTORE + GLIBCXX_LANG_POP ]) dnl @@ -4607,9 +4558,7 @@ dnl Check whether sysconf(_SC_NPROC_ONLN) is available in <unistd.h>, and define dnl AC_DEFUN([GLIBCXX_CHECK_SC_NPROC_ONLN], [ - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - ac_save_CXXFLAGS="$CXXFLAGS" + GLIBCXX_LANG_PUSH CXXFLAGS="$CXXFLAGS -fno-exceptions" AC_CACHE_CHECK([for _SC_NPROC_ONLN], @@ -4624,8 +4573,7 @@ AC_DEFUN([GLIBCXX_CHECK_SC_NPROC_ONLN], [ AC_DEFINE(_GLIBCXX_USE_SC_NPROC_ONLN, 1, [Define if _SC_NPROC_ONLN is available in <unistd.h>.]) fi - CXXFLAGS="$ac_save_CXXFLAGS" - AC_LANG_RESTORE + GLIBCXX_LANG_POP ]) dnl @@ -4633,9 +4581,7 @@ dnl Check whether pthread_num_processors_np is available in <pthread.h>, and def dnl AC_DEFUN([GLIBCXX_CHECK_PTHREADS_NUM_PROCESSORS_NP], [ - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - ac_save_CXXFLAGS="$CXXFLAGS" + GLIBCXX_LANG_PUSH CXXFLAGS="$CXXFLAGS -fno-exceptions" AC_CACHE_CHECK([for pthreads_num_processors_np], @@ -4650,8 +4596,7 @@ AC_DEFUN([GLIBCXX_CHECK_PTHREADS_NUM_PROCESSORS_NP], [ AC_DEFINE(_GLIBCXX_USE_PTHREADS_NUM_PROCESSORS_NP, 1, [Define if pthreads_num_processors_np is available in <pthread.h>.]) fi - CXXFLAGS="$ac_save_CXXFLAGS" - AC_LANG_RESTORE + GLIBCXX_LANG_POP ]) dnl @@ -4660,11 +4605,8 @@ dnl and define _GLIBCXX_USE_PTHREAD_COND_CLOCKWAIT. dnl AC_DEFUN([GLIBCXX_CHECK_PTHREAD_COND_CLOCKWAIT], [ - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - ac_save_CXXFLAGS="$CXXFLAGS" + GLIBCXX_LANG_PUSH CXXFLAGS="$CXXFLAGS -fno-exceptions" - ac_save_LIBS="$LIBS" LIBS="$LIBS -lpthread" AC_CACHE_CHECK([for pthread_cond_clockwait], @@ -4679,9 +4621,7 @@ AC_DEFUN([GLIBCXX_CHECK_PTHREAD_COND_CLOCKWAIT], [ AC_DEFINE(_GLIBCXX_USE_PTHREAD_COND_CLOCKWAIT, 1, [Define if pthread_cond_clockwait is available in <pthread.h>.]) fi - CXXFLAGS="$ac_save_CXXFLAGS" - LIBS="$ac_save_LIBS" - AC_LANG_RESTORE + GLIBCXX_LANG_POP ]) dnl @@ -4690,11 +4630,8 @@ dnl and define _GLIBCXX_USE_PTHREAD_MUTEX_CLOCKLOCK. dnl AC_DEFUN([GLIBCXX_CHECK_PTHREAD_MUTEX_CLOCKLOCK], [ - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - ac_save_CXXFLAGS="$CXXFLAGS" + GLIBCXX_LANG_PUSH CXXFLAGS="$CXXFLAGS -fno-exceptions" - ac_save_LIBS="$LIBS" LIBS="$LIBS -lpthread" AC_CACHE_CHECK([for pthread_mutex_clocklock], @@ -4709,9 +4646,7 @@ AC_DEFUN([GLIBCXX_CHECK_PTHREAD_MUTEX_CLOCKLOCK], [ AC_DEFINE(_GLIBCXX_USE_PTHREAD_MUTEX_CLOCKLOCK, (_GLIBCXX_TSAN==0), [Define if pthread_mutex_clocklock is available in <pthread.h>.]) fi - CXXFLAGS="$ac_save_CXXFLAGS" - LIBS="$ac_save_LIBS" - AC_LANG_RESTORE + GLIBCXX_LANG_POP ]) dnl @@ -4720,11 +4655,8 @@ dnl and define _GLIBCXX_USE_PTHREAD_MUTEX_CLOCKLOCK. dnl AC_DEFUN([GLIBCXX_CHECK_PTHREAD_RWLOCK_CLOCKLOCK], [ - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - ac_save_CXXFLAGS="$CXXFLAGS" + GLIBCXX_LANG_PUSH CXXFLAGS="$CXXFLAGS -fno-exceptions" - ac_save_LIBS="$LIBS" LIBS="$LIBS -lpthread" AC_CACHE_CHECK([for pthread_rwlock_clockrdlock, pthread_wlock_clockwrlock], @@ -4741,9 +4673,7 @@ AC_DEFUN([GLIBCXX_CHECK_PTHREAD_RWLOCK_CLOCKLOCK], [ AC_DEFINE(_GLIBCXX_USE_PTHREAD_RWLOCK_CLOCKLOCK, 1, [Define if pthread_rwlock_clockrdlock and pthread_rwlock_clockwrlock are available in <pthread.h>.]) fi - CXXFLAGS="$ac_save_CXXFLAGS" - LIBS="$ac_save_LIBS" - AC_LANG_RESTORE + GLIBCXX_LANG_POP ]) dnl @@ -4751,9 +4681,7 @@ dnl Check whether sysctl is available in <pthread.h>, and define _GLIBCXX_USE_SY dnl AC_DEFUN([GLIBCXX_CHECK_SYSCTL_HW_NCPU], [ - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - ac_save_CXXFLAGS="$CXXFLAGS" + GLIBCXX_LANG_PUSH CXXFLAGS="$CXXFLAGS -fno-exceptions" AC_CACHE_CHECK([for hw.ncpu sysctl], @@ -4776,8 +4704,7 @@ AC_DEFUN([GLIBCXX_CHECK_SYSCTL_HW_NCPU], [ AC_DEFINE(_GLIBCXX_USE_SYSCTL_HW_NCPU, 1, [Define if sysctl(), CTL_HW and HW_NCPU are available in <sys/sysctl.h>.]) fi - CXXFLAGS="$ac_save_CXXFLAGS" - AC_LANG_RESTORE + GLIBCXX_LANG_POP ]) dnl @@ -4817,9 +4744,7 @@ dnl and define _GLIBCXX_USE_TMPNAM. dnl AC_DEFUN([GLIBCXX_CHECK_TMPNAM], [dnl dnl - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - ac_save_CXXFLAGS="$CXXFLAGS" + GLIBCXX_LANG_PUSH CXXFLAGS="$CXXFLAGS -fno-exceptions" dnl AC_CACHE_CHECK([for tmpnam], glibcxx_cv_TMPNAM, [dnl @@ -4833,8 +4758,7 @@ dnl AC_DEFINE(_GLIBCXX_USE_TMPNAM, 1, [Define if obsolescent tmpnam is available in <stdio.h>.]) fi dnl - CXXFLAGS="$ac_save_CXXFLAGS" - AC_LANG_RESTORE + GLIBCXX_LANG_POP ]) dnl @@ -4845,8 +4769,7 @@ AC_DEFUN([GLIBCXX_CHECK_SDT_H], [ # Note that this test has to be run with the C language. # Otherwise, sdt.h will try to include some headers from # libstdc++ itself. - AC_LANG_SAVE - AC_LANG_C + AC_LANG_PUSH(C) AC_CACHE_CHECK([for suitable sys/sdt.h], glibcxx_cv_sys_sdt_h, [ # Because we have to run the test in C, we use grep rather @@ -4859,7 +4782,7 @@ AC_DEFUN([GLIBCXX_CHECK_SDT_H], [ int f() { STAP_PROBE(hi, bob); } ], [glibcxx_cv_sys_sdt_h=yes], [glibcxx_cv_sys_sdt_h=no]) ]) - AC_LANG_RESTORE + AC_LANG_POP(C) if test $glibcxx_cv_sys_sdt_h = yes; then AC_DEFINE(HAVE_SYS_SDT_H, 1, [Define to 1 if you have a suitable <sys/sdt.h> header file]) @@ -4982,9 +4905,7 @@ dnl HAVE_SYMLINK dnl AC_DEFUN([GLIBCXX_CHECK_FILESYSTEM_DEPS], [dnl dnl - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - ac_save_CXXFLAGS="$CXXFLAGS" + GLIBCXX_LANG_PUSH CXXFLAGS="$CXXFLAGS -fno-exceptions" dnl AC_CACHE_CHECK([for struct dirent.d_type], glibcxx_cv_dirent_d_type, [dnl @@ -5320,8 +5241,7 @@ dnl AC_DEFINE(HAVE_UNLINKAT, 1, [Define if unlinkat is available in <fcntl.h>.]) fi dnl - CXXFLAGS="$ac_save_CXXFLAGS" - AC_LANG_RESTORE + GLIBCXX_LANG_POP ]) dnl @@ -5398,8 +5318,7 @@ dnl Check whether getentropy is present in <unistd.h>. dnl AC_DEFUN([GLIBCXX_CHECK_GETENTROPY], [ - AC_LANG_SAVE - AC_LANG_CPLUSPLUS + GLIBCXX_LANG_PUSH AC_CACHE_CHECK([for getentropy], glibcxx_cv_getentropy, [ GCC_TRY_COMPILE_OR_LINK( [#include <unistd.h>], @@ -5411,7 +5330,7 @@ AC_DEFUN([GLIBCXX_CHECK_GETENTROPY], [ if test $glibcxx_cv_getentropy = yes; then AC_DEFINE(HAVE_GETENTROPY, 1, [Define if getentropy is available in <unistd.h>.]) fi - AC_LANG_RESTORE + GLIBCXX_LANG_POP ]) dnl @@ -5419,8 +5338,7 @@ dnl Check whether arc4random is present in <stdlib.h>. dnl AC_DEFUN([GLIBCXX_CHECK_ARC4RANDOM], [ - AC_LANG_SAVE - AC_LANG_CPLUSPLUS + GLIBCXX_LANG_PUSH AC_CACHE_CHECK([for arc4random], glibcxx_cv_arc4random, [ GCC_TRY_COMPILE_OR_LINK( [#include <stdlib.h>], @@ -5431,7 +5349,7 @@ AC_DEFUN([GLIBCXX_CHECK_ARC4RANDOM], [ if test $glibcxx_cv_arc4random = yes; then AC_DEFINE(HAVE_ARC4RANDOM, 1, [Define if arc4random is available in <stdlib.h>.]) fi - AC_LANG_RESTORE + GLIBCXX_LANG_POP ]) dnl @@ -5756,9 +5674,7 @@ dnl _GLIBCXX_USE_STRUCT_TM_TM_ZONE if struct tm has a tm_zone member. dnl AC_DEFUN([GLIBCXX_STRUCT_TM_TM_ZONE], [ - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - ac_save_CXXFLAGS="$CXXFLAGS" + GLIBCXX_LANG_PUSH CXXFLAGS="$CXXFLAGS -std=c++20" AC_CACHE_CHECK([for tm_zone member of struct tm], glibcxx_cv_tm_zone, [ @@ -5776,8 +5692,7 @@ AC_DEFUN([GLIBCXX_STRUCT_TM_TM_ZONE], [ [Define if struct tm has a tm_zone member.]) fi - CXXFLAGS="$ac_save_CXXFLAGS" - AC_LANG_RESTORE + GLIBCXX_LANG_POP ]) dnl @@ -5788,8 +5703,7 @@ dnl _GLIBCXX_CAN_ALIGNAS_DESTRUCTIVE_SIZE if objects with static storage dnl duration can be aligned to std::hardware_destructive_interference_size. dnl AC_DEFUN([GLIBCXX_CHECK_ALIGNAS_CACHELINE], [ - AC_LANG_SAVE - AC_LANG_CPLUSPLUS + GLIBCXX_LANG_PUSH AC_MSG_CHECKING([whether static objects can be aligned to the cacheline size]) AC_TRY_COMPILE(, [struct alignas(__GCC_DESTRUCTIVE_SIZE) Aligned { }; @@ -5802,7 +5716,7 @@ AC_DEFUN([GLIBCXX_CHECK_ALIGNAS_CACHELINE], [ fi AC_MSG_RESULT($ac_alignas_cacheline) - AC_LANG_RESTORE + GLIBCXX_LANG_POP ]) dnl @@ -5814,8 +5728,8 @@ dnl _GLIBCXX_USE_INIT_PRIORITY_ATTRIBUTE if GCC supports the init_priority dnl attribute for the target. dnl AC_DEFUN([GLIBCXX_CHECK_INIT_PRIORITY], [ -AC_LANG_SAVE - AC_LANG_CPLUSPLUS + + GLIBCXX_LANG_PUSH AC_MSG_CHECKING([whether init_priority attribute is supported]) AC_TRY_COMPILE(, [ @@ -5829,7 +5743,7 @@ AC_LANG_SAVE fi AC_MSG_RESULT($ac_init_priority) - AC_LANG_RESTORE + GLIBCXX_LANG_POP ]) dnl @@ -5839,8 +5753,8 @@ dnl Defines: dnl _GLIBCXX_USE__GET_OSFHANDLE if _get_osfhandle is in <io.h> for Windows. dnl AC_DEFUN([GLIBCXX_CHECK_FILEBUF_NATIVE_HANDLES], [ -AC_LANG_SAVE - AC_LANG_CPLUSPLUS + + GLIBCXX_LANG_PUSH AC_MSG_CHECKING([whether _get_osfhandle is defined in <io.h>]) AC_TRY_COMPILE([ @@ -5861,7 +5775,7 @@ AC_LANG_SAVE fi AC_MSG_RESULT($ac_get_osfhandle) - AC_LANG_RESTORE + GLIBCXX_LANG_POP ]) dnl @@ -5871,8 +5785,8 @@ dnl Defines: dnl _GLIBCXX_USE_NL_LANGINFO_L if nl_langinfo_l is in <langinfo.h>. dnl AC_DEFUN([GLIBCXX_CHECK_TEXT_ENCODING], [ -AC_LANG_SAVE - AC_LANG_CPLUSPLUS + + GLIBCXX_LANG_PUSH AC_MSG_CHECKING([whether nl_langinfo_l is defined in <langinfo.h>]) AC_TRY_COMPILE([ @@ -5892,7 +5806,7 @@ AC_LANG_SAVE [Define if nl_langinfo_l should be used for std::text_encoding.]) fi - AC_LANG_RESTORE + GLIBCXX_LANG_POP ]) # Macros from the top-level gcc directory. diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index 819a1d82876..ea0d5e1bf8e 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -15907,15 +15907,17 @@ $as_echo_n "checking for compiler with PCH support... " >&6; } if ${glibcxx_cv_prog_CXX_pch+:} false; then : $as_echo_n "(cached) " >&6 else - ac_save_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS -Werror -Winvalid-pch -Wno-deprecated" - ac_ext=cpp + 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" + ac_save_LIBS="$LIBS" + + CXXFLAGS="$CXXFLAGS -Werror -Winvalid-pch -Wno-deprecated" echo '#include <math.h>' > conftest.h if $CXX $CXXFLAGS $CPPFLAGS -x c++-header conftest.h \ -o conftest.h.gch 1>&5 2>&1 && @@ -15928,14 +15930,17 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu glibcxx_cv_prog_CXX_pch=no fi rm -f conftest* - CXXFLAGS=$ac_save_CXXFLAGS - ac_ext=c + + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" + 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 + fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_prog_CXX_pch" >&5 $as_echo "$glibcxx_cv_prog_CXX_pch" >&6; } @@ -15987,7 +15992,11 @@ 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" + ac_save_CXXFLAGS="$CXXFLAGS" + ac_save_LIBS="$LIBS" + + # Compile unoptimized. + CXXFLAGS='-O0' # Do link tests if possible, instead asm tests, limited to some platforms # see discussion in PR target/40134, PR libstdc++/40133 and the thread @@ -16182,7 +16191,7 @@ $as_echo "$glibcxx_cv_atomic_long_long" >&6; } # Fake what AC_TRY_COMPILE does. cat > conftest.$ac_ext << EOF -#line 16185 "configure" +#line 16194 "configure" int main() { typedef bool atomic_type; @@ -16217,7 +16226,7 @@ $as_echo "$glibcxx_cv_atomic_bool" >&6; } rm -f conftest* cat > conftest.$ac_ext << EOF -#line 16220 "configure" +#line 16229 "configure" int main() { typedef short atomic_type; @@ -16252,7 +16261,7 @@ $as_echo "$glibcxx_cv_atomic_short" >&6; } rm -f conftest* cat > conftest.$ac_ext << EOF -#line 16255 "configure" +#line 16264 "configure" int main() { // NB: _Atomic_word not necessarily int. @@ -16288,7 +16297,7 @@ $as_echo "$glibcxx_cv_atomic_int" >&6; } rm -f conftest* cat > conftest.$ac_ext << EOF -#line 16291 "configure" +#line 16300 "configure" int main() { typedef long long atomic_type; @@ -16324,7 +16333,9 @@ $as_echo "$glibcxx_cv_atomic_long_long" >&6; } fi - CXXFLAGS="$old_CXXFLAGS" + + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -16332,6 +16343,7 @@ 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, # or if the builtins were already chosen (e.g. by configure.host). if { test "$glibcxx_cv_atomic_bool" = yes \ @@ -16383,13 +16395,15 @@ $as_echo_n "checking for lock policy for shared_ptr reference counts... " >&6; } if test x"$libstdcxx_atomic_lock_policy" = x"auto"; then - ac_ext=cpp + 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" + ac_save_CXXFLAGS="$CXXFLAGS" + ac_save_LIBS="$LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -16418,13 +16432,16 @@ else libstdcxx_atomic_lock_policy=mutex fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=c + + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" + 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 - CXXFLAGS="$ac_save_CXXFLAGS" + fi if test x"$libstdcxx_atomic_lock_policy" = x"atomic"; then @@ -16445,7 +16462,7 @@ $as_echo "mutex" >&6; } # unnecessary for this test. cat > conftest.$ac_ext << EOF -#line 16448 "configure" +#line 16465 "configure" int main() { _Decimal32 d1; @@ -16482,12 +16499,15 @@ 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" + ac_save_LIBS="$LIBS" + # Fake what AC_TRY_COMPILE does, without linking as this is # unnecessary for this test. cat > conftest.$ac_ext << EOF -#line 16490 "configure" +#line 16510 "configure" template<typename T1, typename T2> struct same { typedef T2 type; }; @@ -16518,6 +16538,9 @@ $as_echo "$enable_float128" >&6; } rm -f conftest* + + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -16525,6 +16548,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu + if test "$enable_float128" = yes; then port_specific_symbol_files="$port_specific_symbol_files \$(top_srcdir)/config/abi/pre/float128.ver" fi @@ -16541,8 +16565,9 @@ 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_test_CXXFLAGS="${CXXFLAGS+set}" ac_save_CXXFLAGS="$CXXFLAGS" + ac_save_LIBS="$LIBS" + # Check for -ffunction-sections -fdata-sections { $as_echo "$as_me:${as_lineno-$LINENO}: checking for g++ that supports -ffunction-sections -fdata-sections" >&5 @@ -16565,18 +16590,15 @@ else ac_fdsections=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test "$ac_test_CXXFLAGS" = set; then - CXXFLAGS="$ac_save_CXXFLAGS" - else - # this is the suspicious part - CXXFLAGS='' - fi if test x"$ac_fdsections" = x"yes"; then SECTION_FLAGS='-ffunction-sections -fdata-sections' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_fdsections" >&5 $as_echo "$ac_fdsections" >&6; } + + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -16586,6 +16608,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + # Enable all the variable C++ runtime options that don't require linking. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for underlying I/O to use" >&5 @@ -17284,12 +17307,15 @@ done if test x"$enable_wchar_t" = x"yes"; then - ac_ext=cpp + 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" + ac_save_LIBS="$LIBS" + if test x"$ac_has_wchar_h" = xyes && test x"$ac_has_wctype_h" = xyes; then @@ -17375,12 +17401,16 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext enable_wchar_t=no fi - ac_ext=c + + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" + 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 + fi if test x"$enable_wchar_t" = x"yes"; then @@ -17412,19 +17442,20 @@ fi if test x"$enable_c99" = x"yes"; then - ac_ext=cpp + 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" + ac_save_LIBS="$LIBS" + # Use -std=c++98 (instead of -std=gnu++98) because leaving __STRICT_ANSI__ # undefined may cause fake C99 facilities, like pre-standard snprintf, # to be spuriously enabled. - ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS -std=c++98" - ac_save_LIBS="$LIBS" ac_save_gcc_no_link="$gcc_no_link" if test x$gcc_no_link != xyes; then @@ -18079,9 +18110,10 @@ $as_echo "#define _GLIBCXX_USE_C99 1" >>confdefs.h fi gcc_no_link="$ac_save_gcc_no_link" - LIBS="$ac_save_LIBS" - CXXFLAGS="$ac_save_CXXFLAGS" - ac_ext=c + + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" + 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' @@ -18089,18 +18121,20 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu - ac_ext=cpp + + 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" + ac_save_LIBS="$LIBS" + # Use -std=c++11 and test again for C99 library feature in C++11 mode. # For the reasons given above we use -std=c++11 not -std=gnu++11. - ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS -std=c++11" - ac_save_LIBS="$LIBS" ac_save_gcc_no_link="$gcc_no_link" if test x$gcc_no_link != xyes; then @@ -19319,14 +19353,16 @@ $as_echo "#define _GLIBCXX_USE_C99_FENV 1" >>confdefs.h fi gcc_no_link="$ac_save_gcc_no_link" - LIBS="$ac_save_LIBS" - CXXFLAGS="$ac_save_CXXFLAGS" - ac_ext=c + + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" + 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 + fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fully enabled ISO C99 support" >&5 @@ -19621,9 +19657,11 @@ 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" + ac_save_LIBS="$LIBS" + # Use C++11 because a conforming <stdio.h> won't define gets for C++14, # and we don't need a declaration for C++14 anyway. - ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS -std=gnu++11" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gets declaration" >&5 @@ -19658,7 +19696,9 @@ $as_echo "#define HAVE_GETS 1" >>confdefs.h fi + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -19669,6 +19709,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -19676,6 +19717,8 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_save_CXXFLAGS="$CXXFLAGS" + ac_save_LIBS="$LIBS" + CXXFLAGS="$CXXFLAGS -std=c++11" case "$host" in @@ -19857,7 +19900,9 @@ $as_echo "#define HAVE_OBSOLETE_ISNAN 1" >>confdefs.h ;; esac + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -19867,6 +19912,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + # Test uchar.h. for ac_header in uchar.h do : @@ -19891,6 +19937,8 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_save_CXXFLAGS="$CXXFLAGS" + ac_save_LIBS="$LIBS" + CXXFLAGS="$CXXFLAGS -std=c++11" if test x"$ac_has_uchar_h" = x"yes"; then @@ -20014,7 +20062,9 @@ $as_echo "#define _GLIBCXX_USE_UCHAR_C8RTOMB_MBRTOC8_CXX20 1" >>confdefs.h fi + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -20023,6 +20073,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + # For LFS support. @@ -20033,6 +20084,8 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_save_CXXFLAGS="$CXXFLAGS" + ac_save_LIBS="$LIBS" + CXXFLAGS="$CXXFLAGS -fno-exceptions" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LFS support" >&5 $as_echo_n "checking for LFS support... " >&6; } @@ -20174,7 +20227,9 @@ $as_echo "#define _GLIBCXX_USE_FSEEKO_FTELLO 1" >>confdefs.h fi + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -20183,6 +20238,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + # For showmanyc_helper(). for ac_header in sys/ioctl.h sys/filio.h do : @@ -20207,6 +20263,8 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_save_CXXFLAGS="$CXXFLAGS" + ac_save_LIBS="$LIBS" + CXXFLAGS="$CXXFLAGS -fno-exceptions" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for poll" >&5 @@ -20270,7 +20328,9 @@ $as_echo "#define HAVE_POLL 1" >>confdefs.h fi + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -20281,6 +20341,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -20288,6 +20349,8 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_save_CXXFLAGS="$CXXFLAGS" + ac_save_LIBS="$LIBS" + CXXFLAGS="$CXXFLAGS -fno-exceptions" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for S_ISREG or S_IFREG" >&5 @@ -20411,7 +20474,9 @@ $as_echo "#define HAVE_S_IFREG 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: $res" >&5 $as_echo "$res" >&6; } + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -20420,6 +20485,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + # For xsputn_2(). for ac_header in sys/uio.h do : @@ -20443,6 +20509,8 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_save_CXXFLAGS="$CXXFLAGS" + ac_save_LIBS="$LIBS" + CXXFLAGS="$CXXFLAGS -fno-exceptions" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for writev" >&5 @@ -20504,7 +20572,9 @@ $as_echo "#define HAVE_WRITEV 1" >>confdefs.h fi + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -20513,6 +20583,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + # Check for fenv.h and complex.h before GLIBCXX_CHECK_C99_TR1 # so that the check is done with the C compiler (not C++). # Checking with C++ can break a canadian cross build if either @@ -20541,10 +20612,12 @@ 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" + ac_save_LIBS="$LIBS" + # Use -std=c++98 because -std=gnu++98 leaves __STRICT_ANSI__ # undefined and fake C99 facilities may be spuriously enabled. - ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS -std=c++98" # Check for the existence of <complex.h> complex math functions used @@ -21078,7 +21151,9 @@ fi done + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -21087,6 +21162,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + # For the EOF, SEEK_CUR, and SEEK_END integer constants. @@ -21173,6 +21249,8 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_save_CXXFLAGS="$CXXFLAGS" + ac_save_LIBS="$LIBS" + CXXFLAGS="$CXXFLAGS -fno-exceptions" ac_has_gettimeofday=no; @@ -21245,7 +21323,9 @@ $as_echo "#define _GLIBCXX_USE_GETTIMEOFDAY 1" >>confdefs.h fi + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -21254,6 +21334,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + # For clock_gettime, nanosleep and sched_yield support. @@ -21279,9 +21360,10 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_save_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS -fno-exceptions" ac_save_LIBS="$LIBS" + CXXFLAGS="$CXXFLAGS -fno-exceptions" + ac_has_clock_monotonic=no ac_has_clock_realtime=no ac_has_nanosleep=no @@ -21898,6 +21980,7 @@ $as_echo "#define _GLIBCXX_NO_SLEEP 1" >>confdefs.h + CXXFLAGS="$ac_save_CXXFLAGS" LIBS="$ac_save_LIBS" ac_ext=c @@ -21908,6 +21991,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + # Check for tmpnam which is obsolescent in POSIX.1-2008 ac_ext=cpp @@ -21917,6 +22001,8 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_save_CXXFLAGS="$CXXFLAGS" + ac_save_LIBS="$LIBS" + CXXFLAGS="$CXXFLAGS -fno-exceptions" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tmpnam" >&5 $as_echo_n "checking for tmpnam... " >&6; } @@ -21973,7 +22059,9 @@ $as_echo "$glibcxx_cv_TMPNAM" >&6; } $as_echo "#define _GLIBCXX_USE_TMPNAM 1" >>confdefs.h fi + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -21982,6 +22070,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + # For pthread_cond_clockwait @@ -21993,8 +22082,9 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_save_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS -fno-exceptions" ac_save_LIBS="$LIBS" + + CXXFLAGS="$CXXFLAGS -fno-exceptions" LIBS="$LIBS -lpthread" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_cond_clockwait" >&5 @@ -22054,6 +22144,7 @@ $as_echo "#define _GLIBCXX_USE_PTHREAD_COND_CLOCKWAIT 1" >>confdefs.h fi + CXXFLAGS="$ac_save_CXXFLAGS" LIBS="$ac_save_LIBS" ac_ext=c @@ -22064,6 +22155,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + # For pthread_mutex_clocklock @@ -22075,8 +22167,9 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_save_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS -fno-exceptions" ac_save_LIBS="$LIBS" + + CXXFLAGS="$CXXFLAGS -fno-exceptions" LIBS="$LIBS -lpthread" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_clocklock" >&5 @@ -22136,6 +22229,7 @@ $as_echo "#define _GLIBCXX_USE_PTHREAD_MUTEX_CLOCKLOCK (_GLIBCXX_TSAN==0)" >>con fi + CXXFLAGS="$ac_save_CXXFLAGS" LIBS="$ac_save_LIBS" ac_ext=c @@ -22146,6 +22240,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + # For pthread_rwlock_clockrdlock and pthread_rwlock_clockwrlock @@ -22157,8 +22252,9 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_save_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS -fno-exceptions" ac_save_LIBS="$LIBS" + + CXXFLAGS="$CXXFLAGS -fno-exceptions" LIBS="$LIBS -lpthread" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_rwlock_clockrdlock, pthread_wlock_clockwrlock" >&5 @@ -22222,6 +22318,7 @@ $as_echo "#define _GLIBCXX_USE_PTHREAD_RWLOCK_CLOCKLOCK 1" >>confdefs.h fi + CXXFLAGS="$ac_save_CXXFLAGS" LIBS="$ac_save_LIBS" ac_ext=c @@ -22233,6 +22330,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + ac_fn_c_check_header_mongrel "$LINENO" "locale.h" "ac_cv_header_locale_h" "$ac_includes_default" if test "x$ac_cv_header_locale_h" = xyes; then : @@ -22295,6 +22393,8 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_save_CXXFLAGS="$CXXFLAGS" + ac_save_LIBS="$LIBS" + CXXFLAGS="$CXXFLAGS -fno-exceptions" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for get_nprocs" >&5 @@ -22354,7 +22454,9 @@ $as_echo "#define _GLIBCXX_USE_GET_NPROCS 1" >>confdefs.h fi + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -22362,6 +22464,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu + for ac_header in unistd.h do : ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" @@ -22384,6 +22487,8 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_save_CXXFLAGS="$CXXFLAGS" + ac_save_LIBS="$LIBS" + CXXFLAGS="$CXXFLAGS -fno-exceptions" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _SC_NPROCESSORS_ONLN" >&5 @@ -22443,7 +22548,9 @@ $as_echo "#define _GLIBCXX_USE_SC_NPROCESSORS_ONLN 1" >>confdefs.h fi + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -22454,6 +22561,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -22461,6 +22569,8 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_save_CXXFLAGS="$CXXFLAGS" + ac_save_LIBS="$LIBS" + CXXFLAGS="$CXXFLAGS -fno-exceptions" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _SC_NPROC_ONLN" >&5 @@ -22520,7 +22630,9 @@ $as_echo "#define _GLIBCXX_USE_SC_NPROC_ONLN 1" >>confdefs.h fi + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -22531,6 +22643,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -22538,6 +22651,8 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_save_CXXFLAGS="$CXXFLAGS" + ac_save_LIBS="$LIBS" + CXXFLAGS="$CXXFLAGS -fno-exceptions" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthreads_num_processors_np" >&5 @@ -22597,7 +22712,9 @@ $as_echo "#define _GLIBCXX_USE_PTHREADS_NUM_PROCESSORS_NP 1" >>confdefs.h fi + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -22608,6 +22725,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -22615,6 +22733,8 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_save_CXXFLAGS="$CXXFLAGS" + ac_save_LIBS="$LIBS" + CXXFLAGS="$CXXFLAGS -fno-exceptions" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hw.ncpu sysctl" >&5 @@ -22690,7 +22810,9 @@ $as_echo "#define _GLIBCXX_USE_SYSCTL_HW_NCPU 1" >>confdefs.h fi + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -22699,10 +22821,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + # Note that this test has to be run with the C language. # Otherwise, sdt.h will try to include some headers from # libstdc++ itself. - ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -28718,8 +28840,9 @@ 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_test_CXXFLAGS="${CXXFLAGS+set}" ac_save_CXXFLAGS="$CXXFLAGS" + ac_save_LIBS="$LIBS" + # Check for -ffunction-sections -fdata-sections { $as_echo "$as_me:${as_lineno-$LINENO}: checking for g++ that supports -ffunction-sections -fdata-sections" >&5 @@ -28742,18 +28865,15 @@ else ac_fdsections=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test "$ac_test_CXXFLAGS" = set; then - CXXFLAGS="$ac_save_CXXFLAGS" - else - # this is the suspicious part - CXXFLAGS='' - fi if test x"$ac_fdsections" = x"yes"; then SECTION_FLAGS='-ffunction-sections -fdata-sections' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_fdsections" >&5 $as_echo "$ac_fdsections" >&6; } + + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -28763,6 +28883,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + # If we're not using GNU ld, then there's no point in even trying these # tests. Check for that first. We should have already tested for gld # by now (in libtool), but require it now just to be safe... @@ -38868,8 +38989,9 @@ 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_test_CXXFLAGS="${CXXFLAGS+set}" ac_save_CXXFLAGS="$CXXFLAGS" + ac_save_LIBS="$LIBS" + # Check for -ffunction-sections -fdata-sections { $as_echo "$as_me:${as_lineno-$LINENO}: checking for g++ that supports -ffunction-sections -fdata-sections" >&5 @@ -38892,18 +39014,15 @@ else ac_fdsections=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test "$ac_test_CXXFLAGS" = set; then - CXXFLAGS="$ac_save_CXXFLAGS" - else - # this is the suspicious part - CXXFLAGS='' - fi if test x"$ac_fdsections" = x"yes"; then SECTION_FLAGS='-ffunction-sections -fdata-sections' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_fdsections" >&5 $as_echo "$ac_fdsections" >&6; } + + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -38913,6 +39032,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + # If we're not using GNU ld, then there's no point in even trying these # tests. Check for that first. We should have already tested for gld # by now (in libtool), but require it now just to be safe... @@ -51613,6 +51733,9 @@ 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" + ac_save_LIBS="$LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getentropy" >&5 $as_echo_n "checking for getentropy... " >&6; } if ${glibcxx_cv_getentropy+:} false; then : @@ -51672,6 +51795,9 @@ $as_echo "$glibcxx_cv_getentropy" >&6; } $as_echo "#define HAVE_GETENTROPY 1" >>confdefs.h fi + + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -51682,12 +51808,16 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + 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" + ac_save_LIBS="$LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for arc4random" >&5 $as_echo_n "checking for arc4random... " >&6; } if ${glibcxx_cv_arc4random+:} false; then : @@ -51745,6 +51875,9 @@ $as_echo "$glibcxx_cv_arc4random" >&6; } $as_echo "#define HAVE_ARC4RANDOM 1" >>confdefs.h fi + + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -51753,6 +51886,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + # This depends on GLIBCXX_ENABLE_SYMVERS and GLIBCXX_IS_NATIVE. # Do checks for resource limit functions. @@ -51764,6 +51898,9 @@ 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" + ac_save_LIBS="$LIBS" + setrlimit_have_headers=yes for ac_header in unistd.h sys/time.h sys/resource.h do : @@ -51984,6 +52121,9 @@ $as_echo "#define _GLIBCXX_RES_LIMITS 1" >>confdefs.h fi fi + + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -51992,6 +52132,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + if $GLIBCXX_IS_NATIVE ; then # Look for setenv, so that extended locale tests can be performed. @@ -52101,8 +52242,10 @@ 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" + ac_save_LIBS="$LIBS" + + CXXFLAGS="$CXXFLAGS -fno-exceptions \ -I${toplevel_srcdir}/libgcc -I${toplevel_builddir}/libgcc" @@ -52299,7 +52442,9 @@ $as_echo "#define HAVE_POSIX_SEMAPHORE 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_have_posix_semaphore" >&5 $as_echo "$ac_have_posix_semaphore" >&6; } + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -52308,6 +52453,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + # For Filesystem TS. for ac_header in fcntl.h dirent.h sys/statvfs.h utime.h do : @@ -52376,6 +52522,8 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_save_CXXFLAGS="$CXXFLAGS" + ac_save_LIBS="$LIBS" + CXXFLAGS="$CXXFLAGS -fno-exceptions" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct dirent.d_type" >&5 $as_echo_n "checking for struct dirent.d_type... " >&6; } @@ -53760,7 +53908,9 @@ $as_echo "$glibcxx_cv_unlinkat" >&6; } $as_echo "#define HAVE_UNLINKAT 1" >>confdefs.h fi + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -53770,6 +53920,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + # Check whether --enable-libstdcxx-backtrace was given. if test "${enable_libstdcxx_backtrace+set}" = set; then : enableval=$enable_libstdcxx_backtrace; @@ -54437,6 +54588,8 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_save_CXXFLAGS="$CXXFLAGS" + ac_save_LIBS="$LIBS" + CXXFLAGS="$CXXFLAGS -std=c++20" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tm_zone member of struct tm" >&5 @@ -54476,7 +54629,9 @@ $as_echo "#define _GLIBCXX_USE_STRUCT_TM_TM_ZONE 1" >>confdefs.h fi + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -54485,6 +54640,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + # For src/c++11/shared_ptr.cc alignment. @@ -54494,6 +54650,9 @@ 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" + ac_save_LIBS="$LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether static objects can be aligned to the cacheline size" >&5 $as_echo_n "checking whether static objects can be aligned to the cacheline size... " >&6; } @@ -54526,6 +54685,9 @@ _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_alignas_cacheline" >&5 $as_echo "$ac_alignas_cacheline" >&6; } + + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -54534,15 +54696,20 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + # For using init_priority in ios_init.cc + 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" + ac_save_LIBS="$LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether init_priority attribute is supported" >&5 $as_echo_n "checking whether init_priority attribute is supported... " >&6; } @@ -54577,6 +54744,9 @@ _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_init_priority" >&5 $as_echo "$ac_init_priority" >&6; } + + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -54585,15 +54755,20 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + # For __basic_file::native_handle() + 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" + ac_save_LIBS="$LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether _get_osfhandle is defined in <io.h>" >&5 $as_echo_n "checking whether _get_osfhandle is defined in <io.h>... " >&6; } @@ -54635,6 +54810,9 @@ _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_get_osfhandle" >&5 $as_echo "$ac_get_osfhandle" >&6; } + + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -54643,15 +54821,20 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + # For std::text_encoding + 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" + ac_save_LIBS="$LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether nl_langinfo_l is defined in <langinfo.h>" >&5 $as_echo_n "checking whether nl_langinfo_l is defined in <langinfo.h>... " >&6; } @@ -54692,6 +54875,9 @@ _ACEOF fi + + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -54700,6 +54886,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + # Define documentation rules conditionally. # See if makeinfo has been installed and is modern enough -- 2.49.0