[libcxx-commits] [libcxx] f84dbd2 - [libc++] Enable the synchronization library on Apple platforms

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jun 11 09:45:28 PDT 2021


Author: Louis Dionne
Date: 2021-06-11T12:45:18-04:00
New Revision: f84dbd2f2befb628ac2ac151fed495d70a2d05be

URL: https://github.com/llvm/llvm-project/commit/f84dbd2f2befb628ac2ac151fed495d70a2d05be
DIFF: https://github.com/llvm/llvm-project/commit/f84dbd2f2befb628ac2ac151fed495d70a2d05be.diff

LOG: [libc++] Enable the synchronization library on Apple platforms

The synchronization library was marked as disabled on Apple platforms
up to now because we were not 100% sure that it was going to be ABI
stable. However, it's been some time since we shipped it in upstream
libc++ now and there's been no changes so far. This patch enables the
synchronization library on Apple platforms, and hence commits the ABI
stability as far as that vendor is concerned.

Differential Revision: https://reviews.llvm.org/D96790

Added: 
    

Modified: 
    libcxx/include/__availability
    libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_wait.pass.cpp
    libcxx/test/std/thread/thread.barrier/arrive.pass.cpp
    libcxx/test/std/thread/thread.barrier/arrive_and_drop.pass.cpp
    libcxx/test/std/thread/thread.barrier/arrive_and_wait.pass.cpp
    libcxx/test/std/thread/thread.barrier/completion.pass.cpp
    libcxx/test/std/thread/thread.latch/arrive_and_wait.pass.cpp
    libcxx/test/std/thread/thread.latch/count_down.pass.cpp
    libcxx/test/std/thread/thread.latch/try_wait.pass.cpp
    libcxx/test/std/thread/thread.semaphore/acquire.pass.cpp
    libcxx/test/std/thread/thread.semaphore/binary.pass.cpp
    libcxx/test/std/thread/thread.semaphore/release.pass.cpp
    libcxx/test/std/thread/thread.semaphore/timed.pass.cpp
    libcxx/test/std/thread/thread.semaphore/try_acquire.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/include/__availability b/libcxx/include/__availability
index 9d488f00ebb32..13d11950fd67a 100644
--- a/libcxx/include/__availability
+++ b/libcxx/include/__availability
@@ -222,13 +222,20 @@
 #   define _LIBCPP_AVAILABILITY_TO_CHARS                                        \
         _LIBCPP_AVAILABILITY_FILESYSTEM
 
-    // Note: Those are not ABI-stable yet, so we can't ship them.
 #   define _LIBCPP_AVAILABILITY_SYNC                                            \
-        __attribute__((unavailable))
-#   define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_atomic_wait
-#   define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_barrier
-#   define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_latch
-#   define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_semaphore
+        __attribute__((availability(macosx,strict,introduced=11.0)))            \
+        __attribute__((availability(ios,strict,introduced=14.0)))               \
+        __attribute__((availability(tvos,strict,introduced=14.0)))              \
+        __attribute__((availability(watchos,strict,introduced=7.0)))
+#   if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 110000) ||    \
+        (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 140000) || \
+        (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 140000) ||         \
+        (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 70000)
+#       define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_atomic_wait
+#       define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_barrier
+#       define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_latch
+#       define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_semaphore
+#   endif
 
     // This controls the availability of the C++20 format library.
     // The library is in development and not ABI stable yet. Currently

diff  --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_wait.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_wait.pass.cpp
index 6ee418af1f2e7..ce7b023f8d0a3 100644
--- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_wait.pass.cpp
+++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_wait.pass.cpp
@@ -10,9 +10,8 @@
 // XFAIL: c++03
 // XFAIL: !non-lockfree-atomics
 
-// This test requires the dylib support introduced in D68480,
-// which hasn't shipped yet.
-// XFAIL: use_system_cxx_lib && x86_64-apple
+// This test requires the dylib support introduced in D68480, which shipped in
+// macOS 11.0.
 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.15
 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.14
 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.13

diff  --git a/libcxx/test/std/thread/thread.barrier/arrive.pass.cpp b/libcxx/test/std/thread/thread.barrier/arrive.pass.cpp
index c0a8f4a19b02a..e19695e760c57 100644
--- a/libcxx/test/std/thread/thread.barrier/arrive.pass.cpp
+++ b/libcxx/test/std/thread/thread.barrier/arrive.pass.cpp
@@ -9,9 +9,8 @@
 // UNSUPPORTED: libcpp-has-no-threads
 // UNSUPPORTED: c++03, c++11
 
-// This test requires the dylib support introduced in D68480,
-// which hasn't shipped yet.
-// XFAIL: use_system_cxx_lib && x86_64-apple
+// This test requires the dylib support introduced in D68480, which shipped in
+// macOS 11.0.
 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.15
 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.14
 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.13

diff  --git a/libcxx/test/std/thread/thread.barrier/arrive_and_drop.pass.cpp b/libcxx/test/std/thread/thread.barrier/arrive_and_drop.pass.cpp
index 324c28074613a..7f6ce35396040 100644
--- a/libcxx/test/std/thread/thread.barrier/arrive_and_drop.pass.cpp
+++ b/libcxx/test/std/thread/thread.barrier/arrive_and_drop.pass.cpp
@@ -9,9 +9,8 @@
 // UNSUPPORTED: libcpp-has-no-threads
 // UNSUPPORTED: c++03, c++11
 
-// This test requires the dylib support introduced in D68480,
-// which hasn't shipped yet.
-// XFAIL: use_system_cxx_lib && x86_64-apple
+// This test requires the dylib support introduced in D68480, which shipped in
+// macOS 11.0.
 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.15
 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.14
 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.13

diff  --git a/libcxx/test/std/thread/thread.barrier/arrive_and_wait.pass.cpp b/libcxx/test/std/thread/thread.barrier/arrive_and_wait.pass.cpp
index bea9c58b93b29..920281981e46a 100644
--- a/libcxx/test/std/thread/thread.barrier/arrive_and_wait.pass.cpp
+++ b/libcxx/test/std/thread/thread.barrier/arrive_and_wait.pass.cpp
@@ -9,9 +9,8 @@
 // UNSUPPORTED: libcpp-has-no-threads
 // UNSUPPORTED: c++03, c++11
 
-// This test requires the dylib support introduced in D68480,
-// which hasn't shipped yet.
-// XFAIL: use_system_cxx_lib && x86_64-apple
+// This test requires the dylib support introduced in D68480, which shipped in
+// macOS 11.0.
 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.15
 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.14
 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.13

diff  --git a/libcxx/test/std/thread/thread.barrier/completion.pass.cpp b/libcxx/test/std/thread/thread.barrier/completion.pass.cpp
index 77371e096615e..abbfb869895ce 100644
--- a/libcxx/test/std/thread/thread.barrier/completion.pass.cpp
+++ b/libcxx/test/std/thread/thread.barrier/completion.pass.cpp
@@ -9,9 +9,8 @@
 // UNSUPPORTED: libcpp-has-no-threads
 // UNSUPPORTED: c++03, c++11
 
-// This test requires the dylib support introduced in D68480,
-// which hasn't shipped yet.
-// XFAIL: use_system_cxx_lib && x86_64-apple
+// This test requires the dylib support introduced in D68480, which shipped in
+// macOS 11.0.
 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.15
 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.14
 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.13

diff  --git a/libcxx/test/std/thread/thread.latch/arrive_and_wait.pass.cpp b/libcxx/test/std/thread/thread.latch/arrive_and_wait.pass.cpp
index 66967bd7c6a23..69160fe89a8e2 100644
--- a/libcxx/test/std/thread/thread.latch/arrive_and_wait.pass.cpp
+++ b/libcxx/test/std/thread/thread.latch/arrive_and_wait.pass.cpp
@@ -9,9 +9,8 @@
 // UNSUPPORTED: libcpp-has-no-threads
 // UNSUPPORTED: c++03, c++11
 
-// This test requires the dylib support introduced in D68480,
-// which hasn't shipped yet.
-// XFAIL: use_system_cxx_lib && x86_64-apple
+// This test requires the dylib support introduced in D68480, which shipped in
+// macOS 11.0.
 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.15
 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.14
 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.13

diff  --git a/libcxx/test/std/thread/thread.latch/count_down.pass.cpp b/libcxx/test/std/thread/thread.latch/count_down.pass.cpp
index 06134144b89ed..e33590f1c78af 100644
--- a/libcxx/test/std/thread/thread.latch/count_down.pass.cpp
+++ b/libcxx/test/std/thread/thread.latch/count_down.pass.cpp
@@ -9,9 +9,8 @@
 // UNSUPPORTED: libcpp-has-no-threads
 // UNSUPPORTED: c++03, c++11
 
-// This test requires the dylib support introduced in D68480,
-// which hasn't shipped yet.
-// XFAIL: use_system_cxx_lib && x86_64-apple
+// This test requires the dylib support introduced in D68480, which shipped in
+// macOS 11.0.
 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.15
 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.14
 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.13

diff  --git a/libcxx/test/std/thread/thread.latch/try_wait.pass.cpp b/libcxx/test/std/thread/thread.latch/try_wait.pass.cpp
index 38de7a0fbcfa5..8283aa3546a10 100644
--- a/libcxx/test/std/thread/thread.latch/try_wait.pass.cpp
+++ b/libcxx/test/std/thread/thread.latch/try_wait.pass.cpp
@@ -9,9 +9,8 @@
 // UNSUPPORTED: libcpp-has-no-threads
 // UNSUPPORTED: c++03, c++11
 
-// This test requires the dylib support introduced in D68480,
-// which hasn't shipped yet.
-// XFAIL: use_system_cxx_lib && x86_64-apple
+// This test requires the dylib support introduced in D68480, which shipped in
+// macOS 11.0.
 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.15
 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.14
 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.13

diff  --git a/libcxx/test/std/thread/thread.semaphore/acquire.pass.cpp b/libcxx/test/std/thread/thread.semaphore/acquire.pass.cpp
index 290635883798c..547594b71e591 100644
--- a/libcxx/test/std/thread/thread.semaphore/acquire.pass.cpp
+++ b/libcxx/test/std/thread/thread.semaphore/acquire.pass.cpp
@@ -9,9 +9,8 @@
 // UNSUPPORTED: libcpp-has-no-threads
 // UNSUPPORTED: c++03, c++11
 
-// This test requires the dylib support introduced in D68480,
-// which hasn't shipped yet.
-// XFAIL: use_system_cxx_lib && x86_64-apple
+// This test requires the dylib support introduced in D68480, which shipped in
+// macOS 11.0.
 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.15
 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.14
 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.13

diff  --git a/libcxx/test/std/thread/thread.semaphore/binary.pass.cpp b/libcxx/test/std/thread/thread.semaphore/binary.pass.cpp
index 1080ed4cf2eec..2ebee35e3608f 100644
--- a/libcxx/test/std/thread/thread.semaphore/binary.pass.cpp
+++ b/libcxx/test/std/thread/thread.semaphore/binary.pass.cpp
@@ -9,9 +9,8 @@
 // UNSUPPORTED: libcpp-has-no-threads
 // UNSUPPORTED: c++03, c++11
 
-// This test requires the dylib support introduced in D68480,
-// which hasn't shipped yet.
-// XFAIL: use_system_cxx_lib && x86_64-apple
+// This test requires the dylib support introduced in D68480, which shipped in
+// macOS 11.0.
 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.15
 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.14
 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.13

diff  --git a/libcxx/test/std/thread/thread.semaphore/release.pass.cpp b/libcxx/test/std/thread/thread.semaphore/release.pass.cpp
index c61f57b68afec..76dac0cc403e2 100644
--- a/libcxx/test/std/thread/thread.semaphore/release.pass.cpp
+++ b/libcxx/test/std/thread/thread.semaphore/release.pass.cpp
@@ -9,9 +9,8 @@
 // UNSUPPORTED: libcpp-has-no-threads
 // UNSUPPORTED: c++03, c++11
 
-// This test requires the dylib support introduced in D68480,
-// which hasn't shipped yet.
-// XFAIL: use_system_cxx_lib && x86_64-apple
+// This test requires the dylib support introduced in D68480, which shipped in
+// macOS 11.0.
 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.15
 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.14
 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.13

diff  --git a/libcxx/test/std/thread/thread.semaphore/timed.pass.cpp b/libcxx/test/std/thread/thread.semaphore/timed.pass.cpp
index b0c2db1718de4..34520ecfae05d 100644
--- a/libcxx/test/std/thread/thread.semaphore/timed.pass.cpp
+++ b/libcxx/test/std/thread/thread.semaphore/timed.pass.cpp
@@ -9,9 +9,8 @@
 // UNSUPPORTED: libcpp-has-no-threads
 // UNSUPPORTED: c++03, c++11
 
-// This test requires the dylib support introduced in D68480,
-// which hasn't shipped yet.
-// XFAIL: use_system_cxx_lib && x86_64-apple
+// This test requires the dylib support introduced in D68480, which shipped in
+// macOS 11.0.
 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.15
 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.14
 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.13

diff  --git a/libcxx/test/std/thread/thread.semaphore/try_acquire.pass.cpp b/libcxx/test/std/thread/thread.semaphore/try_acquire.pass.cpp
index fb9bf4d5b0f67..f71d12f8740e8 100644
--- a/libcxx/test/std/thread/thread.semaphore/try_acquire.pass.cpp
+++ b/libcxx/test/std/thread/thread.semaphore/try_acquire.pass.cpp
@@ -9,9 +9,8 @@
 // UNSUPPORTED: libcpp-has-no-threads
 // UNSUPPORTED: c++03, c++11
 
-// This test requires the dylib support introduced in D68480,
-// which hasn't shipped yet.
-// XFAIL: use_system_cxx_lib && x86_64-apple
+// This test requires the dylib support introduced in D68480, which shipped in
+// macOS 11.0.
 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.15
 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.14
 // XFAIL: use_system_cxx_lib && x86_64-apple-macosx10.13


        


More information about the libcxx-commits mailing list