I am reading this reddit reply and I came across this:
To answer your question, Zig has a pretty unique and intimate relationship with libc. Zig can use libc (some Operating systems like MacOS and BSD require going through libc). Zig can also work without libc, on Linux Zig will use the stable syscall interface and on Windows Zig can use platform Dlls like ntdll and kernel32 directly.
Zig also provides all the header files and link libraries to link against external libc libraries like GLIBC, the MacOS Libc, etc. Zig can even link against older versions of GLIBC, something GCC doesnt even support. Zig also ships with MinGW which enables you to build C applications on Windows without Visual Studio. It doesn't always work but I'm currently working on an alternative to MinGW, ZIGLIBC, that could make this alot better in the future. For Linux Zig also ships with Musl which includes a full libc implementation. This makes it possible to build static applications for any target including freestanding ones that may not have GLIBC installed system wide
Based on the statement above, I have the following questions:
Zig can use libc (some Operating systems like MacOS and BSD require going through libc)
How can I confirm if I am on macOS then libc is being used?
Zig also provides all the header files and link libraries to link against external libc libraries like GLIBC, the MacOS Libc, etc.
I have Zig installed, is it possible for me to see these header files? How can I see them?
Zig can even link against older versions of GLIBC, something GCC doesnt even support
What would be the process of specifying the version of GLIBC zig should link with? So that I can confirm the statement "Zig can even link against older versions of GLIBC"
Zig also ships with MinGW which enables you to build C applications on Windows without Visual Studio
Similar to question 3, how would I set up Zig to build against MinGW, so that I can confirm the statement above.
For Linux Zig also ships with Musl which includes a full libc implementation. This makes it possible to build static applications for any target including freestanding ones that may not have GLIBC installed system wide
If I am on a Mac, can I instruct Zig to use Musl instead? if so how do I?
I think the core of my question revolves around Zig relationship with libraries it needs to link with while compiling and how to configure this.