Earlier quoted context omitted.
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.
> 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.
Zig Libc
81–90 of 196 posts
Re: Zig Libc
#82Re: Zig Libc
#83Earlier quoted context omitted.
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.
> 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.
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.
Re: Zig Libc
#84Earlier quoted context omitted.
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.
> 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.
(With that said, OpenBSD promises no stability if you choose to bypass libc. What it promises instead is that it will change things in incompatible ways that will hurt. It’s up to you whether the pain that thus results from supporting OpenBSD is worth it.)
Re: Zig Libc
#85Earlier quoted context omitted.
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.
> 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.
Re: Zig Libc
#86Re: Zig Libc
#87There are so many scary parts of libc, this is a really exciting project
Just joking of course. Those are sadly only in glibc.. :)
Re: Zig Libc
#88Earlier quoted context omitted.
Are you ok with the size of the budget these agencies control? Are you ok with it being headed by a guy who never has denied he took a $50k bribe from the FBI and wasn't even the initial target of an investigation? I would bet you $1000 that not one of the immigrants being rounded up were even accused of that kind of corruption and crimes. How is this not bald corruption and an insane way to spend tax dollars when pe…
The budget needs to increase because there are a lot of people in the country illegally and in order to get every single one of them out the agency needs to scale up. When people start obstructing officers and being violent that increases the required number of officers even more.
I'm as concerned with getting them all out as I'm concerned with ticketing every jaywalker.
Re: Zig Libc
#89This is very exciting for zig projects linking C libraries. Though I'm curious about the following case: Let's say I'm building a C program targeting Windows with MinGW & only using Zig as a cross compiler. Is there a way to still statically link MinGW's libc implementation or does this mean that's going away and I can only statically link ziglibc even if it looks like MinGW from the outside?
This use case is unchanged. If you specify -target x86_64-windows-gnu -lc then some libc functions are provided by Zig, some are provided by vendored mingw-w64 C files, and you don't need mingw-w64 installed separately; Zig provides everything. You can still pass --libc libc.txt to link against an externally provided libc, such as a separate mingw-w64 installation you have lying around, or even your own libc installa…
while we're talking about printf, can i incept in you the idea of making an io.printf function that does print-then-flush?
Re: Zig Libc
#90This strikes me as a very agent-friendly problem. Given a harness that enforces sufficiently-rigorous tests, I'm sure you could spin up an agent loop that methodically churns through these functions one by one, finishing in a few days.
Have you ever used an LLM with Zig? It will generate syntactically invalid code. Zig breaks so often and LLMs have such an eternally old knowledge cutoff that they only know old ass broken versions. The same goes for TLA+ and all the other obscure things people think would be great to use with LLMs, and they would, if there was as much training data as there was for JavaScript and Python.
https://github.com/ityonemo/clr
[0] generates a dynamically loaded library which does sketchy shit to access the binary representation of datastructures in the zig compiler, and then transpiles the IR to zig code which has to be rerun to do the analysis.