# 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
@@ -67,6 +67,12 @@
 // 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
 
 #endif
--- a/src/libstdc++-v3/include/bits/c++config
+++ b/src/libstdc++-v3/include/bits/c++config
@@ -778,4 +778,6 @@ namespace std
 #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/std/chrono
+++ b/src/libstdc++-v3/include/std/chrono
@@ -1139,6 +1139,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       now() noexcept;
 
       // Map to C API
+      _GLIBCXX_TIME_BITS64_ABI_TAG
       static std::time_t
       to_time_t(const time_point& __t) noexcept
       {
@@ -1146,6 +1147,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 			   (__t.time_since_epoch()).count());
       }
 
+      _GLIBCXX_TIME_BITS64_ABI_TAG
       static time_point
       from_time_t(std::time_t __t) noexcept
       {
