diff --git a/libstdc++-v3/include/bits/algorithmfwd.h b/libstdc++-v3/include/bits/algorithmfwd.h
index bc757c340a4..ab7641815b9 100644
--- a/libstdc++-v3/include/bits/algorithmfwd.h
+++ b/libstdc++-v3/include/bits/algorithmfwd.h
@@ -39,9 +39,6 @@
 #include <initializer_list>
 #endif
 
-#define __glibcxx_want_constexpr_algorithms
-#include <bits/version.h>
-
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
diff --git a/libstdc++-v3/include/bits/align.h b/libstdc++-v3/include/bits/align.h
index 4152639622e..68bacf4edd9 100644
--- a/libstdc++-v3/include/bits/align.h
+++ b/libstdc++-v3/include/bits/align.h
@@ -30,14 +30,10 @@
 #ifndef _GLIBCXX_ALIGN_H
 #define _GLIBCXX_ALIGN_H 1
 
-#include <bits/c++config.h>
-
-#define __glibcxx_want_assume_aligned
-#include <bits/version.h>
-
 #include <bit>          // std::has_single_bit
 #include <stdint.h>     // uintptr_t
 #include <debug/assertions.h> // _GLIBCXX_DEBUG_ASSERT
+#include <bits/version.h>
 
 namespace std _GLIBCXX_VISIBILITY(default)
 {
@@ -78,7 +74,7 @@ align(size_t __align, size_t __size, void*& __ptr, size_t& __space) noexcept
     }
 }
 
-#ifdef __cpp_lib_assume_aligned // C++ >= 20
+#ifdef __glibcxx_assume_aligned // C++ >= 20
   /** @brief Inform the compiler that a pointer is aligned.
    *
    *  @tparam _Align An alignment value (i.e. a power of two)
@@ -105,7 +101,7 @@ align(size_t __align, size_t __size, void*& __ptr, size_t& __space) noexcept
 	  return static_cast<_Tp*>(__builtin_assume_aligned(__ptr, _Align));
 	}
     }
-#endif // __cpp_lib_assume_aligned
+#endif // __glibcxx_assume_aligned
 
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace
diff --git a/libstdc++-v3/include/bits/alloc_traits.h b/libstdc++-v3/include/bits/alloc_traits.h
index 453278e5348..611615d6052 100644
--- a/libstdc++-v3/include/bits/alloc_traits.h
+++ b/libstdc++-v3/include/bits/alloc_traits.h
@@ -40,10 +40,6 @@
 # endif
 #endif
 
-#define __glibcxx_want_constexpr_dynamic_alloc
-#define __glibcxx_want_allocator_traits_is_always_equal
-#include <bits/version.h>
-
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
diff --git a/libstdc++-v3/include/bits/allocator.h b/libstdc++-v3/include/bits/allocator.h
index 41e35f876f0..af7951a02a5 100644
--- a/libstdc++-v3/include/bits/allocator.h
+++ b/libstdc++-v3/include/bits/allocator.h
@@ -49,9 +49,6 @@
 #include <type_traits>
 #endif
 
-#define __glibcxx_want_incomplete_container_elements
-#include <bits/version.h>
-
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
diff --git a/libstdc++-v3/include/bits/atomic_base.h b/libstdc++-v3/include/bits/atomic_base.h
index 974872ad7a6..f4ce0fa5324 100644
--- a/libstdc++-v3/include/bits/atomic_base.h
+++ b/libstdc++-v3/include/bits/atomic_base.h
@@ -46,8 +46,6 @@
 #define _GLIBCXX_ALWAYS_INLINE inline __attribute__((__always_inline__))
 #endif
 
-#define __glibcxx_want_atomic_value_initialization
-#define __glibcxx_want_atomic_flag_test
 #include <bits/version.h>
 
 namespace std _GLIBCXX_VISIBILITY(default)
@@ -161,7 +159,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     }
 
 /// @cond undocumented
-#if __cpp_lib_atomic_value_initialization
+#if __glibcxx_atomic_value_initialization
 # define _GLIBCXX20_INIT(I) = I
 #else
 # define _GLIBCXX20_INIT(I)
@@ -234,7 +232,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       return __atomic_test_and_set (&_M_i, int(__m));
     }
 
-#ifdef __cpp_lib_atomic_flag_test // C++ >= 20
+#ifdef __glibcxx_atomic_flag_test // C++ >= 20
     _GLIBCXX_ALWAYS_INLINE bool
     test(memory_order __m = memory_order_seq_cst) const noexcept
     {
@@ -252,7 +250,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     }
 #endif
 
-#if __cpp_lib_atomic_wait // C++ >= 20 && (linux_futex || gthread)
+#if __glibcxx_atomic_wait // C++ >= 20 && (linux_futex || gthread)
     _GLIBCXX_ALWAYS_INLINE void
     wait(bool __old,
 	memory_order __m = memory_order_seq_cst) const noexcept
@@ -277,7 +275,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     { std::__atomic_notify_address(&_M_i, true); }
 
     // TODO add const volatile overload
-#endif // __cpp_lib_atomic_wait
+#endif // __glibcxx_atomic_wait
 
     _GLIBCXX_ALWAYS_INLINE void
     clear(memory_order __m = memory_order_seq_cst) noexcept
@@ -603,7 +601,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 				       __cmpexch_failure_order(__m));
       }
 
-#if __cpp_lib_atomic_wait
+#if __glibcxx_atomic_wait
       _GLIBCXX_ALWAYS_INLINE void
       wait(__int_type __old,
 	  memory_order __m = memory_order_seq_cst) const noexcept
@@ -625,7 +623,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       { std::__atomic_notify_address(&_M_i, true); }
 
       // TODO add const volatile overload
-#endif // __cpp_lib_atomic_wait
+#endif // __glibcxx_atomic_wait
 
       _GLIBCXX_ALWAYS_INLINE __int_type
       fetch_add(__int_type __i,
@@ -905,7 +903,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 					   int(__m1), int(__m2));
       }
 
-#if __cpp_lib_atomic_wait
+#if __glibcxx_atomic_wait
       _GLIBCXX_ALWAYS_INLINE void
       wait(__pointer_type __old,
 	   memory_order __m = memory_order_seq_cst) const noexcept
@@ -928,7 +926,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       { std::__atomic_notify_address(&_M_p, true); }
 
       // TODO add const volatile overload
-#endif // __cpp_lib_atomic_wait
+#endif // __glibcxx_atomic_wait
 
       _GLIBCXX_ALWAYS_INLINE __pointer_type
       fetch_add(ptrdiff_t __d,
@@ -1138,7 +1136,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 		   *__ptr, __expected, __desired, false, __success, __failure);
       }
 
-#if __cpp_lib_atomic_wait
+#if __glibcxx_atomic_wait
     template<typename _Tp>
       _GLIBCXX_ALWAYS_INLINE void
       wait(const _Tp* __ptr, _Val<_Tp> __old,
@@ -1163,7 +1161,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       { std::__atomic_notify_address(__ptr, true); }
 
       // TODO add const volatile overload
-#endif // __cpp_lib_atomic_wait
+#endif // __glibcxx_atomic_wait
 
     template<typename _Tp>
       _GLIBCXX_ALWAYS_INLINE _Tp
@@ -1418,7 +1416,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 				       __cmpexch_failure_order(__order));
       }
 
-#if __cpp_lib_atomic_wait
+#if __glibcxx_atomic_wait
       _GLIBCXX_ALWAYS_INLINE void
       wait(_Fp __old, memory_order __m = memory_order_seq_cst) const noexcept
       { __atomic_impl::wait(&_M_fp, __old, __m); }
@@ -1436,7 +1434,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       { __atomic_impl::notify_all(&_M_fp); }
 
       // TODO add const volatile overload
-#endif // __cpp_lib_atomic_wait
+#endif // __glibcxx_atomic_wait
 
       value_type
       fetch_add(value_type __i,
@@ -1573,7 +1571,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 				       __cmpexch_failure_order(__order));
       }
 
-#if __cpp_lib_atomic_wait
+#if __glibcxx_atomic_wait
       _GLIBCXX_ALWAYS_INLINE void
       wait(_Tp __old, memory_order __m = memory_order_seq_cst) const noexcept
       { __atomic_impl::wait(_M_ptr, __old, __m); }
@@ -1591,7 +1589,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       { __atomic_impl::notify_all(_M_ptr); }
 
       // TODO add const volatile overload
-#endif // __cpp_lib_atomic_wait
+#endif // __glibcxx_atomic_wait
 
     private:
       _Tp* _M_ptr;
@@ -1686,7 +1684,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 				       __cmpexch_failure_order(__order));
       }
 
-#if __cpp_lib_atomic_wait
+#if __glibcxx_atomic_wait
       _GLIBCXX_ALWAYS_INLINE void
       wait(_Tp __old, memory_order __m = memory_order_seq_cst) const noexcept
       { __atomic_impl::wait(_M_ptr, __old, __m); }
@@ -1704,7 +1702,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       { __atomic_impl::notify_all(_M_ptr); }
 
       // TODO add const volatile overload
-#endif // __cpp_lib_atomic_wait 
+#endif // __glibcxx_atomic_wait
 
       value_type
       fetch_add(value_type __i,
@@ -1859,7 +1857,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 				       __cmpexch_failure_order(__order));
       }
 
-#if __cpp_lib_atomic_wait
+#if __glibcxx_atomic_wait
       _GLIBCXX_ALWAYS_INLINE void
       wait(_Fp __old, memory_order __m = memory_order_seq_cst) const noexcept
       { __atomic_impl::wait(_M_ptr, __old, __m); }
@@ -1877,7 +1875,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       { __atomic_impl::notify_all(_M_ptr); }
 
       // TODO add const volatile overload
-#endif // __cpp_lib_atomic_wait
+#endif // __glibcxx_atomic_wait
 
       value_type
       fetch_add(value_type __i,
@@ -1986,7 +1984,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 				       __cmpexch_failure_order(__order));
       }
 
-#if __cpp_lib_atomic_wait
+#if __glibcxx_atomic_wait
       _GLIBCXX_ALWAYS_INLINE void
       wait(_Tp* __old, memory_order __m = memory_order_seq_cst) const noexcept
       { __atomic_impl::wait(_M_ptr, __old, __m); }
@@ -2004,7 +2002,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       { __atomic_impl::notify_all(_M_ptr); }
 
       // TODO add const volatile overload
-#endif // __cpp_lib_atomic_wait
+#endif // __glibcxx_atomic_wait
 
       _GLIBCXX_ALWAYS_INLINE value_type
       fetch_add(difference_type __d,
diff --git a/libstdc++-v3/include/bits/atomic_timed_wait.h b/libstdc++-v3/include/bits/atomic_timed_wait.h
index 8bb731db787..ba21ab20a11 100644
--- a/libstdc++-v3/include/bits/atomic_timed_wait.h
+++ b/libstdc++-v3/include/bits/atomic_timed_wait.h
@@ -34,7 +34,7 @@
 
 #include <bits/atomic_wait.h>
 
-#if __cpp_lib_atomic_wait
+#if __glibcxx_atomic_wait
 #include <bits/functional_hash.h>
 #include <bits/this_thread_sleep.h>
 #include <bits/chrono.h>
diff --git a/libstdc++-v3/include/bits/atomic_wait.h b/libstdc++-v3/include/bits/atomic_wait.h
index 9cbfb99a7c2..506b7f0cc9d 100644
--- a/libstdc++-v3/include/bits/atomic_wait.h
+++ b/libstdc++-v3/include/bits/atomic_wait.h
@@ -32,10 +32,9 @@
 
 #pragma GCC system_header
 
-#define __glibcxx_want_atomic_wait
 #include <bits/version.h>
 
-#if __cpp_lib_atomic_wait
+#if __glibcxx_atomic_wait
 #include <bits/functional_hash.h>
 #include <bits/gthr.h>
 #include <ext/numeric_traits.h>
@@ -476,5 +475,5 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   }
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace std
-#endif // __cpp_lib_atomic_wait
+#endif // __glibcxx_atomic_wait
 #endif // _GLIBCXX_ATOMIC_WAIT_H
diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h
index 0fa32afeb84..9956a76f40c 100644
--- a/libstdc++-v3/include/bits/basic_string.h
+++ b/libstdc++-v3/include/bits/basic_string.h
@@ -51,10 +51,6 @@
 # include <charconv>
 #endif
 
-#define __glibcxx_want_constexpr_string
-#define __glibcxx_want_string_resize_and_overwrite
-#define __glibcxx_want_string_udls
-#define __glibcxx_want_to_string
 #include <bits/version.h>
 
 #if ! _GLIBCXX_USE_CXX11_ABI
@@ -133,7 +129,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
       _S_allocate(_Char_alloc_type& __a, size_type __n)
       {
 	pointer __p = _Alloc_traits::allocate(__a, __n);
-#if __cpp_lib_constexpr_string >= 201907L
+#if __glibcxx_constexpr_string >= 201907L
 	// std::char_traits begins the lifetime of characters,
 	// but custom traits might not, so do it here.
 	if constexpr (!is_same_v<_Traits, char_traits<_CharT>>)
@@ -356,7 +352,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
       void
       _M_init_local_buf() _GLIBCXX_NOEXCEPT
       {
-#if __cpp_lib_is_constant_evaluated
+#if __glibcxx_is_constant_evaluated
 	if (std::is_constant_evaluated())
 	  for (size_type __i = 0; __i <= _S_local_capacity; ++__i)
 	    _M_local_buf[__i] = _CharT();
@@ -1133,7 +1129,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
 #pragma GCC diagnostic pop
 #endif
 
-#ifdef __cpp_lib_string_resize_and_overwrite // C++ >= 23
+#ifdef __glibcxx_string_resize_and_overwrite // C++ >= 23
       /** Resize the string and call a function to fill it.
        *
        * @param __n   The maximum size requested.
@@ -4339,7 +4335,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
     return __str;
   }
 
-#if __cpp_lib_to_string >= 202306L
+#if __glibcxx_to_string >= 202306L // C++ >= 26
 
   [[nodiscard]]
   inline string
@@ -4518,7 +4514,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
       }
   }
 
-#if __cpp_lib_constexpr_string >= 201907L
+#if __glibcxx_constexpr_string >= 201907L
   constexpr
 #endif
   inline wstring
@@ -4575,7 +4571,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
   to_wstring(unsigned long long __val)
   { return std::__to_wstring_numeric(std::to_string(__val)); }
 
-#if __cpp_lib_to_string || _GLIBCXX_USE_C99_STDIO
+#if __glibcxx_to_string || _GLIBCXX_USE_C99_STDIO
   _GLIBCXX_NODISCARD
   inline wstring
   to_wstring(float __val)
@@ -4678,7 +4674,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     { };
 #endif
 
-#ifdef __cpp_lib_string_udls // C++ >= 14
+#ifdef __glibcxx_string_udls // C++ >= 14
   inline namespace literals
   {
   inline namespace string_literals
@@ -4686,7 +4682,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wliteral-suffix"
 
-#if __cpp_lib_constexpr_string >= 201907L
+#if __glibcxx_constexpr_string >= 201907L
 # define _GLIBCXX_STRING_CONSTEXPR constexpr
 #else
 # define _GLIBCXX_STRING_CONSTEXPR
@@ -4723,7 +4719,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 #pragma GCC diagnostic pop
   } // inline namespace string_literals
   } // inline namespace literals
-#endif // __cpp_lib_string_udls
+#endif // __glibcxx_string_udls
 
 #if __cplusplus >= 201703L
   namespace __detail::__variant
diff --git a/libstdc++-v3/include/bits/basic_string.tcc b/libstdc++-v3/include/bits/basic_string.tcc
index f0a44e5e881..1568fc32007 100644
--- a/libstdc++-v3/include/bits/basic_string.tcc
+++ b/libstdc++-v3/include/bits/basic_string.tcc
@@ -566,7 +566,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       return __n;
     }
 
-#ifdef __cpp_lib_string_resize_and_overwrite // C++ >= 23
+#ifdef __glibcxx_string_resize_and_overwrite // C++ >= 23
   template<typename _CharT, typename _Traits, typename _Alloc>
   template<typename _Operation>
     [[__gnu__::__always_inline__]]
@@ -581,7 +581,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   template<typename _Operation>
     _GLIBCXX20_CONSTEXPR void
     basic_string<_CharT, _Traits, _Alloc>::
-#ifdef __cpp_lib_string_resize_and_overwrite // C++ >= 23
+#ifdef __glibcxx_string_resize_and_overwrite // C++ >= 23
     resize_and_overwrite(const size_type __n, _Operation __op)
 #else
     __resize_and_overwrite(const size_type __n, _Operation __op)
@@ -615,7 +615,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
 #endif  // _GLIBCXX_USE_CXX11_ABI
    
-#if __cpp_lib_constexpr_string >= 201907L
+#if __glibcxx_constexpr_string >= 201907L
 # define _GLIBCXX_STRING_CONSTEXPR constexpr
 #else
 # define _GLIBCXX_STRING_CONSTEXPR
diff --git a/libstdc++-v3/include/bits/char_traits.h b/libstdc++-v3/include/bits/char_traits.h
index e9b4e84af99..824630842ee 100644
--- a/libstdc++-v3/include/bits/char_traits.h
+++ b/libstdc++-v3/include/bits/char_traits.h
@@ -61,9 +61,6 @@
 # define _GLIBCXX_ALWAYS_INLINE inline __attribute__((__always_inline__))
 #endif
 
-#define __glibcxx_want_constexpr_char_traits
-#include <bits/version.h>
-
 namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
diff --git a/libstdc++-v3/include/bits/chrono.h b/libstdc++-v3/include/bits/chrono.h
index 50aca84f142..1f6daa34bcd 100644
--- a/libstdc++-v3/include/bits/chrono.h
+++ b/libstdc++-v3/include/bits/chrono.h
@@ -32,10 +32,6 @@
 
 #pragma GCC system_header
 
-#define __glibcxx_want_chrono
-#define __glibcxx_want_chrono_udls
-#include <bits/version.h>
-
 #if __cplusplus >= 201103L
 
 #include <ratio>
@@ -48,6 +44,8 @@
 # include <compare>
 #endif
 
+#include <bits/version.h>
+
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -374,7 +372,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       { };
 #endif // C++20
 
-#ifdef __cpp_lib_chrono // C++ >= 17 && HOSTED
+#ifdef __glibcxx_chrono // C++ >= 17 && HOSTED
     /** Convert a `duration` to type `ToDur` and round down.
      *
      * If the duration cannot be represented exactly in the result type,
@@ -468,7 +466,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     // Make chrono::ceil<D> also usable as chrono::__detail::ceil<D>.
     namespace __detail { using chrono::ceil; }
 
-#else // ! __cpp_lib_chrono
+#else // ! __glibcxx_chrono
 
     // We want to use ceil even when compiling for earlier standards versions.
     // C++11 only allows a single statement in a constexpr function, so we
@@ -490,7 +488,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 	  return __detail::__ceil_impl(chrono::duration_cast<_ToDur>(__d), __d);
 	}
     }
-#endif // __cpp_lib_chrono
+#endif // __glibcxx_chrono
 
     /// duration_values
     template<typename _Rep>
@@ -1314,7 +1312,7 @@ _GLIBCXX_END_INLINE_ABI_NAMESPACE(_V2)
 #endif // C++20
   } // namespace chrono
 
-#ifdef __cpp_lib_chrono_udls // C++ >= 14 && HOSTED
+#ifdef __glibcxx_chrono_udls // C++ >= 14 && HOSTED
   inline namespace literals
   {
   /** ISO C++ 2014  namespace for suffixes for duration literals.
@@ -1435,7 +1433,7 @@ _GLIBCXX_END_INLINE_ABI_NAMESPACE(_V2)
   {
     using namespace literals::chrono_literals;
   } // namespace chrono
-#endif // __cpp_lib_chrono_udls
+#endif // __glibcxx_chrono_udls
 
 #if __cplusplus >= 201703L
   namespace filesystem
diff --git a/libstdc++-v3/include/bits/cow_string.h b/libstdc++-v3/include/bits/cow_string.h
index 5411dfe32a9..414f10a4993 100644
--- a/libstdc++-v3/include/bits/cow_string.h
+++ b/libstdc++-v3/include/bits/cow_string.h
@@ -36,9 +36,6 @@
 
 #include <ext/atomicity.h> // _Atomic_word, __is_single_threaded
 
-#define __glibcxx_want_constexpr_string
-#include <bits/version.h>
-
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -965,7 +962,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 #pragma GCC diagnostic pop
 #endif
 
-#ifdef __cpp_lib_string_resize_and_overwrite // C++ >= 23
+#ifdef __glibcxx_string_resize_and_overwrite // C++ >= 23
       /** Resize the string and call a function to fill it.
        *
        * @param __n   The maximum size requested.
@@ -998,7 +995,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       template<typename _Operation>
 	void
 	resize_and_overwrite(size_type __n, _Operation __op);
-#endif // __cpp_lib_string_resize_and_overwrite
+#endif // __glibcxx_string_resize_and_overwrite
 
 #if __cplusplus >= 201103L
       /// Non-standard version of resize_and_overwrite for C++11 and above.
@@ -3754,7 +3751,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       return __n;
     }
 
-#ifdef __cpp_lib_string_resize_and_overwrite // C++ >= 23
+#ifdef __glibcxx_string_resize_and_overwrite // C++ >= 23
   template<typename _CharT, typename _Traits, typename _Alloc>
   template<typename _Operation>
     [[__gnu__::__always_inline__]]
@@ -3769,7 +3766,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   template<typename _Operation>
     void
     basic_string<_CharT, _Traits, _Alloc>::
-#ifdef __cpp_lib_string_resize_and_overwrite // C++ >= 23
+#ifdef __glibcxx_string_resize_and_overwrite // C++ >= 23
     resize_and_overwrite(const size_type __n, _Operation __op)
 #else
     __resize_and_overwrite(const size_type __n, _Operation __op)
diff --git a/libstdc++-v3/include/bits/erase_if.h b/libstdc++-v3/include/bits/erase_if.h
index 4ff81e0f98f..b807a4515b4 100644
--- a/libstdc++-v3/include/bits/erase_if.h
+++ b/libstdc++-v3/include/bits/erase_if.h
@@ -34,9 +34,7 @@
 
 #include <bits/c++config.h>
 
-#define __glibcxx_want_erase_if
-#include <bits/version.h>
-
+// Used by C++17 containers and Library Fundamentals v2 headers.
 #if __cplusplus >= 201402L
 namespace std
 {
diff --git a/libstdc++-v3/include/bits/forward_list.h b/libstdc++-v3/include/bits/forward_list.h
index c56e430b068..5f7972d1a69 100644
--- a/libstdc++-v3/include/bits/forward_list.h
+++ b/libstdc++-v3/include/bits/forward_list.h
@@ -41,9 +41,6 @@
 #include <ext/alloc_traits.h>
 #include <ext/aligned_buffer.h>
 
-#define __glibcxx_want_list_remove_return_type
-#include <bits/version.h>
-
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -1183,7 +1180,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       /// @}
 
     private:
-#ifdef __cpp_lib_list_remove_return_type // C++20 && HOSTED
+#ifdef __glibcxx_list_remove_return_type // C++20 && HOSTED
       using __remove_return_type = size_type;
 # define _GLIBCXX_FWDLIST_REMOVE_RETURN_TYPE_TAG \
       __attribute__((__abi_tag__("__cxx20")))
diff --git a/libstdc++-v3/include/bits/hashtable.h b/libstdc++-v3/include/bits/hashtable.h
index 89132430f3e..9ff9104a2ab 100644
--- a/libstdc++-v3/include/bits/hashtable.h
+++ b/libstdc++-v3/include/bits/hashtable.h
@@ -39,9 +39,6 @@
 # include <bits/node_handle.h>
 #endif
 
-#define __glibcxx_want_generic_unordered_lookup
-#include <bits/version.h>
-
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -760,7 +757,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       std::pair<const_iterator, const_iterator>
       equal_range(const key_type& __k) const;
 
-#ifdef __cpp_lib_generic_unordered_lookup // C++ >= 20 && HOSTED
+#ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED
       template<typename _Kt,
 	       typename = __has_is_transparent_t<_Hash, _Kt>,
 	       typename = __has_is_transparent_t<_Equal, _Kt>>
@@ -790,7 +787,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 	       typename = __has_is_transparent_t<_Equal, _Kt>>
 	pair<const_iterator, const_iterator>
 	_M_equal_range_tr(const _Kt& __k) const;
-#endif // __cpp_lib_generic_unordered_lookup
+#endif // __glibcxx_generic_unordered_lookup
 
     private:
       // Bucket index computation helpers.
diff --git a/libstdc++-v3/include/bits/ios_base.h b/libstdc++-v3/include/bits/ios_base.h
index 3253eaaa233..9e775ccff64 100644
--- a/libstdc++-v3/include/bits/ios_base.h
+++ b/libstdc++-v3/include/bits/ios_base.h
@@ -46,9 +46,6 @@
 # include <system_error>
 #endif
 
-#define __glibcxx_want_ios_noreplace
-#include <bits/version.h>
-
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -476,7 +473,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
     static const openmode __noreplace =	_S_noreplace;
 
-#ifdef __cpp_lib_ios_noreplace // C++ >= 23 && HOSTED
+#ifdef __glibcxx_ios_noreplace // C++ >= 23 && HOSTED
     /// Open a file in exclusive mode.
     static const openmode noreplace =	_S_noreplace;
 #endif
diff --git a/libstdc++-v3/include/bits/memory_resource.h b/libstdc++-v3/include/bits/memory_resource.h
index f12555d4215..97bcdd5e572 100644
--- a/libstdc++-v3/include/bits/memory_resource.h
+++ b/libstdc++-v3/include/bits/memory_resource.h
@@ -42,7 +42,7 @@
 #include <ext/numeric_traits.h>		// __int_traits
 #include <debug/assertions.h>
 
-#if ! __cpp_lib_make_obj_using_allocator
+#if ! __glibcxx_make_obj_using_allocator
 # include <bits/utility.h>		// index_sequence
 # include <tuple>			// tuple, forward_as_tuple
 #endif
@@ -220,7 +220,7 @@ namespace pmr
 	}
 #endif // C++2a
 
-#if ! __cpp_lib_make_obj_using_allocator
+#if ! __glibcxx_make_obj_using_allocator
       template<typename _Tp1, typename... _Args>
 	__attribute__((__nonnull__))
 	typename __not_pair<_Tp1>::type
@@ -337,7 +337,7 @@ namespace pmr
 #endif
 
     private:
-#if ! __cpp_lib_make_obj_using_allocator
+#if ! __glibcxx_make_obj_using_allocator
       using __uses_alloc1_ = __uses_alloc1<polymorphic_allocator>;
       using __uses_alloc2_ = __uses_alloc2<polymorphic_allocator>;
 
diff --git a/libstdc++-v3/include/bits/move.h b/libstdc++-v3/include/bits/move.h
index 0151d78aff9..54606cd4e8f 100644
--- a/libstdc++-v3/include/bits/move.h
+++ b/libstdc++-v3/include/bits/move.h
@@ -37,9 +37,6 @@
 # include <type_traits> // Brings in std::declval too.
 #endif
 
-#define __glibcxx_want_addressof_constexpr
-#include <bits/version.h>
-
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
diff --git a/libstdc++-v3/include/bits/move_only_function.h b/libstdc++-v3/include/bits/move_only_function.h
index 0aa5980324a..2a40ff400de 100644
--- a/libstdc++-v3/include/bits/move_only_function.h
+++ b/libstdc++-v3/include/bits/move_only_function.h
@@ -32,10 +32,9 @@
 
 #pragma GCC system_header
 
-#define __glibcxx_want_move_only_function
 #include <bits/version.h>
 
-#ifdef __cpp_lib_move_only_function // C++ >= 23 && HOSTED
+#ifdef __glibcxx_move_only_function // C++ >= 23 && HOSTED
 
 #include <bits/invoke.h>
 #include <bits/utility.h>
@@ -213,5 +212,5 @@ _GLIBCXX_END_NAMESPACE_VERSION
 #define _GLIBCXX_MOF_REF &&
 #include "mofunc_impl.h"
 
-#endif // __cpp_lib_move_only_function
+#endif // __glibcxx_move_only_function
 #endif // _GLIBCXX_MOVE_ONLY_FUNCTION_H
diff --git a/libstdc++-v3/include/bits/node_handle.h b/libstdc++-v3/include/bits/node_handle.h
index 16471355c19..d3c75c7c3ef 100644
--- a/libstdc++-v3/include/bits/node_handle.h
+++ b/libstdc++-v3/include/bits/node_handle.h
@@ -33,10 +33,9 @@
 
 #pragma GCC system_header
 
-#define __glibcxx_want_node_extract
 #include <bits/version.h>
 
-#ifdef __cpp_lib_node_extract // C++ >= 17 && HOSTED
+#ifdef __glibcxx_node_extract // C++ >= 17 && HOSTED
 
 #include <new>
 #include <bits/alloc_traits.h>
@@ -392,5 +391,5 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace std
 
-#endif // __cpp_lib_node_extract
+#endif // __glibcxx_node_extract
 #endif
diff --git a/libstdc++-v3/include/bits/ptr_traits.h b/libstdc++-v3/include/bits/ptr_traits.h
index 9e2f4f3f216..66c39cc83fd 100644
--- a/libstdc++-v3/include/bits/ptr_traits.h
+++ b/libstdc++-v3/include/bits/ptr_traits.h
@@ -34,10 +34,6 @@
 
 #include <bits/move.h>
 
-#define __glibcxx_want_constexpr_memory
-#define __glibcxx_want_to_address
-#include <bits/version.h>
-
 #if __cplusplus > 201703L
 #include <concepts>
 namespace __gnu_debug { struct _Safe_iterator_base; }
@@ -212,7 +208,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       return __ptr;
     }
 
-#ifndef __cpp_lib_to_address // C++ < 20
+#ifndef __glibcxx_to_address // C++ < 20
   template<typename _Ptr>
     constexpr typename std::pointer_traits<_Ptr>::element_type*
     __to_address(const _Ptr& __ptr)
@@ -256,7 +252,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     constexpr auto
     to_address(const _Ptr& __ptr) noexcept
     { return std::__to_address(__ptr); }
-#endif // __cpp_lib_to_address
+#endif // __glibcxx_to_address
 
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace std
diff --git a/libstdc++-v3/include/bits/range_access.h b/libstdc++-v3/include/bits/range_access.h
index 9751b8e88d5..63fc06dd4bf 100644
--- a/libstdc++-v3/include/bits/range_access.h
+++ b/libstdc++-v3/include/bits/range_access.h
@@ -32,10 +32,6 @@
 
 #pragma GCC system_header
 
-#define __glibcxx_want_nonmember_container_access
-#define __glibcxx_want_ssize
-#include <bits/version.h>
-
 #if __cplusplus >= 201103L
 #include <initializer_list>
 #include <type_traits>	    // common_type_t, make_signed_t
@@ -255,7 +251,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
 #endif // C++14
 
-#ifdef __cpp_lib_nonmember_container_access // C++ >= 17
+#ifdef __glibcxx_nonmember_container_access // C++ >= 17
   /**
    *  @brief  Return the size of a container.
    *  @param  __cont  Container.
@@ -347,9 +343,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     constexpr const _Tp*
     data(initializer_list<_Tp> __il) noexcept
     { return __il.begin(); }
-#endif // __cpp_lib_nonmember_container_access
+#endif // __glibcxx_nonmember_container_access
 
-#ifdef __cpp_lib_ssize // C++ >= 20
+#ifdef __glibcxx_ssize // C++ >= 20
   template<typename _Container>
     [[nodiscard, __gnu__::__always_inline__]]
     constexpr auto
@@ -366,7 +362,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     constexpr ptrdiff_t
     ssize(const _Tp (&)[_Num]) noexcept
     { return _Num; }
-#endif // __cpp_lib_ssize
+#endif // __glibcxx_ssize
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace
 
diff --git a/libstdc++-v3/include/bits/ranges_algo.h b/libstdc++-v3/include/bits/ranges_algo.h
index a06794c02c9..460893353de 100644
--- a/libstdc++-v3/include/bits/ranges_algo.h
+++ b/libstdc++-v3/include/bits/ranges_algo.h
@@ -39,14 +39,7 @@
 #include <bits/ranges_util.h>
 #include <bits/uniform_int_dist.h> // concept uniform_random_bit_generator
 
-#define __glibcxx_want_ranges_contains
-#define __glibcxx_want_ranges_find_last
-#define __glibcxx_want_ranges_fold
-#define __glibcxx_want_ranges_iota
-#define __glibcxx_want_shift
-#include <bits/version.h>
-
-#if __cpp_lib_concepts
+#if __glibcxx_concepts
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -3472,7 +3465,7 @@ namespace ranges
 
   inline constexpr __prev_permutation_fn prev_permutation{};
 
-#if __cpp_lib_ranges_contains >= 202207L // C++ >= 23
+#if __glibcxx_ranges_contains >= 202207L // C++ >= 23
   struct __contains_fn
   {
     template<input_iterator _Iter, sentinel_for<_Iter> _Sent,
@@ -3526,9 +3519,9 @@ namespace ranges
 
   inline constexpr __contains_subrange_fn contains_subrange{};
 
-#endif // __cpp_lib_ranges_contains
+#endif // __glibcxx_ranges_contains
 
-#if __cpp_lib_ranges_iota >= 202202L // C++ >= 23
+#if __glibcxx_ranges_iota >= 202202L // C++ >= 23
 
   template<typename _Out, typename _Tp>
     struct out_value_result
@@ -3578,9 +3571,9 @@ namespace ranges
 
   inline constexpr __iota_fn iota{};
 
-#endif // __cpp_lib_ranges_iota
+#endif // __glibcxx_ranges_iota
 
-#if __cpp_lib_ranges_find_last >= 202207L // C++ >= 23
+#if __glibcxx_ranges_find_last >= 202207L // C++ >= 23
 
   struct __find_last_fn
   {
@@ -3708,9 +3701,9 @@ namespace ranges
 
   inline constexpr __find_last_if_not_fn find_last_if_not{};
 
-#endif // __cpp_lib_ranges_find_last
+#endif // __glibcxx_ranges_find_last
 
-#if __cpp_lib_ranges_fold >= 202207L // C++ >= 23
+#if __glibcxx_ranges_fold >= 202207L // C++ >= 23
 
   template<typename _Iter, typename _Tp>
     struct in_value_result
@@ -3957,7 +3950,7 @@ namespace ranges
   };
 
   inline constexpr __fold_right_last_fn fold_right_last{};
-#endif // __cpp_lib_ranges_fold
+#endif // __glibcxx_ranges_fold
 } // namespace ranges
 
   template<typename _ForwardIterator>
diff --git a/libstdc++-v3/include/bits/ranges_cmp.h b/libstdc++-v3/include/bits/ranges_cmp.h
index 96fa79667e6..420d8bd2448 100644
--- a/libstdc++-v3/include/bits/ranges_cmp.h
+++ b/libstdc++-v3/include/bits/ranges_cmp.h
@@ -30,9 +30,6 @@
 #ifndef _RANGES_CMP_H
 #define _RANGES_CMP_H 1
 
-#define __glibcxx_want_ranges
-#include <bits/version.h>
-
 #if __cplusplus > 201703L
 # include <bits/move.h>
 # include <concepts>
@@ -58,7 +55,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     using is_transparent = __is_transparent;
   };
 
-#ifdef __cpp_lib_ranges // C++ >= 20
+#ifdef __glibcxx_ranges // C++ >= 20
 namespace ranges
 {
   namespace __detail
@@ -175,7 +172,7 @@ namespace ranges
   };
 
 } // namespace ranges
-#endif // __cpp_lib_ranges
+#endif // __glibcxx_ranges
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace std
 #endif // C++20
diff --git a/libstdc++-v3/include/bits/ranges_util.h b/libstdc++-v3/include/bits/ranges_util.h
index f7e3538af97..ab6c69c57d0 100644
--- a/libstdc++-v3/include/bits/ranges_util.h
+++ b/libstdc++-v3/include/bits/ranges_util.h
@@ -34,7 +34,7 @@
 # include <bits/ranges_base.h>
 # include <bits/utility.h>
 
-#ifdef __cpp_lib_ranges
+#ifdef __glibcxx_ranges
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
diff --git a/libstdc++-v3/include/bits/semaphore_base.h b/libstdc++-v3/include/bits/semaphore_base.h
index 2b3c196040b..7e07b308cdc 100644
--- a/libstdc++-v3/include/bits/semaphore_base.h
+++ b/libstdc++-v3/include/bits/semaphore_base.h
@@ -34,7 +34,7 @@
 
 #include <bits/atomic_base.h>
 #include <bits/chrono.h>
-#if __cpp_lib_atomic_wait
+#if __glibcxx_atomic_wait
 #include <bits/atomic_timed_wait.h>
 #include <ext/numeric_traits.h>
 #endif // __cpp_lib_atomic_wait
@@ -181,7 +181,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   };
 #endif // _GLIBCXX_HAVE_POSIX_SEMAPHORE
 
-#if __cpp_lib_atomic_wait
+#if __glibcxx_atomic_wait
   struct __atomic_semaphore
   {
     static constexpr ptrdiff_t _S_max = __gnu_cxx::__int_traits<int>::__max;
@@ -266,7 +266,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
 // Note: the _GLIBCXX_USE_POSIX_SEMAPHORE macro can be used to force the
 // use of Posix semaphores (sem_t). Doing so however, alters the ABI.
-#if defined __cpp_lib_atomic_wait && !_GLIBCXX_USE_POSIX_SEMAPHORE
+#if defined __glibcxx_atomic_wait && !_GLIBCXX_USE_POSIX_SEMAPHORE
   using __semaphore_impl = __atomic_semaphore;
 #elif _GLIBCXX_HAVE_POSIX_SEMAPHORE
   using __semaphore_impl = __platform_semaphore;
diff --git a/libstdc++-v3/include/bits/shared_ptr.h b/libstdc++-v3/include/bits/shared_ptr.h
index 9b5ee571c3e..02bfdabfd1c 100644
--- a/libstdc++-v3/include/bits/shared_ptr.h
+++ b/libstdc++-v3/include/bits/shared_ptr.h
@@ -52,10 +52,6 @@
 #include <iosfwd>           	  // std::basic_ostream
 #include <bits/shared_ptr_base.h>
 
-#define __glibcxx_want_shared_ptr_weak_type
-#define __glibcxx_want_enable_shared_from_this
-#include <bits/version.h>
-
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -107,7 +103,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   /// @cond undocumented
 
   // Constraint for overloads taking non-array types.
-#if __cpp_concepts && __cpp_lib_type_trait_variable_templates
+#if __cpp_concepts && __glibcxx_type_trait_variable_templates
   template<typename _Tp>
     requires (!is_array_v<_Tp>)
     using _NonArray = _Tp;
@@ -116,7 +112,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     using _NonArray = __enable_if_t<!is_array<_Tp>::value, _Tp>;
 #endif
 
-#if __cpp_lib_shared_ptr_arrays >= 201707L
+#if __glibcxx_shared_ptr_arrays >= 201707L
   // Constraint for overloads taking array types with unknown bound, U[].
 #if __cpp_concepts
   template<typename _Tp>
@@ -139,7 +135,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       = __enable_if_t<__is_array_known_bounds<_Tp>::value, _Tp>;
 #endif
 
-#if __cpp_lib_smart_ptr_for_overwrite
+#if __glibcxx_smart_ptr_for_overwrite
   // Constraint for overloads taking either non-array or bounded array, U[N].
 #if __cpp_concepts
   template<typename _Tp>
@@ -193,7 +189,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       /// The type pointed to by the stored pointer, remove_extent_t<_Tp>
       using element_type = typename __shared_ptr<_Tp>::element_type;
 
-#ifdef __cpp_lib_shared_ptr_weak_type // C++ >= 17 && HOSTED
+#ifdef __glibcxx_shared_ptr_weak_type // C++ >= 17 && HOSTED
       /// The corresponding weak_ptr type for this shared_ptr
       /// @since C++17
       using weak_type = weak_ptr<_Tp>;
@@ -475,7 +471,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 	friend shared_ptr<_NonArray<_Yp>>
 	make_shared(_Args&&...);
 
-#if __cpp_lib_shared_ptr_arrays >= 201707L
+#if __glibcxx_shared_ptr_arrays >= 201707L
       // This constructor is non-standard, it is used by allocate_shared<T[]>.
       template<typename _Alloc, typename _Init = const remove_extent_t<_Tp>*>
 	shared_ptr(const _Sp_counted_array_base<_Alloc>& __a,
@@ -515,7 +511,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 	friend shared_ptr<_BoundedArray<_Yp>>
 	make_shared(const remove_extent_t<_Yp>&);
 
-#if __cpp_lib_smart_ptr_for_overwrite
+#if __glibcxx_smart_ptr_for_overwrite
       template<typename _Yp, typename _Alloc>
 	friend shared_ptr<_NotUnboundedArray<_Yp>>
 	allocate_shared_for_overwrite(const _Alloc&);
@@ -941,7 +937,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       shared_from_this() const
       { return shared_ptr<const _Tp>(this->_M_weak_this); }
 
-#ifdef __cpp_lib_enable_shared_from_this // C++ >= 17 && HOSTED
+#ifdef __glibcxx_enable_shared_from_this // C++ >= 17 && HOSTED
       /** @{
        * Get a `weak_ptr` referring to the object that has `*this` as its base.
        * @since C++17
@@ -1012,7 +1008,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 			     std::forward<_Args>(__args)...);
     }
 
-#if __cpp_lib_shared_ptr_arrays >= 201707L
+#if __glibcxx_shared_ptr_arrays >= 201707L
   /// @cond undocumented
   template<typename _Tp, typename _Alloc = allocator<void>>
     auto
@@ -1100,7 +1096,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 			     std::__addressof(__u));
     }
 
-#if __cpp_lib_smart_ptr_for_overwrite
+#if __glibcxx_smart_ptr_for_overwrite
   template<typename _Tp, typename _Alloc>
     inline shared_ptr<_NotUnboundedArray<_Tp>>
     allocate_shared_for_overwrite(const _Alloc& __a)
diff --git a/libstdc++-v3/include/bits/shared_ptr_atomic.h b/libstdc++-v3/include/bits/shared_ptr_atomic.h
index 5b818fe4456..d0be43aec2d 100644
--- a/libstdc++-v3/include/bits/shared_ptr_atomic.h
+++ b/libstdc++-v3/include/bits/shared_ptr_atomic.h
@@ -31,9 +31,7 @@
 #define _SHARED_PTR_ATOMIC_H 1
 
 #include <bits/atomic_base.h>
-
-#define __glibcxx_want_atomic_shared_ptr
-#include <bits/version.h>
+#include <bits/shared_ptr.h>
 
 // Annotations for the custom locking in atomic<shared_ptr<T>>.
 #if defined _GLIBCXX_TSAN && __has_include(<sanitizer/tsan_interface.h>)
@@ -380,7 +378,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   /// @} group pointer_abstractions
 
-#ifdef  __cpp_lib_atomic_shared_ptr // C++ >= 20 && HOSTED
+#ifdef  __glibcxx_atomic_shared_ptr // C++ >= 20 && HOSTED
   template<typename _Tp>
     struct atomic;
 
@@ -451,7 +449,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 	  auto __current = _M_val.load(memory_order_relaxed);
 	  while (__current & _S_lock_bit)
 	    {
-#if __cpp_lib_atomic_wait
+#if __glibcxx_atomic_wait
 	      __detail::__thread_relax();
 #endif
 	      __current = _M_val.load(memory_order_relaxed);
@@ -465,7 +463,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 						 memory_order_relaxed))
 	    {
 	      _GLIBCXX_TSAN_MUTEX_TRY_LOCK_FAILED(&_M_val);
-#if __cpp_lib_atomic_wait
+#if __glibcxx_atomic_wait
 	      __detail::__thread_relax();
 #endif
 	      __current = __current & ~_S_lock_bit;
@@ -498,7 +496,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 	  __c._M_pi = reinterpret_cast<pointer>(__x & ~_S_lock_bit);
 	}
 
-#if __cpp_lib_atomic_wait
+#if __glibcxx_atomic_wait
 	// Precondition: caller holds lock!
 	void
 	_M_wait_unlock(memory_order __o) const noexcept
@@ -608,7 +606,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 	return __result;
       }
 
-#if __cpp_lib_atomic_wait
+#if __glibcxx_atomic_wait
       void
       wait(value_type __old, memory_order __o) const noexcept
       {
@@ -731,7 +729,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 	return compare_exchange_strong(__expected, std::move(__desired), __o);
       }
 
-#if __cpp_lib_atomic_wait
+#if __glibcxx_atomic_wait
       void
       wait(value_type __old,
 	   memory_order __o = memory_order_seq_cst) const noexcept
@@ -844,7 +842,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 	return compare_exchange_strong(__expected, std::move(__desired), __o);
       }
 
-#if __cpp_lib_atomic_wait
+#if __glibcxx_atomic_wait
       void
       wait(value_type __old,
 	   memory_order __o = memory_order_seq_cst) const noexcept
diff --git a/libstdc++-v3/include/bits/shared_ptr_base.h b/libstdc++-v3/include/bits/shared_ptr_base.h
index 33282e596b2..edb3eb654ea 100644
--- a/libstdc++-v3/include/bits/shared_ptr_base.h
+++ b/libstdc++-v3/include/bits/shared_ptr_base.h
@@ -67,10 +67,6 @@
 # include <bits/stl_uninitialized.h>
 #endif
 
-#define __glibcxx_want_smart_ptr_for_overwrite
-#define __glibcxx_want_shared_ptr_arrays
-#include <bits/version.h>
-
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -413,7 +409,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   template<_Lock_policy _Lp = __default_lock_policy>
     class __shared_count;
 
-#if __cplusplus >= 202002L
+#ifdef __glibcxx_atomic_shared_ptr
   template<typename>
     class _Sp_atomic;
 #endif
@@ -656,7 +652,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       _Impl _M_impl;
     };
 
-#ifdef __cpp_lib_smart_ptr_for_overwrite // C++ >= 20 && HOSTED
+#ifdef __glibcxx_smart_ptr_for_overwrite // C++ >= 20 && HOSTED
   struct _Sp_overwrite_tag { };
 
   // Partial specialization used for make_shared_for_overwrite<non-array>().
@@ -715,9 +711,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       _M_get_deleter(const std::type_info&) noexcept override
       { return nullptr; }
     };
-#endif // __cpp_lib_smart_ptr_for_overwrite
+#endif // __glibcxx_smart_ptr_for_overwrite
 
-#if __cpp_lib_shared_ptr_arrays >= 201707L // C++ >= 20 && HOSTED
+#if __glibcxx_shared_ptr_arrays >= 201707L // C++ >= 20 && HOSTED
   struct _Sp_overwrite_tag;
 
   // For make_shared<T[]>, make_shared<T[N]>, allocate_shared<T[]> etc.
@@ -879,7 +875,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       _M_get_deleter(const std::type_info&) noexcept override
       { return nullptr; }
     };
-#endif // __cpp_lib_shared_ptr_arrays >= 201707L
+#endif // __glibcxx_shared_ptr_arrays >= 201707L
 
   // The default deleter for shared_ptr<T[]> and shared_ptr<T[N]>.
   struct __sp_array_delete
@@ -898,7 +894,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       template<typename _Tp>
 	struct __not_alloc_shared_tag<_Sp_alloc_shared_tag<_Tp>> { };
 
-#if __cpp_lib_shared_ptr_arrays >= 201707L // C++ >= 20 && HOSTED
+#if __glibcxx_shared_ptr_arrays >= 201707L // C++ >= 20 && HOSTED
       template<typename _Alloc>
 	struct __not_alloc_shared_tag<_Sp_counted_array_base<_Alloc>> { };
 #endif
@@ -974,7 +970,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 	  __p = __pi->_M_ptr();
 	}
 
-#if __cpp_lib_shared_ptr_arrays >= 201707L // C++ >= 20 && HOSTED
+#if __glibcxx_shared_ptr_arrays >= 201707L // C++ >= 20 && HOSTED
       template<typename _Tp, typename _Alloc, typename _Init>
 	__shared_count(_Tp*& __p, const _Sp_counted_array_base<_Alloc>& __a,
 		       _Init __init)
@@ -1127,7 +1123,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
     private:
       friend class __weak_count<_Lp>;
-#if __cplusplus >= 202002L
+#ifdef __glibcxx_atomic_shared_ptr
       template<typename> friend class _Sp_atomic;
 #endif
 
@@ -1227,7 +1223,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
     private:
       friend class __shared_count<_Lp>;
-#if __cplusplus >= 202002L
+#ifdef __glibcxx_atomic_shared_ptr
       template<typename> friend class _Sp_atomic;
 #endif
 
@@ -1716,7 +1712,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 	friend __shared_ptr<_Tp1, _Lp1>
 	__allocate_shared(const _Alloc& __a, _Args&&... __args);
 
-#if __cpp_lib_shared_ptr_arrays >= 201707L // C++ >= 20 && HOSTED
+#if __glibcxx_shared_ptr_arrays >= 201707L // C++ >= 20 && HOSTED
       // This constructor is non-standard, it is used by allocate_shared<T[]>.
       template<typename _Alloc, typename _Init = const remove_extent_t<_Tp>*>
 	__shared_ptr(const _Sp_counted_array_base<_Alloc>& __a,
@@ -1777,7 +1773,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       template<typename _Del, typename _Tp1>
 	friend _Del* get_deleter(const shared_ptr<_Tp1>&) noexcept;
 
-#if __cplusplus >= 202002L
+#ifdef __glibcxx_atomic_shared_ptr
       friend _Sp_atomic<shared_ptr<_Tp>>;
 #endif
 
@@ -2111,7 +2107,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       template<typename _Tp1, _Lock_policy _Lp1> friend class __weak_ptr;
       friend class __enable_shared_from_this<_Tp, _Lp>;
       friend class enable_shared_from_this<_Tp>;
-#if __cplusplus >= 202002L
+#ifdef __glibcxx_atomic_shared_ptr
       friend _Sp_atomic<weak_ptr<_Tp>>;
 #endif
 
diff --git a/libstdc++-v3/include/bits/stl_algo.h b/libstdc++-v3/include/bits/stl_algo.h
index 637d53d6b95..0b34a4f86b0 100644
--- a/libstdc++-v3/include/bits/stl_algo.h
+++ b/libstdc++-v3/include/bits/stl_algo.h
@@ -72,10 +72,6 @@
 # endif
 #endif
 
-#define __glibcxx_want_clamp
-#define __glibcxx_want_sample
-#include <bits/version.h>
-
 // See concept_check.h for the __glibcxx_*_requires macros.
 
 namespace std _GLIBCXX_VISIBILITY(default)
@@ -3604,7 +3600,7 @@ _GLIBCXX_END_INLINE_ABI_NAMESPACE(_V2)
     }
 #endif // C++14
 
-#ifdef  __cpp_lib_clamp // C++ >= 17
+#ifdef  __glibcxx_clamp // C++ >= 17
   /**
    *  @brief  Returns the value clamped between lo and hi.
    *  @ingroup sorting_algorithms
@@ -3643,7 +3639,7 @@ _GLIBCXX_END_INLINE_ABI_NAMESPACE(_V2)
       __glibcxx_assert(!__comp(__hi, __lo));
       return std::min(std::max(__val, __lo, __comp), __hi, __comp);
     }
-#endif // __cpp_lib_clamp
+#endif // __glibcxx_clamp
 
   /**
    *  @brief Generate two uniformly distributed integers using a
@@ -5815,7 +5811,7 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
     }
 #endif // C++14
 
-#ifdef __cpp_lib_sample // C++ >= 17
+#ifdef __glibcxx_sample // C++ >= 17
   /// Take a random sample from a population.
   template<typename _PopulationIterator, typename _SampleIterator,
            typename _Distance, typename _UniformRandomBitGenerator>
@@ -5843,7 +5839,7 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
 	__sample(__first, __last, __pop_cat{}, __out, __samp_cat{}, __d,
 		 std::forward<_UniformRandomBitGenerator>(__g));
     }
-#endif // __cpp_lib_sample
+#endif // __glibcxx_sample
 
 _GLIBCXX_END_NAMESPACE_ALGO
 _GLIBCXX_END_NAMESPACE_VERSION
diff --git a/libstdc++-v3/include/bits/stl_algobase.h b/libstdc++-v3/include/bits/stl_algobase.h
index 2f5a4bd4fd4..6276d85b86f 100644
--- a/libstdc++-v3/include/bits/stl_algobase.h
+++ b/libstdc++-v3/include/bits/stl_algobase.h
@@ -79,9 +79,6 @@
 # include <compare>
 #endif
 
-#define __glibcxx_want_robust_nonmodifying_seq_ops
-#include <bits/version.h>
-
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -1382,7 +1379,7 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
 	(__is_memcmp_ordered_with<_ValueType1, _ValueType2>::__value
 	 && __is_pointer<_II1>::__value
 	 && __is_pointer<_II2>::__value
-#if __cplusplus > 201703L && __cpp_lib_concepts
+#if __cplusplus > 201703L && __glibcxx_concepts
 	 // For C++20 iterator_traits<volatile T*>::value_type is non-volatile
 	 // so __is_byte<T> could be true, but we can't use memcmp with
 	 // volatile data.
@@ -1648,7 +1645,7 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
     }
 #endif // C++11
 
-#ifdef __cpp_lib_robust_nonmodifying_seq_ops // C++ >= 14
+#ifdef __glibcxx_robust_nonmodifying_seq_ops // C++ >= 14
   /**
    *  @brief Tests a range for element-wise equality.
    *  @ingroup non_mutating_algorithms
@@ -1710,7 +1707,7 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
       return _GLIBCXX_STD_A::__equal4(__first1, __last1, __first2, __last2,
 				      __binary_pred);
     }
-#endif // __cpp_lib_robust_nonmodifying_seq_ops
+#endif // __glibcxx_robust_nonmodifying_seq_ops
 
   /**
    *  @brief Performs @b dictionary comparison on ranges.
@@ -1952,7 +1949,7 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
 	__gnu_cxx::__ops::__iter_comp_iter(__binary_pred));
     }
 
-#if __cpp_lib_robust_nonmodifying_seq_ops // C++ >= 14
+#if __glibcxx_robust_nonmodifying_seq_ops // C++ >= 14
   template<typename _InputIterator1, typename _InputIterator2,
 	   typename _BinaryPredicate>
     _GLIBCXX20_CONSTEXPR
diff --git a/libstdc++-v3/include/bits/stl_function.h b/libstdc++-v3/include/bits/stl_function.h
index 608d4e96fb2..23d6da34d19 100644
--- a/libstdc++-v3/include/bits/stl_function.h
+++ b/libstdc++-v3/include/bits/stl_function.h
@@ -60,9 +60,6 @@
 #include <bits/move.h>
 #endif
 
-#define __glibcxx_want_transparent_operators
-#include <bits/version.h>
-
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -156,7 +153,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
    *  @{
    */
 
-#if __cpp_lib_transparent_operators // C++ >= 14
+#if __glibcxx_transparent_operators // C++ >= 14
   struct __is_transparent;  // undefined
 
   template<typename _Tp = void>
@@ -244,7 +241,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     };
 #pragma GCC diagnostic pop
 
-#ifdef __cpp_lib_transparent_operators // C++ >= 14
+#ifdef __glibcxx_transparent_operators // C++ >= 14
   template<>
     struct plus<void>
     {
@@ -345,7 +342,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
    *
    *  @{
    */
-#if __cpp_lib_transparent_operators // C++ >= 14
+#if __glibcxx_transparent_operators // C++ >= 14
   template<typename _Tp = void>
     struct equal_to;
 
@@ -489,7 +486,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     };
 #pragma GCC diagnostic pop
 
-#ifdef __cpp_lib_transparent_operators // C++ >= 14
+#ifdef __glibcxx_transparent_operators // C++ >= 14
   /// One of the @link comparison_functors comparison functors@endlink.
   template<>
     struct equal_to<void>
@@ -765,7 +762,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 	      is_convertible<_Tp, const volatile void*>,
 	      is_convertible<_Up, const volatile void*>>;
     };
-#endif // __cpp_lib_transparent_operators
+#endif // __glibcxx_transparent_operators
   /** @}  */
 
   // 20.3.4 logical operations
@@ -777,7 +774,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
    *
    *  @{
    */
-#ifdef __cpp_lib_transparent_operators // C++ >= 14
+#ifdef __glibcxx_transparent_operators // C++ >= 14
   template<typename _Tp = void>
     struct logical_and;
 
@@ -822,7 +819,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     };
 #pragma GCC diagnostic pop
 
-#ifdef __cpp_lib_transparent_operators // C++ >= 14
+#ifdef __glibcxx_transparent_operators // C++ >= 14
   /// One of the @link logical_functors Boolean operations functors@endlink.
   template<>
     struct logical_and<void>
@@ -867,10 +864,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
       typedef __is_transparent is_transparent;
     };
-#endif // __cpp_lib_transparent_operators
+#endif // __glibcxx_transparent_operators
   /** @}  */
 
-#ifdef __cpp_lib_transparent_operators // C++ >= 14
+#ifdef __glibcxx_transparent_operators // C++ >= 14
   template<typename _Tp = void>
     struct bit_and;
 
@@ -926,7 +923,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     };
 #pragma GCC diagnostic pop
 
-#ifdef __cpp_lib_transparent_operators // C++ >= 14
+#ifdef __glibcxx_transparent_operators // C++ >= 14
   template <>
     struct bit_and<void>
     {
@@ -1416,7 +1413,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   /** @}  */
 
-#ifdef __cpp_lib_transparent_operators // C++ >= 14
+#ifdef __glibcxx_transparent_operators // C++ >= 14
   template<typename _Func, typename _SfinaeType, typename = __void_t<>>
     struct __has_is_transparent
     { };
diff --git a/libstdc++-v3/include/bits/stl_iterator.h b/libstdc++-v3/include/bits/stl_iterator.h
index b75f87e056d..919b1633930 100644
--- a/libstdc++-v3/include/bits/stl_iterator.h
+++ b/libstdc++-v3/include/bits/stl_iterator.h
@@ -70,12 +70,6 @@
 # include <type_traits>
 #endif
 
-#define __glibcxx_want_constexpr_iterator
-#define __glibcxx_want_array_constexpr
-#define __glibcxx_want_make_reverse_iterator
-#define __glibcxx_want_move_iterator_concept
-#include <bits/version.h>
-
 #if __cplusplus >= 202002L
 # include <compare>
 # include <new>
@@ -93,7 +87,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
    * @{
    */
 
-#if __cpp_lib_concepts
+#if __glibcxx_concepts
   namespace __detail
   {
     // Weaken iterator_category _Cat to _Limit if it is derived from that,
@@ -142,7 +136,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       template<typename _Iter>
 	friend class reverse_iterator;
 
-#if __cpp_lib_concepts
+#if __glibcxx_concepts
       // _GLIBCXX_RESOLVE_LIB_DEFECTS
       // 3435. three_way_comparable_with<reverse_iterator<int*>, [...]>
       template<typename _Iter>
@@ -158,7 +152,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     public:
       typedef _Iterator					iterator_type;
       typedef typename __traits_type::pointer		pointer;
-#if ! __cpp_lib_concepts
+#if ! __glibcxx_concepts
       typedef typename __traits_type::difference_type	difference_type;
       typedef typename __traits_type::reference		reference;
 #else
@@ -214,7 +208,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        *  underlying %iterator can be converted to the type of @c current.
       */
       template<typename _Iter>
-#if __cpp_lib_concepts
+#if __glibcxx_concepts
 	requires __convertible<_Iter>
 #endif
 	_GLIBCXX17_CONSTEXPR
@@ -225,7 +219,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
 #if __cplusplus >= 201103L
       template<typename _Iter>
-#if __cpp_lib_concepts
+#if __glibcxx_concepts
 	requires __convertible<_Iter>
 	  && assignable_from<_Iterator&, const _Iter&>
 #endif
@@ -392,7 +386,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       operator[](difference_type __n) const
       { return *(*this + __n); }
 
-#if __cplusplus > 201703L && __cpp_lib_concepts
+#if __cplusplus > 201703L && __glibcxx_concepts
       [[nodiscard]]
       friend constexpr iter_rvalue_reference_t<_Iterator>
       iter_move(const reverse_iterator& __i)
@@ -440,7 +434,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
    *  iterators.
    *
   */
-#if __cplusplus <= 201703L || ! defined __cpp_lib_concepts
+#if __cplusplus <= 201703L || ! defined __glibcxx_concepts
   template<typename _Iterator>
     _GLIBCXX_NODISCARD
     inline _GLIBCXX17_CONSTEXPR bool
@@ -641,7 +635,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     __make_reverse_iterator(_Iterator __i)
     { return reverse_iterator<_Iterator>(__i); }
 
-# ifdef __cpp_lib_make_reverse_iterator // C++ >= 14
+# ifdef __glibcxx_make_reverse_iterator // C++ >= 14
   // _GLIBCXX_RESOLVE_LIB_DEFECTS
   // DR 2285. make_reverse_iterator
   /// Generator function for reverse_iterator.
@@ -651,14 +645,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     make_reverse_iterator(_Iterator __i)
     { return reverse_iterator<_Iterator>(__i); }
 
-#  if __cplusplus > 201703L && defined __cpp_lib_concepts
+#  if __cplusplus > 201703L && defined __glibcxx_concepts
   template<typename _Iterator1, typename _Iterator2>
     requires (!sized_sentinel_for<_Iterator1, _Iterator2>)
     inline constexpr bool
     disable_sized_sentinel_for<reverse_iterator<_Iterator1>,
 			       reverse_iterator<_Iterator2>> = true;
 #  endif // C++20
-# endif // __cpp_lib_make_reverse_iterator
+# endif // __glibcxx_make_reverse_iterator
 
   template<typename _Iterator>
     _GLIBCXX20_CONSTEXPR
@@ -901,7 +895,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     class insert_iterator
     : public iterator<output_iterator_tag, void, void, void, void>
     {
-#if __cplusplus > 201703L && defined __cpp_lib_concepts
+#if __cplusplus > 201703L && defined __glibcxx_concepts
       using _Iter = std::__detail::__range_iter_t<_Container>;
 #else
       typedef typename _Container::iterator		_Iter;
@@ -914,7 +908,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       /// A nested typedef for the type of whatever container you used.
       typedef _Container          container_type;
 
-#if __cplusplus > 201703L && defined __cpp_lib_concepts
+#if __cplusplus > 201703L && defined __glibcxx_concepts
       using difference_type = ptrdiff_t;
 #endif
 
@@ -1010,7 +1004,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
    *  template parameter deduction, making the compiler match the correct
    *  types for you.
   */
-#if __cplusplus > 201703L && defined __cpp_lib_concepts
+#if __cplusplus > 201703L && defined __glibcxx_concepts
   template<typename _Container>
     [[nodiscard]]
     constexpr insert_iterator<_Container>
@@ -1062,7 +1056,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       typedef typename __traits_type::reference 	reference;
       typedef typename __traits_type::pointer   	pointer;
 
-#if __cplusplus > 201703L && __cpp_lib_concepts
+#if __cplusplus > 201703L && __glibcxx_concepts
       using iterator_concept = std::__detail::__iter_concept<_Iterator>;
 #endif
 
@@ -1373,7 +1367,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
    * @{
    */
 
-#if __cplusplus > 201703L && __cpp_lib_concepts
+#if __cplusplus > 201703L && __glibcxx_concepts
   template<semiregular _Sent>
     class move_sentinel
     {
@@ -1417,7 +1411,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   namespace __detail
   {
-#if __cplusplus > 201703L && __cpp_lib_concepts
+#if __cplusplus > 201703L && __glibcxx_concepts
     template<typename _Iterator>
       struct __move_iter_cat
       { };
@@ -1444,21 +1438,21 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
    */
   template<typename _Iterator>
     class move_iterator
-#if __cplusplus > 201703L && __cpp_lib_concepts
+#if __cplusplus > 201703L && __glibcxx_concepts
       : public __detail::__move_iter_cat<_Iterator>
 #endif
     {
       _Iterator _M_current;
 
       using __traits_type = iterator_traits<_Iterator>;
-#if ! (__cplusplus > 201703L && __cpp_lib_concepts)
+#if ! (__cplusplus > 201703L && __glibcxx_concepts)
       using __base_ref = typename __traits_type::reference;
 #endif
 
       template<typename _Iter2>
 	friend class move_iterator;
 
-#if __cpp_lib_concepts // C++20 && concepts
+#if __glibcxx_concepts // C++20 && concepts
       // _GLIBCXX_RESOLVE_LIB_DEFECTS
       // 3435. three_way_comparable_with<reverse_iterator<int*>, [...]>
       template<typename _Iter2>
@@ -1466,7 +1460,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 	    && convertible_to<const _Iter2&, _Iterator>;
 #endif
 
-#if __cplusplus > 201703L && __cpp_lib_concepts
+#if __cplusplus > 201703L && __glibcxx_concepts
       static auto
       _S_iter_concept()
       {
@@ -1484,7 +1478,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     public:
       using iterator_type = _Iterator;
 
-#ifdef __cpp_lib_move_iterator_concept // C++ >= 20 && lib_concepts
+#ifdef __glibcxx_move_iterator_concept // C++ >= 20 && lib_concepts
       using iterator_concept = decltype(_S_iter_concept());
 
       // iterator_category defined in __move_iter_cat
@@ -1515,7 +1509,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       : _M_current(std::move(__i)) { }
 
       template<typename _Iter>
-#if __cpp_lib_concepts
+#if __glibcxx_concepts
 	requires __convertible<_Iter>
 #endif
 	_GLIBCXX17_CONSTEXPR
@@ -1523,7 +1517,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 	: _M_current(__i._M_current) { }
 
       template<typename _Iter>
-#if __cpp_lib_concepts
+#if __glibcxx_concepts
 	requires __convertible<_Iter>
 	  && assignable_from<_Iterator&, const _Iter&>
 #endif
@@ -1554,7 +1548,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       [[__nodiscard__]]
       _GLIBCXX17_CONSTEXPR reference
       operator*() const
-#if __cplusplus > 201703L && __cpp_lib_concepts
+#if __cplusplus > 201703L && __glibcxx_concepts
       { return ranges::iter_move(_M_current); }
 #else
       { return static_cast<reference>(*_M_current); }
@@ -1580,7 +1574,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 	return __tmp;
       }
 
-#if __cpp_lib_concepts
+#if __glibcxx_concepts
       constexpr void
       operator++(int) requires (!forward_iterator<_Iterator>)
       { ++_M_current; }
@@ -1628,13 +1622,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       [[__nodiscard__]]
       _GLIBCXX17_CONSTEXPR reference
       operator[](difference_type __n) const
-#if __cplusplus > 201703L && __cpp_lib_concepts
+#if __cplusplus > 201703L && __glibcxx_concepts
       { return ranges::iter_move(_M_current + __n); }
 #else
       { return std::move(_M_current[__n]); }
 #endif
 
-#if __cplusplus > 201703L && __cpp_lib_concepts
+#if __cplusplus > 201703L && __glibcxx_concepts
       template<sentinel_for<_Iterator> _Sent>
 	[[nodiscard]]
 	friend constexpr bool
@@ -1672,7 +1666,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     inline _GLIBCXX17_CONSTEXPR bool
     operator==(const move_iterator<_IteratorL>& __x,
 	       const move_iterator<_IteratorR>& __y)
-#if __cplusplus > 201703L && __cpp_lib_concepts
+#if __cplusplus > 201703L && __glibcxx_concepts
     requires requires { { __x.base() == __y.base() } -> convertible_to<bool>; }
 #endif
     { return __x.base() == __y.base(); }
@@ -1699,7 +1693,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     inline _GLIBCXX17_CONSTEXPR bool
     operator<(const move_iterator<_IteratorL>& __x,
 	      const move_iterator<_IteratorR>& __y)
-#if __cplusplus > 201703L && __cpp_lib_concepts
+#if __cplusplus > 201703L && __glibcxx_concepts
     requires requires { { __x.base() < __y.base() } -> convertible_to<bool>; }
 #endif
     { return __x.base() < __y.base(); }
@@ -1709,7 +1703,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     inline _GLIBCXX17_CONSTEXPR bool
     operator<=(const move_iterator<_IteratorL>& __x,
 	       const move_iterator<_IteratorR>& __y)
-#if __cplusplus > 201703L && __cpp_lib_concepts
+#if __cplusplus > 201703L && __glibcxx_concepts
     requires requires { { __y.base() < __x.base() } -> convertible_to<bool>; }
 #endif
     { return !(__y < __x); }
@@ -1719,7 +1713,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     inline _GLIBCXX17_CONSTEXPR bool
     operator>(const move_iterator<_IteratorL>& __x,
 	      const move_iterator<_IteratorR>& __y)
-#if __cplusplus > 201703L && __cpp_lib_concepts
+#if __cplusplus > 201703L && __glibcxx_concepts
     requires requires { { __y.base() < __x.base() } -> convertible_to<bool>; }
 #endif
     { return __y < __x; }
@@ -1729,7 +1723,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     inline _GLIBCXX17_CONSTEXPR bool
     operator>=(const move_iterator<_IteratorL>& __x,
 	       const move_iterator<_IteratorR>& __y)
-#if __cplusplus > 201703L && __cpp_lib_concepts
+#if __cplusplus > 201703L && __glibcxx_concepts
     requires requires { { __x.base() < __y.base() } -> convertible_to<bool>; }
 #endif
     { return !(__x < __y); }
@@ -1827,7 +1821,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     __make_move_if_noexcept_iterator(_Tp* __i)
     { return _ReturnType(__i); }
 
-#if __cplusplus > 201703L && __cpp_lib_concepts
+#if __cplusplus > 201703L && __glibcxx_concepts
   // [iterators.common] Common iterators
 
   namespace __detail
diff --git a/libstdc++-v3/include/bits/stl_list.h b/libstdc++-v3/include/bits/stl_list.h
index 82256b7f1c5..6192f227dbd 100644
--- a/libstdc++-v3/include/bits/stl_list.h
+++ b/libstdc++-v3/include/bits/stl_list.h
@@ -65,9 +65,6 @@
 #include <ext/aligned_buffer.h>
 #endif
 
-#define __glibcxx_want_list_remove_return_type
-#include <bits/version.h>
-
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -1764,7 +1761,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
 #endif
 
     private:
-#ifdef __cpp_lib_list_remove_return_type // C++ >= 20 && HOSTED
+#ifdef __glibcxx_list_remove_return_type // C++ >= 20 && HOSTED
       typedef size_type __remove_return_type;
 # define _GLIBCXX_LIST_REMOVE_RETURN_TYPE_TAG \
       __attribute__((__abi_tag__("__cxx20")))
diff --git a/libstdc++-v3/include/bits/stl_map.h b/libstdc++-v3/include/bits/stl_map.h
index 02cce9b37d8..1221bb9c59f 100644
--- a/libstdc++-v3/include/bits/stl_map.h
+++ b/libstdc++-v3/include/bits/stl_map.h
@@ -63,9 +63,6 @@
 #include <tuple>
 #endif
 
-#define __glibcxx_want_map_try_emplace
-#include <bits/version.h>
-
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -699,7 +696,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
 	{ merge(__source); }
 #endif // C++17
 
-#ifdef __cpp_lib_map_try_emplace // C++ >= 17 && HOSTED
+#ifdef __glibcxx_map_try_emplace // C++ >= 17 && HOSTED
       /**
        *  @brief Attempts to build and insert a std::pair into the %map.
        *
diff --git a/libstdc++-v3/include/bits/stl_pair.h b/libstdc++-v3/include/bits/stl_pair.h
index 197a90987e6..0f1495aad73 100644
--- a/libstdc++-v3/include/bits/stl_pair.h
+++ b/libstdc++-v3/include/bits/stl_pair.h
@@ -65,10 +65,6 @@
 # include <compare>
 #endif
 
-#define __glibcxx_want_constexpr_utility
-#define __glibcxx_want_tuples_by_type
-#include <bits/version.h>
-
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -1054,7 +1050,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     { return __pair_get<_Int>::__const_move_get(std::move(__in)); }
 
 
-#ifdef __cpp_lib_tuples_by_type // C++ >= 14
+#ifdef __glibcxx_tuples_by_type // C++ >= 14
   template <typename _Tp, typename _Up>
     constexpr _Tp&
     get(pair<_Tp, _Up>& __p) noexcept
@@ -1094,7 +1090,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     constexpr const _Tp&&
     get(const pair<_Up, _Tp>&& __p) noexcept
     { return std::move(__p.second); }
-#endif // __cpp_lib_tuples_by_type
+#endif // __glibcxx_tuples_by_type
 
 
 #if __cplusplus > 202002L
diff --git a/libstdc++-v3/include/bits/stl_queue.h b/libstdc++-v3/include/bits/stl_queue.h
index 1d22578eb1e..63373f3a7f4 100644
--- a/libstdc++-v3/include/bits/stl_queue.h
+++ b/libstdc++-v3/include/bits/stl_queue.h
@@ -62,9 +62,6 @@
 # include <bits/uses_allocator.h>
 #endif
 
-#define __glibcxx_want_adaptor_iterator_pair_constructor
-#include <bits/version.h>
-
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -199,7 +196,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 	: c(std::move(__q.c), __a) { }
 #endif
 
-#ifdef __cpp_lib_adaptor_iterator_pair_constructor // C++ >= 23 && HOSTED
+#ifdef __glibcxx_adaptor_iterator_pair_constructor // C++ >= 23 && HOSTED
       template<typename _InputIterator,
 	       typename = _RequireInputIter<_InputIterator>>
 	queue(_InputIterator __first, _InputIterator __last)
@@ -347,7 +344,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     queue(_Container, _Allocator)
     -> queue<typename _Container::value_type, _Container>;
 
-#ifdef __cpp_lib_adaptor_iterator_pair_constructor
+#ifdef __glibcxx_adaptor_iterator_pair_constructor
   template<typename _InputIterator,
 	   typename _ValT
 	     = typename iterator_traits<_InputIterator>::value_type,
diff --git a/libstdc++-v3/include/bits/stl_stack.h b/libstdc++-v3/include/bits/stl_stack.h
index 2d09098ca86..4a211e452e6 100644
--- a/libstdc++-v3/include/bits/stl_stack.h
+++ b/libstdc++-v3/include/bits/stl_stack.h
@@ -62,9 +62,6 @@
 # include <bits/uses_allocator.h>
 #endif
 
-#define __glibcxx_want_adaptor_iterator_pair_constructor
-#include <bits/version.h>
-
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -173,7 +170,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       stack(_Sequence&& __c)
       : c(std::move(__c)) { }
 
-#ifdef __cpp_lib_adaptor_iterator_pair_constructor // C++ >= 23 && HOSTED
+#ifdef __glibcxx_adaptor_iterator_pair_constructor // C++ >= 23 && HOSTED
       template<typename _InputIterator,
 	       typename = _RequireInputIter<_InputIterator>>
 	stack(_InputIterator __first, _InputIterator __last)
@@ -322,7 +319,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     stack(_Container, _Allocator)
     -> stack<typename _Container::value_type, _Container>;
 
-#ifdef __cpp_lib_adaptor_iterator_pair_constructor
+#ifdef __glibcxx_adaptor_iterator_pair_constructor
   template<typename _InputIterator,
 	   typename _ValT
 	     = typename iterator_traits<_InputIterator>::value_type,
diff --git a/libstdc++-v3/include/bits/stl_tree.h b/libstdc++-v3/include/bits/stl_tree.h
index 1cf887b028e..943bedb57f6 100644
--- a/libstdc++-v3/include/bits/stl_tree.h
+++ b/libstdc++-v3/include/bits/stl_tree.h
@@ -72,9 +72,6 @@
 # include <bits/node_handle.h>
 #endif
 
-#define __glibcxx_want_generic_associative_lookup
-#include <bits/version.h>
-
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
diff --git a/libstdc++-v3/include/bits/stl_uninitialized.h b/libstdc++-v3/include/bits/stl_uninitialized.h
index 5174cfbcbe2..1282af3bc43 100644
--- a/libstdc++-v3/include/bits/stl_uninitialized.h
+++ b/libstdc++-v3/include/bits/stl_uninitialized.h
@@ -67,9 +67,6 @@
 #include <bits/stl_pair.h>
 #endif
 
-#define __glibcxx_want_raw_memory_algorithms
-#include <bits/version.h>
-
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -966,7 +963,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   /// @endcond
 #endif
 
-#ifdef __cpp_lib_raw_memory_algorithms // C++ >= 17
+#ifdef __glibcxx_raw_memory_algorithms // C++ >= 17
   /**
    *  @brief Default-initializes objects in the range [first,last).
    *  @param  __first  A forward iterator.
@@ -1059,7 +1056,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 	 __count, __result);
       return {__res.first.base(), __res.second};
     }
-#endif // __cpp_lib_raw_memory_algorithms
+#endif // __glibcxx_raw_memory_algorithms
 
 #if __cplusplus >= 201103L
   /// @cond undocumented
diff --git a/libstdc++-v3/include/bits/stl_vector.h b/libstdc++-v3/include/bits/stl_vector.h
index 1a353397e07..5e18f6eedce 100644
--- a/libstdc++-v3/include/bits/stl_vector.h
+++ b/libstdc++-v3/include/bits/stl_vector.h
@@ -66,9 +66,6 @@
 # include <compare>
 #endif
 
-#define __glibcxx_want_constexpr_vector
-#include <bits/version.h>
-
 #include <debug/assertions.h>
 
 #if _GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_VECTOR
diff --git a/libstdc++-v3/include/bits/unique_ptr.h b/libstdc++-v3/include/bits/unique_ptr.h
index d92fe79e2f2..164f5f7e945 100644
--- a/libstdc++-v3/include/bits/unique_ptr.h
+++ b/libstdc++-v3/include/bits/unique_ptr.h
@@ -44,10 +44,6 @@
 # endif
 #endif
 
-#define __glibcxx_want_constexpr_memory
-#define __glibcxx_want_make_unique
-#include <bits/version.h>
-
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -1027,7 +1023,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       public __uniq_ptr_hash<unique_ptr<_Tp, _Dp>>
     { };
 
-#ifdef __cpp_lib_make_unique // C++ >= 14 && HOSTED
+#ifdef __glibcxx_make_unique // C++ >= 14 && HOSTED
   /// @cond undocumented
 namespace __detail
 {
diff --git a/libstdc++-v3/include/bits/unordered_map.h b/libstdc++-v3/include/bits/unordered_map.h
index 4c9a6bae2fd..1c99a83bc1e 100644
--- a/libstdc++-v3/include/bits/unordered_map.h
+++ b/libstdc++-v3/include/bits/unordered_map.h
@@ -35,9 +35,6 @@
 #include <bits/functional_hash.h> // hash
 #include <bits/stl_function.h>    // equal_to
 
-#define __glibcxx_want_unordered_map_try_emplace
-#include <bits/version.h>
-
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -454,7 +451,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       { return _M_h._M_reinsert_node(std::move(__nh)).position; }
 #endif // C++17
 
-#ifdef __cpp_lib_unordered_map_try_emplace // C++ >= 17 && HOSTED
+#ifdef __glibcxx_unordered_map_try_emplace // C++ >= 17 && HOSTED
       /**
        *  @brief Attempts to build and insert a std::pair into the
        *  %unordered_map.
@@ -538,7 +535,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
 	  return _M_h.try_emplace(__hint, std::move(__k),
 				  std::forward<_Args>(__args)...).first;
 	}
-#endif // __cpp_lib_unordered_map_try_emplace
+#endif // __glibcxx_unordered_map_try_emplace
 
       ///@{
       /**
diff --git a/libstdc++-v3/include/bits/uses_allocator_args.h b/libstdc++-v3/include/bits/uses_allocator_args.h
index a4eae74d5e9..ede11db5b46 100644
--- a/libstdc++-v3/include/bits/uses_allocator_args.h
+++ b/libstdc++-v3/include/bits/uses_allocator_args.h
@@ -32,10 +32,9 @@
 
 #pragma GCC system_header
 
-#define __glibcxx_want_make_obj_using_allocator
 #include <bits/version.h>
 
-#ifdef __cpp_lib_make_obj_using_allocator // C++ >= 20 && concepts
+#ifdef __glibcxx_make_obj_using_allocator // C++ >= 20 && concepts
 #include <new>			// for placement operator new
 #include <tuple>		// for tuple, make_tuple, make_from_tuple
 #include <bits/stl_construct.h> // construct_at
@@ -245,5 +244,5 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 /// @}
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace std
-#endif // __cpp_lib_make_obj_using_allocator
+#endif // __glibcxx_make_obj_using_allocator
 #endif // _USES_ALLOCATOR_ARGS
diff --git a/libstdc++-v3/include/bits/utility.h b/libstdc++-v3/include/bits/utility.h
index ebcf5ba36b2..bfcb8e78eba 100644
--- a/libstdc++-v3/include/bits/utility.h
+++ b/libstdc++-v3/include/bits/utility.h
@@ -35,11 +35,6 @@
 
 #pragma GCC system_header
 
-#define __glibcxx_want_tuple_element_t
-#define __glibcxx_want_integer_sequence
-#define __glibcxx_want_ranges_zip
-#include <bits/version.h>
-
 #if __cplusplus >= 201103L
 
 #include <type_traits>
@@ -135,7 +130,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 // _GLIBCXX_RESOLVE_LIB_DEFECTS
 // 3378. tuple_size_v/tuple_element_t should be available when
 //       tuple_size/tuple_element are
-#ifdef __cpp_lib_tuple_element_t // C++ >= 14
+#ifdef __glibcxx_tuple_element_t // C++ >= 14
   template<size_t __i, typename _Tp>
     using tuple_element_t = typename tuple_element<__i, _Tp>::type;
 #endif
@@ -160,7 +155,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 #endif
     };
 
-#ifdef __cpp_lib_integer_sequence // C++ >= 14
+#ifdef __glibcxx_integer_sequence // C++ >= 14
 
   /// Class template integer_sequence
   template<typename _Tp, _Tp... _Idx>
@@ -193,7 +188,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   /// Alias template index_sequence_for
   template<typename... _Types>
     using index_sequence_for = make_index_sequence<sizeof...(_Types)>;
-#endif // __cpp_lib_integer_sequence
+#endif // __glibcxx_integer_sequence
 
 #if __cplusplus >= 201703L
 
diff --git a/libstdc++-v3/include/std/algorithm b/libstdc++-v3/include/std/algorithm
index c6ebb86e6a9..d7fab417111 100644
--- a/libstdc++-v3/include/std/algorithm
+++ b/libstdc++-v3/include/std/algorithm
@@ -63,7 +63,15 @@
 # include <bits/ranges_algo.h>
 #endif
 
+#define __glibcxx_want_clamp
+#define __glibcxx_want_constexpr_algorithms
 #define __glibcxx_want_parallel_algorithm
+#define __glibcxx_want_ranges_contains
+#define __glibcxx_want_ranges_find_last
+#define __glibcxx_want_ranges_fold
+#define __glibcxx_want_robust_nonmodifying_seq_ops
+#define __glibcxx_want_sample
+#define __glibcxx_want_shift
 #include <bits/version.h>
 
 #if __cpp_lib_parallel_algorithm // C++ >= 17 && HOSTED
diff --git a/libstdc++-v3/include/std/array b/libstdc++-v3/include/std/array
index c4d534c3a34..d34ec5c7c43 100644
--- a/libstdc++-v3/include/std/array
+++ b/libstdc++-v3/include/std/array
@@ -45,6 +45,8 @@
 #include <bits/utility.h>      // std::index_sequence, std::tuple_size
 #include <debug/assertions.h>
 
+#define __glibcxx_want_array_constexpr
+#define __glibcxx_want_nonmember_container_access
 #define __glibcxx_want_to_array
 #include <bits/version.h>
 
diff --git a/libstdc++-v3/include/std/atomic b/libstdc++-v3/include/std/atomic
index 713ee2cc539..09bbe2a7245 100644
--- a/libstdc++-v3/include/std/atomic
+++ b/libstdc++-v3/include/std/atomic
@@ -39,9 +39,12 @@
 #else
 
 #define __glibcxx_want_atomic_is_always_lock_free
+#define __glibcxx_want_atomic_flag_test
 #define __glibcxx_want_atomic_float
 #define __glibcxx_want_atomic_ref
 #define __glibcxx_want_atomic_lock_free_type_aliases
+#define __glibcxx_want_atomic_value_initialization
+#define __glibcxx_want_atomic_wait
 #include <bits/version.h>
 
 #include <bits/atomic_base.h>
diff --git a/libstdc++-v3/include/std/chrono b/libstdc++-v3/include/std/chrono
index 10bdd1c4ede..e4ba6eafceb 100644
--- a/libstdc++-v3/include/std/chrono
+++ b/libstdc++-v3/include/std/chrono
@@ -50,6 +50,10 @@
 # include <bits/unique_ptr.h>
 #endif
 
+#define __glibcxx_want_chrono
+#define __glibcxx_want_chrono_udls
+#include <bits/version.h>
+
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
diff --git a/libstdc++-v3/include/std/condition_variable b/libstdc++-v3/include/std/condition_variable
index 5ed4d3b2519..a4c4f8400ec 100644
--- a/libstdc++-v3/include/std/condition_variable
+++ b/libstdc++-v3/include/std/condition_variable
@@ -363,7 +363,7 @@ _GLIBCXX_BEGIN_INLINE_ABI_NAMESPACE(_V2)
 	       const chrono::duration<_Rep, _Period>& __rtime, _Predicate __p)
       { return wait_until(__lock, __clock_t::now() + __rtime, std::move(__p)); }
 
-#ifdef __cpp_lib_jthread
+#ifdef __glibcxx_jthread
     template <class _Lock, class _Predicate>
     bool wait(_Lock& __lock,
               stop_token __stoken,
diff --git a/libstdc++-v3/include/std/deque b/libstdc++-v3/include/std/deque
index c0b05ddfc64..e48dc9968e8 100644
--- a/libstdc++-v3/include/std/deque
+++ b/libstdc++-v3/include/std/deque
@@ -69,6 +69,7 @@
 #include <bits/deque.tcc>
 
 #define __glibcxx_want_erase_if
+#define __glibcxx_want_nonmember_container_access
 #include <bits/version.h>
 
 #ifdef _GLIBCXX_DEBUG
diff --git a/libstdc++-v3/include/std/format b/libstdc++-v3/include/std/format
index 1e7172575ec..8ec1c8a0b9a 100644
--- a/libstdc++-v3/include/std/format
+++ b/libstdc++-v3/include/std/format
@@ -34,6 +34,7 @@
 #include <bits/requires_hosted.h> // for std::string
 
 #define __glibcxx_want_format
+#define __glibcxx_want_format_ranges
 #include <bits/version.h>
 
 #ifdef __cpp_lib_format // C++ >= 20 && HOSTED
@@ -2041,7 +2042,7 @@ namespace __format
     };
 #endif
 
-#if defined __cpp_lib_to_chars
+#if defined __glibcxx_to_chars
   /// Format a floating-point value.
   template<__format::__formattable_float _Tp, __format::__char _CharT>
     struct formatter<_Tp, _CharT>
@@ -3246,7 +3247,7 @@ namespace __format
 	      return std::forward<_Visitor>(__vis)(_M_val._M_ll);
 	    case _Arg_ull:
 	      return std::forward<_Visitor>(__vis)(_M_val._M_ull);
-#if __cpp_lib_to_chars // FIXME: need to be able to format these types!
+#if __glibcxx_to_chars // FIXME: need to be able to format these types!
 	    case _Arg_flt:
 	      return std::forward<_Visitor>(__vis)(_M_val._M_flt);
 	    case _Arg_dbl:
diff --git a/libstdc++-v3/include/std/forward_list b/libstdc++-v3/include/std/forward_list
index bd642a16e42..0870bc22f47 100644
--- a/libstdc++-v3/include/std/forward_list
+++ b/libstdc++-v3/include/std/forward_list
@@ -46,6 +46,9 @@
 #endif
 
 #define __glibcxx_want_erase_if
+#define __glibcxx_want_incomplete_container_elements
+#define __glibcxx_want_list_remove_return_type
+#define __glibcxx_want_nonmember_container_access
 #include <bits/version.h>
 
 #if __cplusplus >= 201703L
@@ -67,7 +70,7 @@ namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
   template<typename _Tp, typename _Alloc, typename _Predicate>
-    inline typename forward_list<_Tp, _Alloc>::size_type 
+    inline typename forward_list<_Tp, _Alloc>::size_type
     erase_if(forward_list<_Tp, _Alloc>& __cont, _Predicate __pred)
     { return __cont.remove_if(__pred); }
 
diff --git a/libstdc++-v3/include/std/functional b/libstdc++-v3/include/std/functional
index 9551e38dfdb..729d11c9804 100644
--- a/libstdc++-v3/include/std/functional
+++ b/libstdc++-v3/include/std/functional
@@ -48,14 +48,6 @@
 #include <bits/c++config.h>
 #include <bits/stl_function.h> // std::equal_to, std::unary_function etc.
 
-#define __glibcxx_want_invoke
-#define __glibcxx_want_constexpr_functional
-#define __glibcxx_want_invoke_r
-#define __glibcxx_want_bind_front
-#define __glibcxx_want_not_fn
-#define __glibcxx_want_boyer_moore_searcher
-#include <bits/version.h>
-
 #if __cplusplus >= 201103L
 
 #include <tuple>
@@ -82,6 +74,17 @@
 # include <bits/move_only_function.h>
 #endif
 
+#define __glibcxx_want_boyer_moore_searcher
+#define __glibcxx_want_bind_front
+#define __glibcxx_want_constexpr_functional
+#define __glibcxx_want_invoke
+#define __glibcxx_want_invoke_r
+#define __glibcxx_want_move_only_function
+#define __glibcxx_want_not_fn
+#define __glibcxx_want_ranges
+#define __glibcxx_want_transparent_operators
+#include <bits/version.h>
+
 #endif // C++11
 
 namespace std _GLIBCXX_VISIBILITY(default)
diff --git a/libstdc++-v3/include/std/ios b/libstdc++-v3/include/std/ios
index 80be29f461e..3f4ad1c2cd6 100644
--- a/libstdc++-v3/include/std/ios
+++ b/libstdc++-v3/include/std/ios
@@ -45,4 +45,7 @@
 #include <streambuf>
 #include <bits/basic_ios.h>
 
+#define __glibcxx_want_ios_noreplace
+#include <bits/version.h>
+
 #endif	/* _GLIBCXX_IOS */
diff --git a/libstdc++-v3/include/std/iterator b/libstdc++-v3/include/std/iterator
index 8c8670fbdf0..7461efbdeb5 100644
--- a/libstdc++-v3/include/std/iterator
+++ b/libstdc++-v3/include/std/iterator
@@ -67,7 +67,14 @@
 #endif
 #include <bits/range_access.h>
 
+#define __glibcxx_want_array_constexpr
+#define __glibcxx_want_constexpr_iterator
+#define __glibcxx_want_make_reverse_iterator
+#define __glibcxx_want_move_iterator_concept
+#define __glibcxx_want_nonmember_container_access
 #define __glibcxx_want_null_iterators
+#define __glibcxx_want_ranges
+#define __glibcxx_want_ssize
 #include <bits/version.h>
 
 #if __cplusplus >= 202002L
diff --git a/libstdc++-v3/include/std/list b/libstdc++-v3/include/std/list
index 98415919dd4..b5185a9dec2 100644
--- a/libstdc++-v3/include/std/list
+++ b/libstdc++-v3/include/std/list
@@ -70,6 +70,9 @@
 #endif
 
 #define __glibcxx_want_erase_if
+#define __glibcxx_want_incomplete_container_elements
+#define __glibcxx_want_list_remove_return_type
+#define __glibcxx_want_nonmember_container_access
 #include <bits/version.h>
 
 #if __cplusplus >= 201703L
diff --git a/libstdc++-v3/include/std/map b/libstdc++-v3/include/std/map
index a0f3fce7b28..008d8d3bdef 100644
--- a/libstdc++-v3/include/std/map
+++ b/libstdc++-v3/include/std/map
@@ -69,6 +69,13 @@
 # include <debug/map>
 #endif
 
+#define __glibcxx_want_erase_if
+#define __glibcxx_want_generic_associative_lookup
+#define __glibcxx_want_map_try_emplace
+#define __glibcxx_want_node_extract
+#define __glibcxx_want_nonmember_container_access
+#include <bits/version.h>
+
 #if __cplusplus >= 201703L
 #include <bits/memory_resource.h>
 namespace std _GLIBCXX_VISIBILITY(default)
diff --git a/libstdc++-v3/include/std/memory b/libstdc++-v3/include/std/memory
index 3cce72cc036..ac83761a26c 100644
--- a/libstdc++-v3/include/std/memory
+++ b/libstdc++-v3/include/std/memory
@@ -91,8 +91,22 @@
 #  include <bits/uses_allocator_args.h>
 #endif
 
+#define __glibcxx_want_allocator_traits_is_always_equal
+#define __glibcxx_want_assume_aligned
+#define __glibcxx_want_atomic_shared_ptr
 #define __glibcxx_want_atomic_value_initialization
+#define __glibcxx_want_constexpr_dynamic_alloc
+#define __glibcxx_want_constexpr_memory
+#define __glibcxx_want_enable_shared_from_this
+#define __glibcxx_want_make_unique
 #define __glibcxx_want_parallel_algorithm
+#define __glibcxx_want_ranges
+#define __glibcxx_want_raw_memory_algorithms
+#define __glibcxx_want_shared_ptr_arrays
+#define __glibcxx_want_shared_ptr_weak_type
+#define __glibcxx_want_smart_ptr_for_overwrite
+#define __glibcxx_want_to_address
+#define __glibcxx_want_transparent_operators
 #include <bits/version.h>
 
 #if __cplusplus >= 201103L && __cplusplus <= 202002L && _GLIBCXX_HOSTED
diff --git a/libstdc++-v3/include/std/numeric b/libstdc++-v3/include/std/numeric
index 8c8d200021f..559e6242e92 100644
--- a/libstdc++-v3/include/std/numeric
+++ b/libstdc++-v3/include/std/numeric
@@ -85,6 +85,7 @@
 #define __glibcxx_want_interpolate
 #define __glibcxx_want_lcm
 #define __glibcxx_want_parallel_algorithm
+#define __glibcxx_want_ranges_iota
 #include <bits/version.h>
 
 /**
diff --git a/libstdc++-v3/include/std/queue b/libstdc++-v3/include/std/queue
index ec620ac6d62..8980ba8a578 100644
--- a/libstdc++-v3/include/std/queue
+++ b/libstdc++-v3/include/std/queue
@@ -65,4 +65,7 @@
 #include <bits/stl_function.h>
 #include <bits/stl_queue.h>
 
+#define __glibcxx_want_adaptor_iterator_pair_constructor
+#include <bits/version.h>
+
 #endif /* _GLIBCXX_QUEUE */
diff --git a/libstdc++-v3/include/std/ranges b/libstdc++-v3/include/std/ranges
index 41f95dc8f78..26d6c013ad0 100644
--- a/libstdc++-v3/include/std/ranges
+++ b/libstdc++-v3/include/std/ranges
@@ -51,6 +51,7 @@
 #include <bits/ranges_util.h>
 #include <bits/refwrap.h>
 
+#define __glibcxx_want_ranges
 #define __glibcxx_want_ranges_as_const
 #define __glibcxx_want_ranges_as_rvalue
 #define __glibcxx_want_ranges_cartesian_product
diff --git a/libstdc++-v3/include/std/regex b/libstdc++-v3/include/std/regex
index 7f63d8606f7..ff3320522c1 100644
--- a/libstdc++-v3/include/std/regex
+++ b/libstdc++-v3/include/std/regex
@@ -68,6 +68,9 @@
 #include <bits/regex.h>
 #include <bits/regex_executor.h>
 
+#define __glibcxx_want_nonmember_container_access
+#include <bits/version.h>
+
 #if __cplusplus >= 201703L && _GLIBCXX_USE_CXX11_ABI
 #include <bits/memory_resource.h>
 namespace std _GLIBCXX_VISIBILITY(default)
diff --git a/libstdc++-v3/include/std/scoped_allocator b/libstdc++-v3/include/std/scoped_allocator
index 8af432ada42..2f10479763e 100644
--- a/libstdc++-v3/include/std/scoped_allocator
+++ b/libstdc++-v3/include/std/scoped_allocator
@@ -196,7 +196,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 	using __outermost_alloc_traits
 	  = allocator_traits<typename __outermost_type<_Alloc>::type>;
 
-#if ! __cpp_lib_make_obj_using_allocator
+#if ! __glibcxx_make_obj_using_allocator
       template<typename _Tp, typename... _Args>
         void
         _M_construct(__uses_alloc0, _Tp* __p, _Args&&... __args)
@@ -373,7 +373,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       size_type max_size() const
       { return __traits::max_size(outer_allocator()); }
 
-#if ! __cpp_lib_make_obj_using_allocator
+#if ! __glibcxx_make_obj_using_allocator
       template<typename _Tp, typename... _Args>
 	typename __not_pair<_Tp>::type
 	construct(_Tp* __p, _Args&&... __args)
@@ -473,7 +473,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
                  const scoped_allocator_adaptor<_OutA2, _InA...>& __b) noexcept;
 
     private:
-#if ! __cpp_lib_make_obj_using_allocator
+#if ! __glibcxx_make_obj_using_allocator
       template<typename _Ind, typename... _Args>
 	tuple<_Args&&...>
 	_M_construct_p(__uses_alloc0, _Ind, tuple<_Args...>& __t)
diff --git a/libstdc++-v3/include/std/set b/libstdc++-v3/include/std/set
index 5641b791668..55cabda0c2e 100644
--- a/libstdc++-v3/include/std/set
+++ b/libstdc++-v3/include/std/set
@@ -69,6 +69,12 @@
 # include <debug/set>
 #endif
 
+#define __glibcxx_want_erase_if
+#define __glibcxx_want_generic_associative_lookup
+#define __glibcxx_want_node_extract
+#define __glibcxx_want_nonmember_container_access
+#include <bits/version.h>
+
 #if __cplusplus >= 201703L
 #include <bits/memory_resource.h>
 namespace std _GLIBCXX_VISIBILITY(default)
diff --git a/libstdc++-v3/include/std/stack b/libstdc++-v3/include/std/stack
index 4cc89f0d585..dda18b6222e 100644
--- a/libstdc++-v3/include/std/stack
+++ b/libstdc++-v3/include/std/stack
@@ -62,4 +62,7 @@
 #include <deque>
 #include <bits/stl_stack.h>
 
+#define __glibcxx_want_adaptor_iterator_pair_constructor
+#include <bits/version.h>
+
 #endif /* _GLIBCXX_STACK */
diff --git a/libstdc++-v3/include/std/stop_token b/libstdc++-v3/include/std/stop_token
index 3be0f5a3ac4..fce1cf59b88 100644
--- a/libstdc++-v3/include/std/stop_token
+++ b/libstdc++-v3/include/std/stop_token
@@ -109,7 +109,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       this_thread::yield();
     }
 
-#ifndef __cpp_lib_semaphore
+#ifndef __glibcxx_semaphore
     struct binary_semaphore
     {
       explicit binary_semaphore(int __d) : _M_counter(__d > 0) { }
diff --git a/libstdc++-v3/include/std/string b/libstdc++-v3/include/std/string
index 832e9d8915f..78e8bacc007 100644
--- a/libstdc++-v3/include/std/string
+++ b/libstdc++-v3/include/std/string
@@ -54,7 +54,13 @@
 #include <bits/basic_string.h>
 #include <bits/basic_string.tcc>
 
+#define __glibcxx_want_constexpr_char_traits
+#define __glibcxx_want_constexpr_string
 #define __glibcxx_want_erase_if
+#define __glibcxx_want_nonmember_container_access
+#define __glibcxx_want_string_resize_and_overwrite
+#define __glibcxx_want_string_udls
+#define __glibcxx_want_to_string
 #include <bits/version.h>
 
 #if __cplusplus >= 201703L && _GLIBCXX_USE_CXX11_ABI
diff --git a/libstdc++-v3/include/std/string_view b/libstdc++-v3/include/std/string_view
index cf288ed3a36..cbb6bb0928f 100644
--- a/libstdc++-v3/include/std/string_view
+++ b/libstdc++-v3/include/std/string_view
@@ -35,6 +35,7 @@
 
 #pragma GCC system_header
 
+#define __glibcxx_want_constexpr_char_traits
 #define __glibcxx_want_string_view
 #define __glibcxx_want_constexpr_string_view
 #define __glibcxx_want_starts_ends_with
diff --git a/libstdc++-v3/include/std/tuple b/libstdc++-v3/include/std/tuple
index 797d8c03112..f2e008be34f 100644
--- a/libstdc++-v3/include/std/tuple
+++ b/libstdc++-v3/include/std/tuple
@@ -45,9 +45,11 @@
 #endif
 
 #define __glibcxx_want_constexpr_tuple
+#define __glibcxx_want_tuple_element_t
 #define __glibcxx_want_tuples_by_type
 #define __glibcxx_want_apply
 #define __glibcxx_want_make_from_tuple
+#define __glibcxx_want_ranges_zip
 #include <bits/version.h>
 
 namespace std _GLIBCXX_VISIBILITY(default)
diff --git a/libstdc++-v3/include/std/unordered_map b/libstdc++-v3/include/std/unordered_map
index b72845be18e..ec92492e8ed 100644
--- a/libstdc++-v3/include/std/unordered_map
+++ b/libstdc++-v3/include/std/unordered_map
@@ -46,6 +46,13 @@
 # include <debug/unordered_map>
 #endif
 
+#define __glibcxx_want_erase_if
+#define __glibcxx_want_generic_unordered_lookup
+#define __glibcxx_want_node_extract
+#define __glibcxx_want_nonmember_container_access
+#define __glibcxx_want_unordered_map_try_emplace
+#include <bits/version.h>
+
 #if __cplusplus >= 201703L
 #include <bits/memory_resource.h>
 namespace std _GLIBCXX_VISIBILITY(default)
diff --git a/libstdc++-v3/include/std/unordered_set b/libstdc++-v3/include/std/unordered_set
index 22a1c7ca24d..b77b6229fc2 100644
--- a/libstdc++-v3/include/std/unordered_set
+++ b/libstdc++-v3/include/std/unordered_set
@@ -46,6 +46,12 @@
 # include <debug/unordered_set>
 #endif
 
+#define __glibcxx_want_erase_if
+#define __glibcxx_want_generic_unordered_lookup
+#define __glibcxx_want_node_extract
+#define __glibcxx_want_nonmember_container_access
+#include <bits/version.h>
+
 #if __cplusplus >= 201703L
 #include <bits/memory_resource.h>
 namespace std _GLIBCXX_VISIBILITY(default)
diff --git a/libstdc++-v3/include/std/utility b/libstdc++-v3/include/std/utility
index bdaf5d4c31b..18bef7adccd 100644
--- a/libstdc++-v3/include/std/utility
+++ b/libstdc++-v3/include/std/utility
@@ -68,15 +68,6 @@
 #include <bits/stl_relops.h>
 #include <bits/stl_pair.h>
 
-#define __glibcxx_want_as_const
-#define __glibcxx_want_constexpr_algorithms
-#define __glibcxx_want_exchange_function
-#define __glibcxx_want_forward_like
-#define __glibcxx_want_integer_comparison_functions
-#define __glibcxx_want_to_underlying
-#define __glibcxx_want_unreachable
-#include <bits/version.h>
-
 #if __cplusplus >= 201103L
 
 #include <initializer_list>
@@ -88,6 +79,21 @@
 #include <ext/numeric_traits.h> // __is_standard_integer, __int_traits
 #endif
 
+#define __glibcxx_want_addressof_constexpr
+#define __glibcxx_want_as_const
+#define __glibcxx_want_constexpr_algorithms
+#define __glibcxx_want_constexpr_utility
+#define __glibcxx_want_exchange_function
+#define __glibcxx_want_forward_like
+#define __glibcxx_want_integer_comparison_functions
+#define __glibcxx_want_integer_sequence
+#define __glibcxx_want_ranges_zip
+#define __glibcxx_want_to_underlying
+#define __glibcxx_want_tuple_element_t
+#define __glibcxx_want_tuples_by_type
+#define __glibcxx_want_unreachable
+#include <bits/version.h>
+
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
diff --git a/libstdc++-v3/include/std/vector b/libstdc++-v3/include/std/vector
index ecd9f7108f6..5e1d54a04ac 100644
--- a/libstdc++-v3/include/std/vector
+++ b/libstdc++-v3/include/std/vector
@@ -76,7 +76,10 @@
 # include <debug/vector>
 #endif
 
+#define __glibcxx_want_constexpr_vector
 #define __glibcxx_want_erase_if
+#define __glibcxx_want_incomplete_container_elements
+#define __glibcxx_want_nonmember_container_access
 #include <bits/version.h>
 
 #if __cplusplus >= 201703L
