Skip to content

[libc++] Fill in Apple availability for LLVM 21#202347

Open
ldionne wants to merge 1 commit into
llvm:mainfrom
ldionne:review/update-apple-availability
Open

[libc++] Fill in Apple availability for LLVM 21#202347
ldionne wants to merge 1 commit into
llvm:mainfrom
ldionne:review/update-apple-availability

Conversation

@ldionne

@ldionne ldionne commented Jun 8, 2026

Copy link
Copy Markdown
Member

macOS 26.4 and aligned platforms have been released and they are roughly synchronized to libc++ 21. As a drive-by, also add missing versions for previous releases.

This also allows reverting #199682 which moved an XFAIL to UNSUPPORTED to silence CI failures temporarily.

macOS 26.4 and aligned platforms have been released and they are roughly
synchronized to libc++ 21. As a drive-by, also add missing versions for
previous releases.

This also allows reverting llvm#199682 which moved an XFAIL to UNSUPPORTED
to silence CI failures temporarily.
@ldionne ldionne requested a review from a team as a code owner June 8, 2026 14:37
@llvmorg-github-actions llvmorg-github-actions Bot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Jun 8, 2026
@llvmorg-github-actions

Copy link
Copy Markdown

@llvm/pr-subscribers-libcxx

Author: Louis Dionne (ldionne)

Changes

macOS 26.4 and aligned platforms have been released and they are roughly synchronized to libc++ 21. As a drive-by, also add missing versions for previous releases.

This also allows reverting #199682 which moved an XFAIL to UNSUPPORTED to silence CI failures temporarily.


Full diff: https://github.com/llvm/llvm-project/pull/202347.diff

3 Files Affected:

  • (modified) libcxx/include/__configuration/availability.h (+25-7)
  • (modified) libcxx/test/std/strings/basic.string/string.capacity/over_max_size.pass.cpp (+1-1)
  • (modified) libcxx/utils/libcxx/test/features/availability.py (+2-2)
diff --git a/libcxx/include/__configuration/availability.h b/libcxx/include/__configuration/availability.h
index f1a598b5206f4..395374df0b1cc 100644
--- a/libcxx/include/__configuration/availability.h
+++ b/libcxx/include/__configuration/availability.h
@@ -76,9 +76,23 @@
 #  define _LIBCPP_INTRODUCED_IN_LLVM_22_ATTRIBUTE __attribute__((unavailable))
 
 // LLVM 21
