Just in case anyone is wondering - this is already possible with Clang/LLVM and the work from Gregory Szorc: https://github.com/indygreg/apple-platform-rs/tree/main
The Firefox source tree has every tool available for cross-compilation from Linux → macOS, which is how Firefox is built for macOS.