Bionic armeabi-v7a/arm64-v8a nightly releases

We should create nightly releases for armeabi-v7a and arm64-v8a against Bionic, rather than Glibc. Why? Android environments. They're built on Bionic. Termux, in particular, includes Bionic libraries that make it incompatible with programs that were built against Glibc... like Grease's current ARM builds are.

I've already done some research on the topic. There might be challenges. We can't just hop in a Bionic environment and use cross. We should use the Android build tools for Rust to achieve this. They will build against Bionic. Our resulting binary should work within Termux and Android Terminal environments.

I asked a few LLMs about the topic and condensed some useful information:

SUMMARY.md

🚀 Rust Cross-Compilation for AArch64 Bionic Linux

(for Termux + Android Terminal Environments)

If you're trying to build a Rust binary that actually runs inside Termux or an Android Terminal environment, you’ve probably already hit the classic landmine:
Linux builds linked against Glibc won’t run on Android because Android uses Bionic, its own C library.

This guide walks you through fixing that.
Spoiler: we compile for the Android target instead of normal Linux. 🧠


🔥 1. The Dynamic Linking Problem (Glibc vs. Bionic)

When you compile using aarch64-unknown-linux-gnu, Rust links your binary against Glibc.
But Android — and by extension Termux and Android Terminal setups — use Bionic libc, which simply doesn’t provide the Glibc symbols your binary expects.

Result? 💥
libc.so.6: not found
undefined symbol: __xyz_glibc_function

To avoid this explosion, we must build using the Android (Bionic) target, not the regular Linux target.


📚 Why Termux & Android Terminal Need Bionic-Compatible Binaries

Termux and Android Terminal environments run inside the Android runtime, not a traditional Linux distribution.
Even though they feel like Linux shells, they still follow Android's ABI rules.

This means:

  • No Glibc
  • No typical Linux system paths
  • Everything must link to Bionic
  • Executables must match Android’s ELF format

So we compile for aarch64-linux-android, which gives us Rust’s Bionic-linked standard library and the correct linker.


🧰 2. Setup: Preparing Your Host Environment

Before compiling, we need Android’s toolchain available locally.

A. 📦 Download & Configure the Android NDK

  1. Download:
    Get the latest stable Android NDK from Google and extract it.

  2. Tell your shell where it lives:

    export ANDROID_NDK_ROOT="/path/to/your/android-ndk-rXX"

B. 🎯 Install the Required Rust Target

rustup target add aarch64-linux-android

This installs Rust’s standard library compiled for Bionic.


💡 What the Android Target Actually Changes

When you select the Android target:

  • Rust swaps in the Bionic-compatible stdlib
  • Clang from the NDK is used as the compiler
  • The linker from Android’s toolchain builds the ELF binary
  • The result runs cleanly inside:
    • Termux
    • Android Terminal
    • Rooted or unrooted Android shells
    • Any Android-based exec environment

Basically: it stops blowing up. 🎉


🏗️ 3. Building the Binary (Two Approaches)

Choose your tool:

  • 🥇 cross — Docker-powered, easiest for reproducible builds
  • 🥈 cargo-ndk — lightweight wrapper around the NDK

cross handles the Rust + NDK environment automatically.

  1. Install it:

    cargo install cross
  2. Build for Android:

    cross build --target aarch64-linux-android --release
  3. Output binary:

    target/aarch64-linux-android/release/your_app_name

🐋 What `cross` Does Behind the Scenes
  • Uses Docker images containing the proper NDK toolchain
  • Applies the right Clang + linker flags
  • Ensures your build environment is clean, reproducible, and isolated

Zero headache.
Maximum success rate.


🥈 Method 2: Using cargo-ndk

A simple CLI wrapper specifically built for Android NDK workflows.

  1. Install it:

    cargo install cargo-ndk
  2. Build with Android’s ABI name:

    cargo ndk -t arm64-v8a build --release

📦 Deployment Note

The resulting binary is fully compatible with:

  • Termux
  • Android Terminal
  • Any Android shell environment
  • Rooted or unrooted devices (permissions permitting)

No more libc.so.6 errors.
No more Glibc-vs-Bionic drama.
Just a working Rust binary on Android. 🚀