Clang'ing The Kernel With Different LLVM Setups Will Be Easier With Linux 5.18

LLVM=1 is used for currently defining the LLVM/Clang tool variables for building the Linux kernel with this non-GNU toolchain. But currently if wanting to make use of an LLVM/Clang installation outside of the PATH or like on Debian/Ubuntu and other distributions where the Clang binaries are version postfixed, it's not trivial.
With the changes that landed in Linux 5.18, LLVM=-14 can now be specified if say wanting to target LLVM/Clang 14 binaries of the system in the PATH. Or if wanting to target a compiler installation outside of PATH, LLVM=/path/to-llvmcan be set. Otherwise the existing LLVM=1 behavior remains the same as on previous kernels.
More details on this more flexible LLVM handling for Linux 5.18 via this commit.
2 Comments