aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/acinclude.m4
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3/acinclude.m4')
-rw-r--r--libstdc++-v3/acinclude.m442
1 files changed, 39 insertions, 3 deletions
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index e668d2d..a0094c2 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -4023,10 +4023,11 @@ AC_DEFUN([GLIBCXX_ENABLE_LOCK_POLICY], [
dnl Why don't we check 8-byte CAS for sparc64, where _Atomic_word is long?!
dnl New targets should only check for CAS for the _Atomic_word type.
AC_TRY_COMPILE([
- #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"
@@ -5745,6 +5746,41 @@ AC_DEFUN([GLIBCXX_ZONEINFO_DIR], [
])
dnl
+dnl Check for a tm_zone member in struct tm.
+dnl
+dnl This member is defined as const char* in Glibc, newlib, POSIX.1-2024,
+dnl and as char* in BSD (including macOS).
+dnl
+dnl Defines:
+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"
+ CXXFLAGS="$CXXFLAGS -std=c++20"
+
+ AC_CACHE_CHECK([for tm_zone member of struct tm], glibcxx_cv_tm_zone, [
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <time.h>
+ ],
+ [struct tm t{}; t.tm_zone = (char*)0;]
+ )],
+ [glibcxx_cv_tm_zone=yes],
+ [glibcxx_cv_tm_zone=no]
+ )
+ ])
+
+ if test $glibcxx_cv_tm_zone = yes; then
+ AC_DEFINE(_GLIBCXX_USE_STRUCT_TM_TM_ZONE, 1,
+ [Define if struct tm has a tm_zone member.])
+ fi
+
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ AC_LANG_RESTORE
+])
+
+dnl
dnl Check whether lock tables can be aligned to avoid false sharing.
dnl
dnl Defines: