Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Android libraries for 4KB and 16KB devices

54 views
Skip to first unread message

Jose Antonio Olivera Ortega

unread,
Jan 21, 2025, 8:57:22 AMJan 21
to android-ndk
Hi there!

I am in the process of getting some Android library using native code ready for the new 16KB memory page size. 

Thanks for the doc you guys provided, it is being very helpful.

There is something that I still don’t get. Once I compile the native bits in the Android library using 16KB ELF alignment any Android app using the library can run in 16KB devices. This is clear and tested with the 16KB system image for the emulator (I do not have any of the 16KB devices yet), all good there. I tested the same Android app (using the library built with this 16KB ELF alignment) with a 4KB device and everything went fine. I saw at https://android-developers.googleblog.com/2024/08/adding-16-kb-page-size-to-android.html, under “Details” section the following: _”once an application is fixed to be page size agnostic, the same application binary can run on both 4 KB and 16 KB devices”_. 

When I stared looking into this I was assuming I would need to maintain two different builds for the Android library, one for 4KB devices and another one for 16KB devices. When this does not seem to be the case I am wondering when that would be needed. Can you guys (maybe Steven Moreland) share a bit about this? Thanks.

Looking forward to hearing from you guys. Thanks.

Cheers,
Jose.

John Dallman

unread,
Jan 21, 2025, 9:59:52 AMJan 21
to andro...@googlegroups.com
To the best of my understanding, there is no need to maintain two separate builds. Any native code library that runs correctly with 16KB pages should also run correctly on devices with 4KB pages. 

If even larger pages are adopted in the future, libraries compatible with them should run correctly on devices with smaller pages.  

John


--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/android-ndk/29da9fcf-9cd6-4325-80d3-7ab6dd436577n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages