diff --git a/libcxx/include/__config b/libcxx/include/__config --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -1440,7 +1440,13 @@ #endif #if __has_attribute(init_priority) -# define _LIBCPP_INIT_PRIORITY_MAX __attribute__((init_priority(101))) + // TODO: Remove this once we drop support for building libc++ with old Clangs +# if (defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER < 1200) || \ + (defined(__apple_build_version__) && __apple_build_version__ < 12000000) +# define _LIBCPP_INIT_PRIORITY_MAX __attribute__((init_priority(101))) +# else +# define _LIBCPP_INIT_PRIORITY_MAX __attribute__((init_priority(100))) +# endif #else # define _LIBCPP_INIT_PRIORITY_MAX #endif