Re: [go-nuts] Cross Compiling and Go Native and "What is a C library"
On Fri, Jan 27, 2017 at 6:25 AM Aram Hăvărneanu wrote: > On Solaris the syscall interface is a private, unstable interface (just like on Windows), and the only supported way to interact with the system is through the vendor-supplied libc. Go on Solaris always uses libc, it doesn't make system calls directly like on Linux. Wow, TIL, thank you. The impossibility to freely switch libc or even bypass it entirely is quite a harsh restriction, I have to say. -- -j -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [go-nuts] Cross Compiling and Go Native and "What is a C library"
On Thu, Jan 26, 2017 at 9:24 PM, Aram Hăvărneanu wrote: > On Thu, Jan 26, 2017 at 7:00 PM, Jan Mercl <0xj...@gmail.com> wrote: >> or any POSIX-like OS for that matter > > On Solaris the syscall interface is a private, unstable interface > (just like on Windows), and the only supported way to interact with > the system is through the vendor-supplied libc. Go on Solaris always > uses libc, it doesn't make system calls directly like on Linux. > > In fact macOS is just like Solaris here (except the syscall interface > breaks even more often), but we just ignore it and hope for the best > (which is a shame, because Go binaries for macOS will never be > forward-compatible this way) . Fixing that on macOS is https://golang.org/issue/17490 . Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [go-nuts] Cross Compiling and Go Native and "What is a C library"
On Thu, Jan 26, 2017 at 7:00 PM, Jan Mercl <0xj...@gmail.com> wrote: > or any POSIX-like OS for that matter On Solaris the syscall interface is a private, unstable interface (just like on Windows), and the only supported way to interact with the system is through the vendor-supplied libc. Go on Solaris always uses libc, it doesn't make system calls directly like on Linux. In fact macOS is just like Solaris here (except the syscall interface breaks even more often), but we just ignore it and hope for the best (which is a shame, because Go binaries for macOS will never be forward-compatible this way) . -- Aram Hăvărneanu -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [go-nuts] Cross Compiling and Go Native and "What is a C library"
On Thu, Jan 26, 2017 at 6:46 PM wrote: > "If you want to use any C libraries" Don't all programs use C libraries... When I use sysinternals procmon a windows Go exe uses tens (almost hundreds) of OS c libraries. On linux/bsd I have not checked, but you cannot possibly get away with doing anything without using a C libraries on win/bsd/linux. Have little to no idea about Windows, but I believe on Linux (or any POSIX-like OS for that matter), not using any C library is simple: do not link to any statically nor dynamically. Go programs not using certain packages are statically linked (talking about the gc compiler only) without referencing any C library. Syscalls are enough to communicate with the OS - how else could libc work?. And by setting CGO_ENABLED=0 even those programs can get rid of using libc. import "C" and explicitly using a C library is a different setup, of course. -- -j -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[go-nuts] Cross Compiling and Go Native and "What is a C library"
On this article" https://inconshreveable.com/04-30-2014/cross-compiling-golang-programs-with-native-libraries/ it says "If you want to use any C libraries" But, all operating systems today (relevant ones) are written in C and their tools are in C (DSO's, DLL's) so as far as I can see, you are always using C libraries at all times... because the operating system dll's/dso's that you pull in to your program are written in C Apparently GoLang has rewritten a lot of things in Go itself and avoided C where possible, but to me this still does not make a sense... "If you want to use any C libraries" Don't all programs use C libraries... When I use sysinternals procmon a windows Go exe uses tens (almost hundreds) of OS c libraries. On linux/bsd I have not checked, but you cannot possibly get away with doing anything without using a C libraries on win/bsd/linux. So this needs to be clarified what "use any C libraries" actually means. Does it mean calling them more directly yourself? With Regards... (when cross compiling is no longer a nightmare but a pleasant dream) -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.