Skip to content

Fix 16 KB alignment of Rust wheels - #1456

Merged
mhsmith merged 3 commits into
chaquo:masterfrom
emanuele-f:rust-16KB-page-size-fix
Jul 7, 2026
Merged

mhsmith merged 3 commits into
chaquo:masterfrom
emanuele-f:rust-16KB-page-size-fix

Conversation

@emanuele-f

@emanuele-f emanuele-f commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Unlike the C/C++ compilers, rustc invokes the linker itself and ignores LDFLAGS, so the 16 KB max-page-size alignment (set in android-env.sh) has to be forwarded explicitly. Without this the Rust .so is linked with the default 4 KB alignment and fails to load on 16 KB page-size devices.

Verified on the Android Studio emulator with the https://github.com/emanuele-f/PCAPdroid-mitm/releases/download/v2.0/PCAPdroid-mitm_v2.0_x86_64.apk APK, using the Android 16 KB x86_64 API 37 image.

Related commits:

Unlike the C/C++ compilers, rustc invokes the linker itself and ignores
LDFLAGS, so the 16 KB max-page-size alignment (set in android-env.sh) has
to be forwarded explicitly. Without this the Rust .so is linked with the
default 4 KB alignment and fails to load on 16 KB page-size devices.
@mhsmith

mhsmith commented Jul 7, 2026

Copy link
Copy Markdown
Member

Thanks, I've now released 16 KB-compatible builds of cryptography 42.0.8 for Python 3.13.

This is the same version as before but with a different build number, so to make your app pick it up, you'll need to either force a full rebuild, or make any change in the pip section of your build.gradle file.

@mhsmith
mhsmith merged commit f004380 into chaquo:master Jul 7, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Cryptography wheels don't support 16 KB pages

2 participants