build(android): 16 KB ELF page alignment for all bundled .so - #25
Open
KLCLAU wants to merge 1 commit into
Open
Conversation
Android 15+ boots a 16 KB-page kernel and Google Play requires 16 KB compatibility for updates since Nov 2025. On a 16 KB device a 4 KB-aligned .so fails to load; on the ones still running a 4 KB kernel (e.g. current Galaxy S26) the installer shows a 'this app isn't 16 KB compatible / ELF alignment check failed' warning listing every bundled library. libmain.so and the vcpkg/FetchContent .so already inherit the NDK default, but the two out-of-tree builds do not: - DXVK (meson cross build): add -Wl,-z,max-page-size=16384 to c_link_args / cpp_link_args in meson-arm64-android-cross.ini.in. - libadrenotools + hooks (standalone CMake): add the same via CMAKE_SHARED_LINKER_FLAGS in build-adrenotools.sh. - Also pin it on the android-vulkan preset (CMAKE_SHARED/EXE_LINKER_FLAGS) so libmain.so / libSDL3 / libopenal / libgamespy are aligned regardless of NDK default. After this, readelf -l on every .so in the APK reports p_align 0x4000 and the install-time warning is gone (verified on a Galaxy S26+). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Why
Android 15+ boots a 16 KB-page kernel and Google Play has required 16 KB compatibility for app updates since Nov 2025. A 4 KB-aligned
.so:libdxvk_d3d8.so,libgsl_alloc_hook.so,libSDL3.so,libgamespy.so,libSDL3_image.so,libopenal.so, …).libmain.soand the vcpkg/FetchContent libs mostly inherit the NDK default, but the two out-of-tree builds don't: DXVK (its own meson cross build) and libadrenotools + the linker-namespace hooks (standalone CMake).Change
Add
-Wl,-z,max-page-size=16384 -Wl,-z,common-page-size=16384:c_link_args/cpp_link_argsinmeson-arm64-android-cross.ini.inCMAKE_SHARED_LINKER_FLAGSinbuild-adrenotools.shCMAKE_SHARED_LINKER_FLAGS/CMAKE_EXE_LINKER_FLAGS, coveringlibmain.so/libSDL3/libopenal/libgamespyregardless of NDK defaultResult
readelf -lon every.soin the packaged APK now reportsp_align 0x4000; the install-time warning is gone. Verified on a Galaxy S26+ (Adreno 840).Related: #23, #24