Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android binaries don't support 16KiB page sizes #9170

Open
alusch opened this issue Jan 8, 2025 · 1 comment
Open

Android binaries don't support 16KiB page sizes #9170

alusch opened this issue Jan 8, 2025 · 1 comment
Assignees
Labels

Comments

@alusch
Copy link

alusch commented Jan 8, 2025

Starting with Android 15, devices may use 16KiB pages instead of 4KiB, which requires native libraries to be recompiled to align the ELF sections to 16KiB boundaries (only on 64-bit architectures). https://developer.android.com/guide/practices/page-sizes has more details.

The latest binary release is only aligned to 4KiB (2**12) and so will fail to load on such devices:

> objdump -p android-binaries-1.3.296.0/arm64-v8a/libVkLayer_khronos_validation.so | grep LOAD
    LOAD off    0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**12
    LOAD off    0x00000000013a9e90 vaddr 0x00000000013aae90 paddr 0x00000000013aae90 align 2**12
    LOAD off    0x00000000014e8b90 vaddr 0x00000000014eab90 paddr 0x00000000014eab90 align 2**12

> objdump -p android-binaries-1.3.296.0/x86_64/libVkLayer_khronos_validation.so | grep LOAD
    LOAD off    0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**12
    LOAD off    0x00000000015a3510 vaddr 0x00000000015a4510 paddr 0x00000000015a4510 align 2**12
    LOAD off    0x00000000016e1410 vaddr 0x00000000016e3410 paddr 0x00000000016e3410 align 2**12

Per the linked document above, since you're using CMake and NDK 25, you should set

target_link_options(${CMAKE_PROJECT_NAME} PRIVATE "-Wl,-z,max-page-size=16384")

for 64-bit builds (and depending on the version of ld may also need to set common-page-size=16384).

Not the most urgent issue since the validation layers are only used for testing and such devices probably don't exist yet, but would be good to be prepared for them.

@spencer-lunarg
Copy link
Contributor

@alusch thanks for this, good to know and we can get this fix in for future devices

@spencer-lunarg spencer-lunarg self-assigned this Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants