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"]