1 en Choosing a Toolchain
JackA1ltman edited this page 2026-04-04 23:24:57 +08:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Choosing a Toolchain

Local Build · Step 2

Due to the fragmented history of older kernels, XML and repo tools are generally unavailable (with some exceptions for 5.4/4.19 kernels), which makes toolchain selection more varied and sometimes tricky.

Kernel Version ≤ 4.14

Clang (pick one)

  • AOSP Clang 12 (Lineage-20.0 branch): https://github.com/LineageOS/android_prebuilts_clang_kernel_linux-x86_clang-r416183b
  • ZyC Clang 10: https://github.com/ZyCromerZ/Clang/releases/download/10.0.1-20220724-release/Clang-10.0.1-20220724.tar.gz

GCC (Google GCC 4.9, android12L-release branch)

  • ARM64: https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9.git
  • ARM: https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9.git

This GCC does not include a compiler binary — it acts mainly as an interpreter/linker helper. Add LD=ld.lld to your build command.

Kernel Version ≥ 4.19

  • LLVM 22: https://github.com/llvm/llvm-project/releases/download/llvmorg-22.1.2/LLVM-22.1.2-Linux-X64.tar.xz (LLVM 1922 all work)
  • Clang Neutron 18: https://github.com/Neutron-Toolchains/antman

Build flags: LLVM=1 LLVM_IAS=1

Other Clang Options

  • ZyC Clang: https://github.com/ZyCromerZ/Clang
  • Yuki Clang 18 (18.0.0 branch): https://gitlab.com/TheXPerienceProject/yuki_clang/-/tree/18.0.0
  • AOSP Clang 912: https://github.com/Nicklas373/aosp-clang
  • Proton Clang 1319: https://gitlab.com/LeCmnGend/clang (v13 requires Ubuntu 18.0420.04)
  • LLVM Clang 11 (master branch): https://github.com/EviraKernel/Clang-11
  • AOSP Clang 10 (10.0 branch): https://github.com/crdroidandroid/android_prebuilts_clang_host_linux-x86_clang-6364210.git

GCC-only Build Options

  • EVA GCC: https://github.com/mvaisakh/gcc-build
  • Linaro GCC (recommended: 4.9 / 7.5): https://releases.linaro.org/components/toolchain/binaries/ Select arm-linux-gnueabi and aarch64-linux-gnu
  • ARM GNU Toolchain (recommended: 9.2): https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads Select arm-none-linux-gnueabihf and aarch64-none-linux-gnu
  • Full Google GCC 4.9 (includes the compiler binary):
    • ARM64 (master branch): https://github.com/KudProject/aarch64-linux-android-4.9.git
    • ARM (main branch): https://github.com/dandelion64-Archives/arm-linux-androideabi-4.9.git

Some 4.19 kernels may also require an older Clang (e.g. Clang 10). It is possible to patch the source to support Clang 20+, but that is an advanced topic.