Building the kernel with clang
Building the kernel with clang
Posted Sep 20, 2017 4:55 UTC (Wed) by voltagex (guest, #86296)In reply to: Building the kernel with clang by nathanchance
Parent article: Building the kernel with Clang
Posted Sep 20, 2017 17:54 UTC (Wed)
by nathanchance (subscriber, #118533)
[Link]
The process is basically identical to building a normal desktop kernel (setup defconfig, customize as you need, build with a cross compiler, then install it). Use Google's stock toolchain (linked below). It's a little more difficult than a normal desktop kernel as the entire boot partition is traditionally compressed into an image so you need to pull it off your device, unpack that, add your kernel image and any other files (like modules), then reflash it (either with fastboot or a custom recovery like TWRP). I personally don't run any tests on the kernel after adding patches and building as I am an amateur and don't have that kind of time; runtime is my test environment lol. I just add all the Linux stable upstream patches and pull stuff in from CAF and kernel/common from Google.
https://android.googlesource.com/platform/prebuilts/gcc/l...
Building the kernel with clang
https://android.googlesource.com/platform/prebuilts/gcc/l...