pjsip / pjproject

PJSIP project
http://www.pjsip.org
GNU General Public License v2.0
2.02k stars 771 forks source link

Add support for Android flexible page sizes #4068

Closed sauwming closed 3 weeks ago

sauwming commented 3 weeks ago

As specified in Android official doc: https://developer.android.com/guide/practices/page-sizes#ndk-build, Android now supports 16 KB page sizes.

Historically, Android has only supported 4 KB memory page sizes, which has optimized system memory performance for the average amount of total memory that Android devices have typically had. Beginning with Android 15, AOSP supports devices that are configured to use a page size of 16 KB (16 KB devices). If your app uses any [NDK](https://developer.android.com/ndk) libraries, either directly or indirectly through an SDK, then you will need to rebuild your app for it to work on these 16 KB devices.

Note that as described in the doc above, the patch in this PR requires NDK r27 and higher. For r26 or below, you can supply the flags CFLAGS="-D__BIONIC_NO_PAGE_SIZE_MACRO" LDFLAGS="-Wl,-z,max-page-size=16384" to configure-android.

nanangizz commented 3 weeks ago
sauwming commented 3 weeks ago

Without the additional flags, the library will build and run as usual without the 16 KB page size support.