4 ms·
> It causes issues in eg openbsd where you can only call syscalls from libc OpenBSD allows making syscalls from static binaries as well. If Go binaries are sta
by oguz-ismail 2y ago
> It causes issues in eg openbsd where you can only call syscalls from libc
OpenBSD allows making syscalls from static binaries as well. If Go binaries are static, it shouldn't cause any problems.
- kbolino 2y ago> OpenBSD allows making syscalls from static binaries as well. Do you have a source for this? My Google searches and personal recollections say that OpenBSD does not have a stable syscall ABI in the way that Linux does and the proper/supported way to make syscalls on OpenBSD is through dynamically linked libc; statically linking libc, or invoking the syscall mechanism it uses directly, results in binaries that can be broken on future OpenBSD versions.
- deleted 2y ago[deleted]
- cesarb 2y ago> > OpenBSD allows making syscalls from static binaries as well. > Do you have a source for this? One article from 2019 about this can be found at https://lwn.net/Articles/806776/ https://lwn.net/Articles/806776/ (later updates https://lwn.net/Articles/949078/ https://lwn.net/Articles/949078/ and https://lwn.net/Articles/959562/ https://lwn.net/Articles/959562/). Yes, it does not have a stable system call ABI, but as long as your program was statically compiled with the libc from the same OpenBSD release, AFAIK it should work.
- oguz-ismail 2y agoYeah. Do you have any information as to how/when the OpenBSD system call ABI has changed recently? I wouldn't expect that to happen very often.
- WhyNotHugo 2y agoFrom 2019: https://lwn.net/Articles/806776/ https://lwn.net/Articles/806776/
- kbolino 2y agoIn particular, from Theo de Raadt himself: > we here at OpenBSD are the kings of ABI-instability > Program to the API rather than the ABI. When we see benefits, we change the ABI more often than the API. > I have altered the ABI. Pray I do not alter it further. The term ABI here though is a little imprecise. I believe it just refers to the syscall ABI. So, it should be possible to make an "almost static" binary by statically linking everything except libc, and that binary should continue to work in future versions of OpenBSD.
- kbolino 2y agoI upvoted for the great links, but I still don't think a static binary that will break in the future is meeting the expectations many have when static linking.
- tolciho 2y agoGo recently got run through the wringer to remove syscalls (and various Go ports are probably still broken) due to pinsyscalls.