Chris's Wiki :: blog/programming/GoCLibraryAPIIssues Commentshttps://utcc.utoronto.ca/~cks/space/blog/programming/GoCLibraryAPIIssues?atomcommentsDWiki2019-12-26T21:29:17ZRecent comments in Chris's Wiki :: blog/programming/GoCLibraryAPIIssues.By Aram Hăvărneanu on /blog/programming/GoCLibraryAPIIssuestag:CSpace:blog/programming/GoCLibraryAPIIssues:6b0be41b6ec3166938797c53f974d29ce840e846Aram Hăvărneanu<div class="wikitext"><p>When calling into libc, the runtime switches the stack to the system stack, but there's nothing special about this. From the perspective of the runtime this is just like any other cgo call.</p>
<p>Note that even on Linux Go will call into libc for pthread_create(3), etc, if the program uses cgo.</p>
<p>The only special thing about Go is that our linker can link to shared libraries without having to have access to them at link time, so cross compiling Go to Solaris/macOS/Windows works even without a cross-toolchain.</p>
</div>2019-12-26T21:29:17ZBy Chris Siebenmann on /blog/programming/GoCLibraryAPIIssuestag:CSpace:blog/programming/GoCLibraryAPIIssues:9db8ea15c37a71e8619e89f3b46ad5fc967d29bcChris Siebenmann<div class="wikitext"><p>Whoops, my mistake for relying on my fallible memory rather than trying
to check, and thank you for the correction; I've updated the entry. Does
Go have to do anything special about stack space on Solaris/Illumos?</p>
</div>2019-12-26T20:45:37ZBy Aram Hăvărneanu on /blog/programming/GoCLibraryAPIIssuestag:CSpace:blog/programming/GoCLibraryAPIIssues:bc15e3cf0c9c4b7b9169ea60980cceb5b8cec39dAram Hăvărneanu<div class="wikitext"><blockquote><p>Other people are not happy about Go making direct system calls; for
example, on Solaris and Illumos, the only officially supported
method of making system calls is also through the C library (although
Go does it itself on those operating systems).</p>
</blockquote>
<p>No, it doesn't. On Solaris/illumos Go uses libc. I know this because I wrote the port and I implemented it this way.</p>
</div>2019-12-26T20:07:52Z