|
|
Subscribe / Log in / New account

Building the kernel with clang

Building the kernel with clang

Posted Sep 19, 2017 20:24 UTC (Tue) by nathanchance (subscriber, #118533)
In reply to: Building the kernel with clang by ndesaulniers
Parent article: Building the kernel with Clang

Thank you for these, I'm going to give it a shot with my personal Android kernel to see what warnings and such come up. It's really nice to see all the work Google has been doing with the kernel as of late. I was particularly happy with the upstream bring up of the Pixel 1 for Oreo and the backporting of a lot of security features.


to post comments

Building the kernel with clang

Posted Sep 19, 2017 21:22 UTC (Tue) by ndesaulniers (subscriber, #110768) [Link] (1 responses)

Your welcome. Please CC me on any patches! :D

Building the kernel with clang

Posted Sep 19, 2017 23:57 UTC (Tue) by ndesaulniers (subscriber, #110768) [Link]

s/Your welcome/You're welcome/g ;)

Building the kernel with clang

Posted Sep 20, 2017 4:55 UTC (Wed) by voltagex (guest, #86296) [Link] (1 responses)

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.

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