zlacker

[return to "Zig Libc"]
1. tiffan+8M1[view] [source] 2026-02-03 02:08:17
>>ingve+(OP)
Does this mean long term Zig won’t run on OpenBSD?

Because doesn’t OpenBSD block direct syscalls & force everything to go through libc.

>>38039689

◧◩
2. AndyKe+9O1[view] [source] 2026-02-03 02:21:48
>>tiffan+8M1
This affects static libc only. If you pass -dynamic -lc then the libc functions are provided by the target system. Some systems only support dynamic libc, such as macOS. I think OpenBSD actually does support static libc though.
◧◩◪
3. winter+XV1[view] [source] 2026-02-03 03:24:33
>>AndyKe+9O1
> I think OpenBSD actually does support static libc though.

How does that work, with syscalls being unable to be called except from the system’s libc? I’d be a bit surprised if any binary’s embedded libc would support this model.

◧◩◪◨
4. oguz-i+eZ1[view] [source] 2026-02-03 03:53:31
>>winter+XV1
> How does that work, with syscalls being unable to be called except from the system’s libc?

OpenBSD allows system calls being made from shared libraries whose names start with `libc.so.' and all static binaries, as long as they include an `openbsd.syscalls' section listing call sites.

◧◩◪◨⬒
5. Goblin+3q4[view] [source] 2026-02-03 19:03:52
>>oguz-i+eZ1
Can't you just have one syscall(2) to rule them all? https://man7.org/linux/man-pages/man2/syscall.2.html
[go to top]