I tried to build the Ubuntu(24.04) kernel using CLANG but had no luck. I also couldn't find any resources or guides on CLANG compilation. Initially, I used this guide: https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel to build the kernel but this uses GCC, and I'm having a hard time making it use CLANG. Is it not possible to build it using CLANG?
1 Answer
It's as simple as:
$ make LLVM=1 menuconfig # Or other config target
and then
$ make LLVM=1
Or if you'd like to build it as debian package:
$ make LLVM=1 bindeb-pkg
You may have to install clang and lld though (and possibly other dependencies):
$ sudo apt install clang lld