3 ms·
But it only uses musl for cross compilation, no? I don't think it uses glibc to compile Linux binaries on macOS or macOS libc to compile macOS binaries on Linu
by sim_card_map 6y ago
But it only uses musl for cross compilation, no?
I don't think it uses glibc to compile Linux binaries on macOS or macOS libc to compile macOS binaries on Linux.
- Gaelan 6y agomusl is a Linux libc, so you can't use in on any other OS (because it wouldn't know how to send syscalls to the kernel). macOS handles libc a little differently from Linux; whereas the Linux kernel publishes its syscall API, and allows programs to make syscalls however they want (e.g. with glibc or musl, or with go, which does syscalls itself), macOS's syscall API is subject to change at any time, and the only (supported) way to make syscalls is to dynamically link to the system libc.
- zeeboo 6y agoIt can target glibc in a cross-compile setting. https://andrewkelley.me/post/zig-cc-powerful-drop-in-replacement-gcc-clang.html https://andrewkelley.me/post/zig-cc-powerful-drop-in-replace...