From 460580bcc8523eadb66e484103f630c285e1caca Mon Sep 17 00:00:00 2001 From: samialabri Date: Mon, 19 Oct 2026 23:15:30 +0900 Subject: [PATCH] Android: link every target with 16 KB-aligned ELF segments Google Play requires 16 KB page-size support for apps targeting Android 15+. The 64-bit builds happened to be 16 KB-aligned by toolchain default, but armeabi-v7a was 4 KB. Pin -z max-page-size=16384 for all Android targets. Co-Authored-By: Claude Opus 5.5 --- .cargo/config.toml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .cargo/config.toml diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000..9584486 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,12 @@ +# Android 15+ devices can run with 16 KB memory pages, and Google Play requires native libraries to support +# them. Link every Android build of the core with 16 KB-aligned ELF segments explicitly, instead of relying on +# the NDK/rustc defaults (NDK r27 still defaults to 4 KB for some toolchains). Harmless on 4 KB-page devices. +# Verified by kestrove-android/scripts/check-16kb.sh. +[target.aarch64-linux-android] +rustflags = ["-C", "link-arg=-Wl,-z,max-page-size=16384", "-C", "link-arg=-Wl,-z,common-page-size=16384"] + +[target.x86_64-linux-android] +rustflags = ["-C", "link-arg=-Wl,-z,max-page-size=16384", "-C", "link-arg=-Wl,-z,common-page-size=16384"] + +[target.armv7-linux-androideabi] +rustflags = ["-C", "link-arg=-Wl,-z,max-page-size=16384", "-C", "link-arg=-Wl,-z,common-page-size=16384"]