Hi, I actually have to do this to get a buildable LLVM kernel on aarch64-linux. If you look here, you can see that overriding libraries as well as the toplevel attribute of what you want is necessary.
However, this isn’t an ideal thing and the LLVM team (includes myself) are looking to make LLVM more override friendly. This PR would greatly make what you’re doing much easier. pkgs/development/compilers/llvm: add replacement entrypoint using mak… by RossComputerGuy · Pull Request #436350 · NixOS/nixpkgs · GitHub