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

Fix posix_memalign symbol not found with Android API 16 #953

Closed
wants to merge 1 commit into from

Conversation

Kudo
Copy link
Contributor

@Kudo Kudo commented Oct 19, 2018

According to this android/ndk#647,
posix_memalign may not exist on Android API 16.
From Android NDK r17c, the API exists for Android API 17+.

    #if __ANDROID_API__ >= 17
    int posix_memalign(void** __memptr, size_t __alignment, size_t __size) __INTRODUCED_IN(17);
    #endif /* __ANDROID_API__ >= 17 */

Change the code to use posix_memalign only after Android API 17+.
This would also fix issue for OSS React Native to pack latest folly and building with clang.
See: facebook/react-native#20302 and facebook/react-native#20342

Summary:
  According to this android/ndk#647,
  posix_memalign may not exist on Android API 16.
  From Android NDK r17c, the API exists for Android API 17+.

    #if __ANDROID_API__ >= 17
    int posix_memalign(void** __memptr, size_t __alignment, size_t __size) __INTRODUCED_IN(17);
    #endif /* __ANDROID_API__ >= 17 */

  Change the code to use posix_memalign only after Android API 17+.
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Orvid has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

sandraiser pushed a commit to sandraiser/folly that referenced this pull request Mar 4, 2019
Summary:
According to this android/ndk#647,
  posix_memalign may not exist on Android API 16.
  From Android NDK r17c, the API exists for Android API 17+.
```
    #if __ANDROID_API__ >= 17
    int posix_memalign(void** __memptr, size_t __alignment, size_t __size) __INTRODUCED_IN(17);
    #endif /* __ANDROID_API__ >= 17 */
```
  Change the code to use posix_memalign only after Android API 17+.
  This would also fix issue for OSS React Native to pack latest folly and building with clang.
  See: facebook/react-native#20302 and facebook/react-native#20342
Pull Request resolved: facebook#953

Reviewed By: yfeldblum

Differential Revision: D10469757

Pulled By: Orvid

fbshipit-source-id: c63838f3f6e723ef3de77187f39597a4063043db
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants