I'm very sorry for replying to this old thread, I forgot to post a reply earlier.
Unfortunately your reply doesn't really explain much that I didn't already know. Simply put, I have two questions. Firstly, can precompiled .syso files be used to obviate the need for a C-compiler entirely for the package user, or will you still need a C-compiler and/or linker if a Go package has .syso files? Secondly, is there a concrete example of a project where some source files are compiled into a .syso file? If someone could just point me to a makefile, that would probably show me all I need to know. I recall seeing some .syso files in the compiler source tree but could not find a makefile or sources for them. On Tuesday, October 30, 2018 at 6:33:21 AM UTC+2, Ian Lance Taylor wrote: > > On Sun, Oct 28, 2018 at 1:20 PM, jclc via golang-nuts > <golan...@googlegroups.com <javascript:>> wrote: > > > > There is an initiative to remove the requirement of having a C compiler > for > > certain CGO packages and this seems like a somewhat common thing to do, > even > > the Go race condition detector ships as a pre-built C blob in the Go > source > > tree. Yet I can't find any documentation on how to actually do this. > > > > How should .syso files be built? Where should the C code live (Go > complains > > if C source files exist in the package directory)? How does the Go > linker > > find the correct symbols? Is there any concrete documentation or a > tutorial > > on how to do this? > > There are no guidelines for how to build .syso files, and the C code > can live anywhere. The .syso file will be built by some mechanism > other than the go tool, such as make. The .syso file can be copied > into the Go package. It will be linked into the Go program. A > typical use would involve using cgo (https://golang.org/cmd/cgo) to > call into the .syso. > > 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.