Skip to content

Build libmozc.so with 16 KB alignment#1363

Merged
hiroyuki-komatsu merged 1 commit into
google:masterfrom
yukawa:android_16kb_alignment
Sep 17, 2025
Merged

Build libmozc.so with 16 KB alignment#1363
hiroyuki-komatsu merged 1 commit into
google:masterfrom
yukawa:android_16kb_alignment

Conversation

@yukawa
Copy link
Copy Markdown
Collaborator

@yukawa yukawa commented Sep 11, 2025

Description

While the document says that NDK version r28 and higher compile 16 KB-aligned by default, it seems that we still need to explicitly set linker options to ensure 16 KB alignment.

Closes #1364.

Issue IDs

Steps to test new behaviors (if any)

  • OS: Ubuntu 24.04
  • Steps:
    1. bazelisk build --config oss_android package --config release_build
    2. unzip -p bazel-bin/android/jni/native_libs.zip libs/x86_64/libmozc.so | third_party/ndk/android-ndk-r28/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-objdump -p - | grep LOAD | awk '{ print $NF }' | head -1
    3. unzip -p bazel-bin/android/jni/native_libs.zip libs/arm64-v8a/libmozc.so | third_party/ndk/android-ndk-r28/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-objdump -p - | grep LOAD | awk '{ print $NF }' | head -1
    4. Make sure 2**14 is shown at the both step 2 and step 3.

@yukawa yukawa force-pushed the android_16kb_alignment branch from b29b7cd to 061d01e Compare September 11, 2025 07:55
Comment thread src/android/jni/BUILD.bazel
While the document says that NDK version r28 and higher compile
16 KB-aligned by default [1], it seems that we still need to explicitly
set linker options to ensure 16 KB alignment.

Closes google#1364.

 [1]: https://developer.android.com/guide/practices/page-sizes
@yukawa yukawa force-pushed the android_16kb_alignment branch from 061d01e to cc35113 Compare September 11, 2025 08:46
@hiroyuki-komatsu hiroyuki-komatsu merged commit 2efeece into google:master Sep 17, 2025
1 check passed
@hiroyuki-komatsu
Copy link
Copy Markdown
Collaborator

We have merged your PR.
Thank you for the contribution!

@yukawa yukawa deleted the android_16kb_alignment branch September 17, 2025 11:34
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.

Make libmozc.so compatible with 16 KB page sizes

2 participants