# DP: PR libstdc++/99832, std::chrono::system_clock::{from,to}_time_t:
# DP: Add ABI tag for timet64.

--- a/src/libstdc++-v3/config/os/gnu-linux/os_defines.h
+++ b/src/libstdc++-v3/config/os/gnu-linux/os_defines.h
@@ -85,6 +85,13 @@
 // libpthread.
 #  define _GLIBCXX_GTHREAD_USE_WEAK 0
 # endif
+
+# if defined(_TIME_BITS)
+#  if _TIME_BITS == 64
+#   undef _GLIBCXX_TIME_BITS64_ABI_TAG
+#   define _GLIBCXX_TIME_BITS64_ABI_TAG [[__gnu__::__abi_tag__("__time64")]]
+#  endif
+# endif
 #endif // __linux__
 
 #endif
--- a/src/libstdc++-v3/include/bits/c++config
+++ b/src/libstdc++-v3/include/bits/c++config
@@ -888,4 +888,6 @@ namespace __gnu_cxx
 #endif // __has_include
 #endif // C++17
 
+#define _GLIBCXX_TIME_BITS64_ABI_TAG
+
 // End of prewritten config; the settings discovered at configure time follow.
--- a/src/libstdc++-v3/include/bits/chrono.h
+++ b/src/libstdc++-v3/include/bits/chrono.h
@@ -1239,6 +1239,7 @@ _GLIBCXX_BEGIN_INLINE_ABI_NAMESPACE(_V2)
       now() noexcept;
 
       // Map to C API
+      _GLIBCXX_TIME_BITS64_ABI_TAG
       static std::time_t
       to_time_t(const time_point& __t) noexcept
       {
@@ -1246,6 +1247,7 @@ _GLIBCXX_BEGIN_INLINE_ABI_NAMESPACE(_V2)
 			   (__t.time_since_epoch()).count());
       }
 
+      _GLIBCXX_TIME_BITS64_ABI_TAG
       static time_point
       from_time_t(std::time_t __t) noexcept
       {
