title: How should I compile Rust for Android in 2021?
body: <p><a href="https://mozilla.github.io/firefox-browser-architecture/experiments/2017-09-21-rust-on-android.html" rel="noreferrer">This tutorial</a> by Mozilla explains how to generate standalone toolchains for Rust doing</p>
  <pre><code>mkdir NDK
  ${NDK_HOME}/build/tools/make_standalone_toolchain.py --api 26 --arch arm64 --install-dir NDK/arm64
  ${NDK_HOME}/build/tools/make_standalone_toolchain.py --api 26 --arch arm --install-dir NDK/arm
  ${NDK_HOME}/build/tools/make_standalone_toolchain.py --api 26 --arch x86 --install-dir NDK/x86
  </code></pre>
  <p>These are needed mostly for <code>ar</code> and <code>linker</code> if I understood correctly. clang++ of course won't be used.</p>
  <p>But this tutorial is old and according to <a href="https://developer.android.com/ndk/guides/standalone_toolchain" rel="noreferrer">https://developer.android.com/ndk/guides/standalone_toolchain</a>, this script is obsolte. It says <code>As of r19, the NDK's default toolchains are standalone toolchains, which renders this process unnecessary.</code></p>
  <p>I think that I should just point my <code>cargo-config.toml</code> locations to this instead.</p>
  <p>However, is it the right way to compile for Android in 2021?</p>