mirror of
https://github.com/JackA1ltman/NonGKI_Kernel_Build_2nd.git
synced 2026-08-19 15:03:40 +08:00
Page:
编译器选择
Pages
Fork 项目
Home
en Automated Release
en Choosing a Toolchain
en Compiling on a Mobile Device
en Compiling the Kernel
en Compiling the Stock Vendor Kernel
en Configuring the YML File
en Embedding KernelSU and Patching SuSFS
en Fork the Repository
en Hiding Root Common Methods
en Introduction
en Kernel Build FAQ
en Packaging and Flashing
en Requirements
en Running and Downloading Artifacts
en Setting Up the Environment
en Variable Reference
内核编译答疑
利用移动设备编译内核
变量参考
基础需求
嵌入KernelSU和SuSFS修补
序章
打包与刷入
搭建基础环境
编译内核
编译器选择
编译设备厂商原始内核
自动发布
运行与产物
配置 YML 文件
隐藏Root常规方式
No results
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.
编译器选择
基础编译 · 第二步
由于旧内核的历史原因,我们没有 XML 和 repo 工具(部分 5.4/4.19 内核除外),编译工具的选择因此更加多样化。
内核版本 ≤ 4.14
Clang(二选一)
- AOSP Clang 12(
Lineage-20.0分支):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 分支)
- 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
该版本 GCC 不含编译器本体,主要用于充当解释器角色。编译命令需添加
LD=ld.lld。
内核版本 ≥ 4.19
Clang(推荐)
- 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 均可) - Clang Neutron 18:
https://github.com/Neutron-Toolchains/antman
编译命令:LLVM=1 LLVM_IAS=1
其他可选 Clang
- ZyC Clang:
https://github.com/ZyCromerZ/Clang - Yuki Clang 18(
18.0.0分支):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(13 仅限 Ubuntu 18.04–20.04) - LLVM Clang 11(
master分支):https://github.com/EviraKernel/Clang-11 - AOSP Clang 10(
10.0分支):https://github.com/crdroidandroid/android_prebuilts_clang_host_linux-x86_clang-6364210.git
纯 GCC 编译可选方案
- EVA GCC:
https://github.com/mvaisakh/gcc-build - Linaro GCC(推荐 4.9 / 7.5):
https://releases.linaro.org/components/toolchain/binaries/选择arm-linux-gnueabi和aarch64-linux-gnu - ARM 公司 GCC(推荐 9.2):
https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads选择arm-none-linux-gnueabihf和aarch64-none-linux-gnu - 具有完整编译功能的 Google GCC 4.9:
- ARM64(
master分支):https://github.com/KudProject/aarch64-linux-android-4.9.git - ARM(
main分支):https://github.com/dandelion64-Archives/arm-linux-androideabi-4.9.git
- ARM64(
部分 4.19 内核也可能需要 Clang 10 等低版本编译器。通过修改源码可获得对 Clang 20+ 的支持,但这属于进阶内容。
🌐 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痕迹