Skip to content

Commit c7aea98

Browse files
committed
disable _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION unconditionally
When _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS is not defined, things work as expected: i.e. the feature is only used on macOS that vendors LLVM>=18. Our general policy of setting `-D_LIBCPP_DISABLE_AVAILABILITY` (which causes the above macro to be defined) wherever newer C++ features are needed works fine because we ship our own libcxx. In this case however, the required symbols (`___cxa_init_primary_exception` etc.) is in libcxxabi, which we intentionally don't ship ourselves. Therefore, we must disable this feature unconditionally, at least until our macOS baseline is >=15.0, as we rely on the libcxxabi shipped by the system. See also llvm#77653 & llvm#86077
1 parent 83ad92b commit c7aea98

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libcxx/include/__configuration/availability.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,8 @@
352352
// These macros controls the availability of __cxa_init_primary_exception
353353
// in the built library, which std::make_exception_ptr might use
354354
// (see libcxx/include/__exception/exception_ptr.h).
355-
#define _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION _LIBCPP_INTRODUCED_IN_LLVM_18
356-
#define _LIBCPP_AVAILABILITY_INIT_PRIMARY_EXCEPTION _LIBCPP_INTRODUCED_IN_LLVM_18_ATTRIBUTE
355+
#define _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION 0
356+
#define _LIBCPP_AVAILABILITY_INIT_PRIMARY_EXCEPTION /* nothing */
357357

358358
// This controls the availability of C++23 <print>, which
359359
// has a dependency on the built library (it needs access to

0 commit comments

Comments
 (0)