Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libc++] Don't use aligned_alloc on iOS versions before 13 #110315

Merged
merged 1 commit into from
Sep 27, 2024

Conversation

Un1q32
Copy link
Contributor

@Un1q32 Un1q32 commented Sep 27, 2024

There's a check here to not use aligned_alloc on macOS versions before 10.15, this patch adds an equivalent check that tests for iOS 13.

@Un1q32 Un1q32 requested a review from a team as a code owner September 27, 2024 19:10
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Sep 27, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Sep 27, 2024

@llvm/pr-subscribers-libcxx

Author: None (Un1q32)

Changes

There's a check here to not use aligned_alloc on macOS versions before 10.15, this patch adds an equivalent check that tests for iOS 13.


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

1 Files Affected:

  • (modified) libcxx/include/__config (+4)
diff --git a/libcxx/include/__config b/libcxx/include/__config
index f90c966aad6950..0d71264611ff66 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -649,6 +649,10 @@ typedef __char32_t char32_t;
          __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101500)
 #      define _LIBCPP_HAS_NO_C11_ALIGNED_ALLOC
 #    endif
+#    if (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) &&                                                    \
+         __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 130000)
+#      define _LIBCPP_HAS_NO_C11_ALIGNED_ALLOC
+#    endif
 #  elif defined(__ANDROID__) && __ANDROID_API__ < 28
 // Android only provides aligned_alloc when targeting API 28 or higher.
 #    define _LIBCPP_HAS_NO_C11_ALIGNED_ALLOC

@ldionne
Copy link
Member

ldionne commented Sep 27, 2024

This makes sense. CI isn't going to provide signal here since we don't test on iOS deployment targets, but I double-checked the version and it makes sense.

@ldionne ldionne merged commit 6389974 into llvm:main Sep 27, 2024
58 of 67 checks passed
Sterling-Augustine pushed a commit to Sterling-Augustine/llvm-project that referenced this pull request Sep 27, 2024
There's a check here to not use aligned_alloc on macOS versions before
10.15, this patch adds an equivalent check that tests for iOS 13.
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.

3 participants