Issue 183619
Summary libc++ 22.1.0 on macOS no longer supports macOS 10.13 due to aligned_alloc not enclosed in __builtin_available check
Labels libc++
Assignees
Reporter bitlush
    I have just tried to compile libc++ 22.1.0. I typically target macOS 10.13 as this is the lowest version of macOS supported (up until now), however, verison 22.1.0 fails with the following compiler error (works fine with 21.1.8) `'aligned_alloc' has been marked as being introduced in macOS 10.15 here, but the deployment target is macOS 10.13.0`:


```
In file included from /Users/Shared/libcxx_src/llvm-project/libcxxabi/src/fallback_malloc.cpp:19:
/Users/Shared/libcxx_src/llvm-project/libcxxabi/../libcxx/src/include/aligned_alloc.h:44:10: error: 'aligned_alloc' is only available on macOS 10.15 or newer [-Werror,-Wunguarded-availability-new]
   44 |   return ::aligned_alloc(__alignment, __size > __rounded_size ? __size : __rounded_size);
      | ^~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_malloc.h:65:35: note: 'aligned_alloc' has been marked as being introduced in macOS 10.15 here, but the deployment target is macOS 10.13.0
   65 | void * __sized_by_or_null(__size) aligned_alloc(size_t __alignment, size_t __size) __result_use_check __alloc_align(1) __alloc_size(2) _MALLOC_TYPED(malloc_type_aligned_alloc, 2) __OSX_AVAILABLE(10.15) __IOS_AVAILABLE(13.0) __TVOS_AVAILABLE(13.0) __WATCHOS_AVAILABLE(6.0);
 | ^
/Users/Shared/libcxx_src/llvm-project/libcxxabi/../libcxx/src/include/aligned_alloc.h:44:10: note: enclose 'aligned_alloc' in a __builtin_available check to silence this warning
   44 |   return ::aligned_alloc(__alignment, __size > __rounded_size ? __size : __rounded_size);
      |          ^~~~~~~~~~~~~~~ 
1 error generated.
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to