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.0branch):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.lldto your build command.
Kernel Version ≥ 4.19
Clang (recommended)
- LLVM 22:
https://github.com/llvm/llvm-project/releases/download/llvmorg-22.1.2/LLVM-22.1.2-Linux-X64.tar.xz(LLVM 19–22 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.0branch):https://gitlab.com/TheXPerienceProject/yuki_clang/-/tree/18.0.0 - AOSP Clang 9–12:
https://github.com/Nicklas373/aosp-clang - Proton Clang 13–19:
https://gitlab.com/LeCmnGend/clang(v13 requires Ubuntu 18.04–20.04) - LLVM Clang 11 (
masterbranch):https://github.com/EviraKernel/Clang-11 - AOSP Clang 10 (
10.0branch):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/Selectarm-linux-gnueabiandaarch64-linux-gnu - ARM GNU Toolchain (recommended: 9.2):
https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloadsSelectarm-none-linux-gnueabihfandaarch64-none-linux-gnu - Full Google GCC 4.9 (includes the compiler binary):
- ARM64 (
masterbranch):https://github.com/KudProject/aarch64-linux-android-4.9.git - ARM (
mainbranch):https://github.com/dandelion64-Archives/arm-linux-androideabi-4.9.git
- ARM64 (
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.
🌐 Language / 语言
📖 English
Local Build
- Setting Up the Environment
- Choosing a Toolchain
- Compiling the Kernel
- Compiling on a Mobile Device
- Compiling the Stock Vendor Kernel
- Embedding KernelSU & Patching SuSFS
- Packaging and Flashing
- Kernel Build FAQ
Build with Actions
- Fork the Repository
- Configuring the YML File
- Variable Reference
- Running and Downloading Artifacts
- Automated Release
Hide Root Trace
📖 中文
基础编译
利用 Action 构建内核
隐藏Root痕迹