fix(android): add 16KB page size support for Google Play compliance#50
Merged
Knightro63 merged 1 commit intoKnightro63:mainfrom Apr 23, 2026
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Closes #49
libangle_android_graphic_jni.socompiled with NDK 27 (or older) defaults to0x1000(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=4096as the linker default for aarch64. NDK 28 changed this default to16384, but projects still on NDK 27 are affected.Fix
Add
-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ONto the CMake arguments inbuild.gradle. This instructs the NDK linker to emit0x4000(16KB) PT_LOAD alignment — fully backward-compatible with 4KB-page devices.Verification
Compiled
angle_android_graphic_jni.cppdirectly with NDK 27 clang to confirm:0x1000(4KB)0x4000(16KB)0x4000(16KB)