Skip to content

Conversation

Mygod
Copy link
Contributor

@Mygod Mygod commented Aug 28, 2024

No description provided.

@MattiasBuelens
Copy link

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? 🙏

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.

2 participants