Toolchains I've Used to Compile Kernels for Various Devices
How to unpack ?:
- Unpack a tar.xz file:
tar -xvf filename.tar.xz - Unpack a tar.gz file:
tar -xvf filename.tar.gz
1. Linux 4.9:
-
Tested on 4.9.227-309: proton-12, linaro-aarch64-7.5
- Usage: here
-
Tested on 4.9.227: clang-r416183b
-
Additinal notes:
CROSS_COMPILE=/path/to/clang/host/linux-x86/clang-r416183b/bin/aarch64-linux-gnu- # check the location of toolchain CC=/path/to/clang/host/linux-x86/clang-r416183b/bin/clang # check the location of toolchain
-
2. Linux 4.14:
-
Common 4.14 (For other devices like realme): clang-r383902b, arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-linux-gnu
-
Samsung with Knox: clang-4639204-cfp-jopp, gcc-cfp-jopp-only/aarch64-linux-android-4.9
- Tested on Linux 4.14.113 (Galaxy S10x)
- Usage: here
-
Samsung without Knox: clang-4639204, aarch64-linux-android-4.9
- Tested on Linux 4.14.113 (Galaxy M21)
-
AOSP Based Kernels (lineage): neutron-clang, arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-linux-gnu
- Tested on Linux 4.14.355
- Usage: here
3. Linux 4.19:
-
Tested on Linux 4.19.191: arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-linux-gnu, clang-r383902
- Usage: here
-
Tested on Linux 4.19.198: clang-r353983c, aarch64-linux-android-4.9
- Usage: here
4. Linux 5.4 qGKI: llvm-arm-toolchain-ship-10.0.9, aarch64-linux-android-4.9-Linux-5.4
- Tested on Linux 5.4.249
5. Linux 5.10: clang-r416183b, arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-linux-gnu
- Tested on Linux 5.10.198
- Usage: here
6. Linux 5.15: clang-r450784e, arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-linux-gnu
- Tested on Linux 5.15.123 - 5.15.149
7. Other GKI 2.0 Kernels (Linux 6.1 or higher): neutron-clang, arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-linux-gnu
- Usage: here
Additional Notes:
-
In MediaTek Kernels, you must use arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-linux-gnu toolchain alongside a proper Clang compiler to make the kernel boot :)
-
Starting from March 21, 2025, all my build scripts use the ARM GNU toolchain as the
CROSS_COMPILE- Reference: here