Skip to content

Support 16 KB page sizes - #151

Closed
Mygod wants to merge 1 commit into
mozilla:masterfrom
Mygod:patch-2
Closed

Support 16 KB page sizes#151
Mygod wants to merge 1 commit into
mozilla:masterfrom
Mygod:patch-2

Conversation

@Mygod

@Mygod Mygod commented Aug 28, 2024

Copy link
Copy Markdown
Contributor

No description provided.

@MattiasBuelens

Copy link
Copy Markdown

Starting in November 2025, support for 16KB page sizes will become mandatory, so Android app developers using Rust libraries will urgently need this.

For now, you can work around this (without this PR) by adding an exec to your cargo Gradle configuration:

cargo {
    // ...
    libname = "myrustlibrary"

    exec { spec, toolchain ->
        // Support 16KB page sizes
        // https://developer.android.com/guide/practices/page-sizes#other-build-systems
        spec.environment("RUST_ANDROID_GRADLE_CC_LINK_ARG", "-Wl,-z,max-page-size=16384,-soname,lib${libname}.so")
    }
}

(Make sure to run cargo clean first, so you'll actually rebuild the Rust libraries. 😉)

However, it would be much better if the Rust Android Gradle plugin handled this out of the box. Could a maintainer please take a look at this PR? 🙏

@ncalexan

Copy link
Copy Markdown
Member

Thanks for the patch -- I've reworked it and merged it as #176. Sorry for the long radio silence, I maintain this plugin off the side of my desk and it rarely makes it to the top of my list. Thanks again for your excellent contribution!

@ncalexan ncalexan closed this Aug 21, 2026
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.

3 participants