Turning the whole Linux kernel into one bitcode file
A lot of static analysis runs on LLVM bitcode. If you want to run that kind of analysis across the whole Linux kernel, you first need the whole kernel as bitcode, linked into one module. That turns out to be surprisingly hard. The usual tools for it, wllvm and gllvm, don’t hold up against the kernel’s build system.
So I built whole-kernel-bitcode. It reads the compile commands from a kernel built with make LLVM=1, recompiles each source to bitcode in parallel, reconstructs the kernel’s archive hierarchy from its build metadata, and links it bottom-up into a single built-in.bc. There’s a Docker path too, so you don’t have to assemble an LLVM toolchain by hand.
It’s plumbing. But it’s the plumbing that makes whole-kernel analysis possible, which is the part I actually care about. It’s the kind of thing you need before you can go looking for what a kernel doesn’t need.