Is a 16KB page-size build compatible with 4KB page-size devices?

134 views
Skip to first unread message

조영진

unread,
May 9, 2025, 8:28:56 AMMay 9
to android-ndk

Hello,

According to the official Android documentation (https://developer.android.com/guide/practices/page-sizes), it is recommended to build .so files to support a 16KB page size when using native code in an app.
Following this guideline, we modified and tested our app to build .so files that support a 16KB page size. On a 16KB page size virtual device (pre-release 16KB page size), we confirmed that .so files built with the traditional 4KB page size failed to load when calling System.load(), whereas those built with a 16KB page size loaded and functioned normally.

However, whether .so files built with a 16KB page size run without issues on devices using the older 4KB page size still requires further verification.
The Android Developers Blog (https://android-developers.googleblog.com/2024/08/adding-16-kb-page-size-to-android.html) mentions that .so files built with 16KB are compatible with 4KB page-size devices, and our initial tests also showed normal operation in that environment. Nevertheless, as our application is security-focused, any backward compatibility issues could directly impact service reliability. Therefore, we seek a clear guideline or official confirmation regarding whether loading and running .so files built with a 16KB page size is officially supported on devices that use a 4KB page size.

Thank you.

Dan Albert

unread,
May 9, 2025, 4:05:20 PMMay 9
to andro...@googlegroups.com, Steven Moreland

--
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/36c7b8ba-ed54-4caf-8ba3-d28338fcdd1an%40googlegroups.com.

Steven Moreland

unread,
May 9, 2025, 4:06:48 PMMay 9
to Dan Albert, andro...@googlegroups.com
Yes, 16 KB will run on 4 KB devices. The updated build configurations are meant to work on devices with 4 KB and 16 KB pages. This is supported technically since 16 KB is a multiple of 4 KB, so anything that is 16 KB aligned is also 4 KB aligned.

조영진

unread,
May 12, 2025, 8:09:36 AMMay 12
to android-ndk
Thank you for your answer. I wasn't confident about the technical part, so I appreciate your help.
2025년 5월 10일 토요일 오전 5시 6분 48초 UTC+9에 Steven Moreland님이 작성:
Reply all
Reply to author
Forward
0 new messages