Skip to content

fix(android): add 16KB page size support for Google Play compliance#50

Merged
Knightro63 merged 1 commit intoKnightro63:mainfrom
TrevorZzzzz:fix/android-16kb-page-size
Apr 23, 2026
Merged

fix(android): add 16KB page size support for Google Play compliance#50
Knightro63 merged 1 commit intoKnightro63:mainfrom
TrevorZzzzz:fix/android-16kb-page-size

Conversation

@TrevorZzzzz
Copy link
Copy Markdown
Contributor

Problem

Closes #49

libangle_android_graphic_jni.so compiled with NDK 27 (or older) defaults to 0x1000 (4KB) PT_LOAD ELF segment alignment. This is incompatible with 16KB-page kernels on Android 15+ devices. Google Play now requires all apps to support 16KB pages by May 31, 2026, or distribution will be blocked.

Root Cause

NDK 27 and older set max-page-size=4096 as the linker default for aarch64. NDK 28 changed this default to 16384, but projects still on NDK 27 are affected.

Fix

Add -DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON to the CMake arguments in build.gradle. This instructs the NDK linker to emit 0x4000 (16KB) PT_LOAD alignment — fully backward-compatible with 4KB-page devices.

Verification

Compiled angle_android_graphic_jni.cpp directly with NDK 27 clang to confirm:

Build PT_LOAD Align 16KB compatible
NDK 27, no flag 0x1000 (4KB)
NDK 27, with flag 0x4000 (16KB)
NDK 28, no flag 0x4000 (16KB)

Add -DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON to CMake arguments so that
libangle_android_graphic_jni.so is compiled with 16KB ELF segment alignment.

NDK 27 and older default to 0x1000 (4KB) PT_LOAD alignment, which is
incompatible with 16KB-page kernels on Android 15+. Google Play requires
all apps to support 16KB pages by May 31 2026.

The flag instructs the NDK linker to emit 0x4000 (16KB) PT_LOAD alignment,
which is backward-compatible with 4KB-page devices.

Fixes Knightro63#49
@Knightro63 Knightro63 merged commit d92b1e2 into Knightro63:main Apr 23, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

base/lib/arm64-v8a/libangle_android_graphic_jni.so 16kb support

2 participants