Is it the only way to produce fast cross-platform binaries?
LLVM is huge and compile times can be slow.<p>I found several compilers related:<p>0. GCC<p>1. Zig started as LLVM frontend, finally with self-hosting, can do cross-platform codegen without LLVM.
See QBE: <a href="https://c9x.me/compile/" rel="nofollow">https://c9x.me/compile/</a><p>> QBE is a compiler backend that aims to provide 70% of the performance of industrial optimizing compilers in 10% of the code. QBE fosters language innovation by offering a compact user-friendly and performant backend. The size limit constrains QBE to focus on the essential and prevents embarking on a never-ending path of diminishing returns.<p>> The current version of QBE can target amd64 (linux and osx), arm64, and riscv64.<p>"QBE vs. LLVM": <a href="https://news.ycombinator.com/item?id=25273907" rel="nofollow">https://news.ycombinator.com/item?id=25273907</a>
I presume you compile C/C++ code. How does your file structure look like? Do you have a lot of files with little to no content? You can speed things up by merging files. I have managed to reduce the building speed by around 95% by doing such simple things.<p>Reducing the amount of unnecessary headers is also beneficial, but in comparison to merging files it barely makes a difference.
The Go compiler doesn't use LLVM. They pretty much built all their codegen for every platform from the ground up. But that's only possible because they have the resources to do that. As far as I know, the only viable alternative to LLVM, is GCC, which I don't think is "lighter".<p>Also, Zig still uses LLVM. It's just that because LLVM is C++, the Stage 1 compiler had to be in C++ as well, and they've since slimmed it down by having LLVM expose a C API that the (now "self-hosted") Zig compiler can directly talk to instead.
LLVM really is the tail that wags the dog for smaller compiler projects.<p>In addition to QBE as many have suggested, you might take a look at AsmJit, if you are using C++.