According to e.g. phoronix, it should be easy to build the mainline kernel with llvm/clang now. How would I go about trying this in nixpkgs / has anybody tried this already?
1 Like
Not sure if that Clang and/or LLVM are available yet somewhere. But if it would be, and it is the default clang version in nixpkgs, you would be able to test using:
let pkgs = import <nixpkgs> {}; in pkgs.linux.override {stdenv = pkgs.clangStdenv; }
Building the kernel does indeed work
Building the whole of kernelPackages
(with linuxPackagesFor
) does not yet. It fails to build cpupower
. I opened https://github.com/NixOS/nixpkgs/pull/74810 for fixing this.
I tried to build linux.override { stdenv = clangStdenv; }
on your branch, and it failed complaining that asm-goto
wasn’t supported
Ah should’ve mentioned that: you need llvmPackages_latest.stdenv
(version 9) at the moment.