-// TODO: Fill this in
-#  define _LIBCPP_INTRODUCED_IN_LLVM_21 0
-#  define _LIBCPP_INTRODUCED_IN_LLVM_21_ATTRIBUTE __attribute__((unavailable))
+#  if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 260400) ||       \
+      (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 260400) ||     \
+      (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 260400) ||             \
+      (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 260400) ||       \
+      (defined(__ENVIRONMENT_BRIDGE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_BRIDGE_OS_VERSION_MIN_REQUIRED__ < 100400) ||     \
+      (defined(__ENVIRONMENT_DRIVERKIT_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_DRIVERKIT_VERSION_MIN_REQUIRED__ < 250400)
+#    define _LIBCPP_INTRODUCED_IN_LLVM_21 0
+#  else
+#    define _LIBCPP_INTRODUCED_IN_LLVM_21 1
+#  endif
+#  define _LIBCPP_INTRODUCED_IN_LLVM_21_ATTRIBUTE                                                                 \
+    __attribute__((availability(macos, strict, introduced = 26.4)))                                               \
+    __attribute__((availability(ios, strict, introduced = 26.4)))                                                 \
+    __attribute__((availability(tvos, strict, introduced = 26.4)))                                                \
+    __attribute__((availability(watchos, strict, introduced = 26.4)))                                             \
+    __attribute__((availability(bridgeos, strict, introduced = 10.4)))                                            \
+    __attribute__((availability(driverkit, strict, introduced = 25.4)))
 
 // LLVM 20
 //
@@ -87,7 +101,8 @@
       (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 260000) ||     \
       (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 260000) ||             \
       (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 260000) ||       \
-      (defined(__ENVIRONMENT_BRIDGE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_BRIDGE_OS_VERSION_MIN_REQUIRED__ < 100000)
+      (defined(__ENVIRONMENT_BRIDGE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_BRIDGE_OS_VERSION_MIN_REQUIRED__ < 100000) ||     \
+      (defined(__ENVIRONMENT_DRIVERKIT_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_DRIVERKIT_VERSION_MIN_REQUIRED__ < 250000)
 #    define _LIBCPP_INTRODUCED_IN_LLVM_20 0
 #  else
 #    define _LIBCPP_INTRODUCED_IN_LLVM_20 1
@@ -97,14 +112,16 @@
     __attribute__((availability(ios, strict, introduced = 26.0)))                                                 \
     __attribute__((availability(tvos, strict, introduced = 26.0)))                                                \
     __attribute__((availability(watchos, strict, introduced = 26.0)))                                             \
-    __attribute__((availability(bridgeos, strict, introduced = 10.0)))
+    __attribute__((availability(bridgeos, strict, introduced = 10.0)))                                            \
+    __attribute__((availability(driverkit, strict, introduced = 25.0)))
 
 // LLVM 19
 #  if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 150400) ||       \
       (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 180400) ||     \
       (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 180400) ||             \
       (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 110400) ||       \
-      (defined(__ENVIRONMENT_BRIDGE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_BRIDGE_OS_VERSION_MIN_REQUIRED__ < 90400)
+      (defined(__ENVIRONMENT_BRIDGE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_BRIDGE_OS_VERSION_MIN_REQUIRED__ < 90400) ||       \
+      (defined(__ENVIRONMENT_DRIVERKIT_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_DRIVERKIT_VERSION_MIN_REQUIRED__ < 240400)
 #    define _LIBCPP_INTRODUCED_IN_LLVM_19 0
 #  else
 #    define _LIBCPP_INTRODUCED_IN_LLVM_19 1
@@ -114,7 +131,8 @@
     __attribute__((availability(ios, strict, introduced = 18.4)))                                                 \
     __attribute__((availability(tvos, strict, introduced = 18.4)))                                                \
     __attribute__((availability(watchos, strict, introduced = 11.4)))                                             \
-    __attribute__((availability(bridgeos, strict, introduced = 9.4)))
+    __attribute__((availability(bridgeos, strict, introduced = 9.4)))                                             \
+    __attribute__((availability(driverkit, strict, introduced = 24.4)))
 
 // LLVM 18
 #  if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 150000) ||       \
diff --git a/libcxx/test/std/strings/basic.string/string.capacity/over_max_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.capacity/over_max_size.pass.cpp
index 8c829605f5e78..8e5919539d94e 100644
--- a/libcxx/test/std/strings/basic.string/string.capacity/over_max_size.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.capacity/over_max_size.pass.cpp
@@ -14,7 +14,7 @@
 // than it really is, and we fail to throw `length_error` from `string::resize()`,
 // which is explicitly instantiated in the built library.
 //
-// UNSUPPORTED: using-built-library-before-llvm-21
+// XFAIL: using-built-library-before-llvm-21
 
 // <string>
 
diff --git a/libcxx/utils/libcxx/test/features/availability.py b/libcxx/utils/libcxx/test/features/availability.py
index 39c6cf45a1708..374e85959333b 100644
--- a/libcxx/utils/libcxx/test/features/availability.py
+++ b/libcxx/utils/libcxx/test/features/availability.py
@@ -22,14 +22,14 @@
     Feature(
         name="_target-has-llvm-21",
         when=lambda cfg: BooleanExpression.evaluate(
-            "TBD",
+            r"_target-has-llvm-22 || target={{.+}}-apple-macosx{{26.[4-9](.\d+)?}}",
             cfg.available_features,
         ),
     ),
     Feature(
         name="_target-has-llvm-20",
         when=lambda cfg: BooleanExpression.evaluate(
-            r"_target-has-llvm-21 || target={{.+}}-apple-macosx{{26.[0-9](.\d+)?}}",
+            r"_target-has-llvm-21 || target={{.+}}-apple-macosx{{26.[0-3](.\d+)?}}",
             cfg.available_features,
         ),
     ),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants