From f84dbd2f2befb628ac2ac151fed495d70a2d05be Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Tue, 16 Feb 2021 11:24:27 -0500 Subject: [PATCH] [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 --- libcxx/include/__availability | 19 +++++++++++++------ .../atomic_wait.pass.cpp | 5 ++--- .../std/thread/thread.barrier/arrive.pass.cpp | 5 ++--- .../thread.barrier/arrive_and_drop.pass.cpp | 5 ++--- .../thread.barrier/arrive_and_wait.pass.cpp | 5 ++--- .../thread/thread.barrier/completion.pass.cpp | 5 ++--- .../thread.latch/arrive_and_wait.pass.cpp | 5 ++--- .../thread/thread.latch/count_down.pass.cpp | 5 ++--- .../std/thread/thread.latch/try_wait.pass.cpp | 5 ++--- .../thread/thread.semaphore/acquire.pass.cpp | 5 ++--- .../thread/thread.semaphore/binary.pass.cpp | 5 ++--- .../thread/thread.semaphore/release.pass.cpp | 5 ++--- .../thread/thread.semaphore/timed.pass.cpp | 5 ++--- .../thread.semaphore/try_acquire.pass.cpp | 5 ++--- 14 files changed, 39 insertions(+), 45 deletions(-) diff --git a/libcxx/include/__availability b/libcxx/include/__availability index 9d488f00ebb3..13d11950fd67 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 6ee418af1f2e..ce7b023f8d0a 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 c0a8f4a19b02..e19695e760c5 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 324c28074613..7f6ce3539604 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 bea9c58b93b2..920281981e46 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 77371e096615..abbfb869895c 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 66967bd7c6a2..69160fe89a8e 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 06134144b89e..e33590f1c78a 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 38de7a0fbcfa..8283aa3546a1 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 290635883798..547594b71e59 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 1080ed4cf2ee..2ebee35e3608 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 c61f57b68afe..76dac0cc403e 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 b0c2db1718de..34520ecfae05 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 fb9bf4d5b0f6..f71d12f8740e 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