3 ms·
If you want to play around with some of the improved code generation features of Clang/LLVM 10 for various architectures (MIPS, ARM, RISC-V, etc), but don't wan
by AndyKelley 7y ago
If you want to play around with some of the improved code generation features of Clang/LLVM 10 for various architectures (MIPS, ARM, RISC-V, etc), but don't want to take the time to set up a full cross compilation environment, you could use the master branch tarballs[1] of Zig, which already are based on LLVM/Clang 10.
I just published a blog post[2] about this. You can use `zig cc` in the place of `clang`, and it'll unlock cross compilation.
[1]: https://ziglang.org/download/ https://ziglang.org/download/
[2]: https://andrewkelley.me/post/zig-cc-powerful-drop-in-replacement-gcc-clang.html https://andrewkelley.me/post/zig-cc-powerful-drop-in-replace...
- blindseer 7y agoThank you Andrew for all the work you've done on this! I'm very excited about being able to download zig and get the latest LLVM version AND be able to cross compile in a single go. `zig cc` in some ways is now a better C compiler than clang/gcc. To me that's even crazier than everything else that is happening in the world right now.
- mamcx 7y agoThis is great. Is possible to compile to memory alike tinycc (ie: to make a interpreter/JIT without going assembly)?
- rurban 7y agoDoes not really look like a drop-in replacement for cc yet. The zip-install-prefix path is not relative and unknown. It is not taken from the downloaded path. The linker and autotools integration does not work yet. But it almost works. e.g. --disable-shared CC="zig cc --target=x86_64-linux-musl" LD=lld