Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> 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.



> 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.


> > 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/ (later updates https://lwn.net/Articles/949078/ and 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.


I 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.


Yeah. 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.



In 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.


Go recently got run through the wringer to remove syscalls (and various Go ports are probably still broken) due to pinsyscalls.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: