|
|
Subscribe / Log in / New account

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

Any hints on building Android kernels? How do you test? I'm interested in helping with PostmarketOS but I always end up losing a week to getting build VMs working.


to post comments

Building the kernel with clang

Posted Sep 20, 2017 17:54 UTC (Wed) by nathanchance (subscriber, #118533) [Link]

I have a thread on XDA regarding this: https://forum.xda-developers.com/android/software-hacking...

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...
https://android.googlesource.com/platform/prebuilts/gcc/l...


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds