Skip to content

[js/rn] Add 16KB page size alignment for Android#27523

Merged
fs-eire merged 3 commits intomicrosoft:mainfrom
dodokw:main
Mar 13, 2026
Merged

[js/rn] Add 16KB page size alignment for Android#27523
fs-eire merged 3 commits intomicrosoft:mainfrom
dodokw:main

Conversation

@dodokw
Copy link
Contributor

@dodokw dodokw commented Mar 3, 2026

Description

Added the -Wl,-z,max-page-size=16384 linker flag to the onnxruntimejsi target in js/react_native/android/CMakeLists.txt to support 16KB memory page sizes.

Motivation and Context

Starting with Android 15, Google Play requires apps to be compatible with 16KB page size devices.

By default, the Android NDK builds shared libraries with 4KB ELF segment alignment. Without this explicit flag, libonnxruntimejsi.so fails the Play Store's 16KB alignment check, leading to potential crashes or installation failures on supported hardware.

Changes

  • Updated js/react_native/android/CMakeLists.txt.
  • Applied target_link_options to onnxruntimejsi to enforce max-page-size=16384 (16KB).

References

@fs-eire

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the React Native Android CMake build for the onnxruntimejsi shared library to ensure it passes Android 15 / Google Play requirements for 16KB memory page size devices by enforcing 16KB ELF segment alignment at link time.

Changes:

  • Add -Wl,-z,max-page-size=16384 to the onnxruntimejsi target link options to support 16KB page sizes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@fs-eire
Copy link
Contributor

fs-eire commented Mar 11, 2026

/azp run Linux QNN CI Pipeline, Win_TRT_Minimal_CUDA_Test_CI, Windows ARM64 QNN CI Pipeline, Windows GPU Doc Gen CI Pipeline

@azure-pipelines
Copy link

Azure Pipelines successfully started running 4 pipeline(s).

@fs-eire
Copy link
Contributor

fs-eire commented Mar 12, 2026

Please merge/rebase to latest main branch which fixes the Windows CPU CI pipeline failure.

@dodokw
Copy link
Contributor Author

dodokw commented Mar 12, 2026

@fs-eire
done the merge/rebase to latest main branch

@fs-eire
Copy link
Contributor

fs-eire commented Mar 13, 2026

/azp run Linux QNN CI Pipeline, Win_TRT_Minimal_CUDA_Test_CI, Windows ARM64 QNN CI Pipeline, Windows GPU Doc Gen CI Pipeline

@azure-pipelines
Copy link

Azure Pipelines successfully started running 4 pipeline(s).

@fs-eire fs-eire enabled auto-merge (squash) March 13, 2026 05:22
@fs-eire fs-eire merged commit d6dcef1 into microsoft:main Mar 13, 2026
89 checks passed
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.

3 participants