-
Notifications
You must be signed in to change notification settings - Fork 257
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
posix_memalign is not available on some Android 4.1 devices #647
Comments
Do you have examples of devices like this? The linked bug report says the 4.1+ is fine. |
I have encountered it on Motorola RAZR i (x86), Android 4.1.
I'm not sure how you came to this conclusion. It says that ZTE U5 (Android 4.1) also exhibits this issue. Later in the comments it also says:
After some searching in chromium repo, I have found this:
Linked bug report says:
To learn more, I downloaded the Android 4.1 firmware for Motorola RAZR i and extracted libc.so.
For comparison, libc.so from system.img of Android 4.1 x86 virtual device.
I also searched for all new symbols in API 16 in the latest NDK (16.1.4479499) by running Only |
ah, x86-only? that sounds familiar.... https://issuetracker.google.com/28245055 |
from that bug it looks like i should have bumped the API level for x86 posix_memalign to 17, but didn't. so i guess that's the fix here? |
In Android 4.1
And memalign was aliased to dlmemalign. Maybe posix_memalign can be declared like this?
|
If we do bump the API level to 17, maybe we'd want to add something for API 16? We had an out-of-line version of the function in android_support until recently for the sake of API < 16: https://android-review.googlesource.com/c/platform/ndk/+/610876 |
Yeah, I think we may want to just put it back in libandroid_support. The alternative is that we add the inline directly to bionic until such time that we can drop API 16. @enh, thoughts? Neither is particularly difficult. |
either sgtm. |
Accidentally pressed the "Close issue" button, disregard. |
This is "fixed" in r17 in that it's back in libandroid_support, but for completeness I need to get the headers/stub libs to stop pretending it was in android-16. |
Apparently this didn't make it to all android-16 devices. As far as we know it did make it for all android-17 devices. Test: make checkbuild Bug: android/ndk#647 Change-Id: I2f07cfb1254e2a203c1c10b91b0be46bf37ea853
Merged into r17. |
This wasn't available for all android-16 devices. Test: ./checkbuild.py && ./run_tests.py Bug: android/ndk#647 Change-Id: Idd03a15b0b61dc40e594598fac158a90efe398b0 (cherry picked from commit 05aeeb1ec1fb97a79415f06b55425f40c07c0974)
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+.
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: #953 Reviewed By: yfeldblum Differential Revision: D10469757 Pulled By: Orvid fbshipit-source-id: c63838f3f6e723ef3de77187f39597a4063043db
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
posix_memalign is declared in stdlib.h as being available since Android 4.1:
However, on some devices that were launched with pre-4.1 version of Android and later upgraded to 4.1, bionic seems to not have been updated.
This causes
java.lang.UnsatisfiedLinkError: Cannot load library: reloc_library[1306]: 143 cannot locate 'posix_memalign'...
inSystem.loadLibrary
.I have found related issue here.
As far as I can tell, there are no Android 4.2 devices with this problem.
The text was updated successfully, but these errors were encountered: