Skip to content

Commit 2efeece

Browse files
authored
Build libmozc.so with 16 KB alignment (#1363)
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 #1364. [1]: https://developer.android.com/guide/practices/page-sizes PiperOrigin-RevId: 808078734
1 parent 16a22b5 commit 2efeece

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/android/jni/BUILD.bazel

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ mozc_cc_library(
7070
mozc_cc_binary(
7171
name = "mozc",
7272
srcs = [],
73+
linkopts = [
74+
# 16 KB page size support is a requirement to target Android 15+.
75+
# https://developer.android.com/guide/practices/page-sizes
76+
"-Wl,-z,max-page-size=16384",
77+
],
7378
linkshared = 1,
7479
tags = MOZC_TAGS.ANDROID_ONLY,
7580
target_compatible_with = _TARGET_COMPATIBLE_WITH,

0 commit comments

Comments
 (0)