Hello everyone, so in my search of trying to find cross compiling for C and C++, I came across Zig. I heard of Zig as a language before, but then I came across a video and sources (example: Can you bring your own C compiler with the zig build system? - #2 by dimdin) saying the Zig comes with a whole toolchain to compile C and C++ code as a drop in replacement for any C/C++ compiler you may be using now, with a great benefit of eastly cross compiling.
This seemed great because, at least on Windows natively, the MinGW-w64 GCC only provides the toolchain for Windows, and clang can cross compile but needs you to provide sysroot and libc for the platform. This got me interested as even if I don’t use the Zig language itself (for now), it provides a easy way to cross compile C and C++ with zig cc
and zig c++
to many platforms quite easily from the looks of things.
Now during a bit more searching I found out that this is LLVM under the hood with all the libc and such already provided which seemed fine. Then I came across this open issue on Github: make the main zig executable no longer depend on LLVM, LLD, and Clang libraries · Issue #16270 · ziglang/zig · GitHub, by the looks of it, it looks like the Zig team want to move away from LLVM. Now, I don’t really understand a lot of the technical stuff being said, so I come with a simple question.
How does this affect Zig to compile C and C++ code? Will zig cc
and zig c++
still work the same, and will be able to cross compile, and will it still be the drop in replacement as it was before?