Building an LLVM cross-compiler

You could try using zig for this. Here's an example build script of zig cross compiling llvm, lld, clang, and finally itself:

https://github.com/ziglang/zig-bootstrap

You can see the build script is not too complicated. The main trick is using CC and CXX to use `zig cc` and `zig c++` as drop-in replacements for a C and C++ compiler, respectively.

I wrote some more details about this here:
https://andrewkelley.me/post/zig-cc-powerful-drop-in-replacement-gcc-clang.html