4 ms·
It’s not that easy when you use C dependencies.
by marcrosoft 7y ago
It’s not that easy when you use C dependencies.
- mappu 7y agoWe have several C dependencies, mostly in two methods: - Cygwin helps a lot by providing a GNU make that works with CC=mingw-w64 (i.e. no cygwin1.dll dependency) and we can simply link these extra .o by setting `-extldflags "-lxxxx"` on `go build` invocation; and/or - Put .c files in a Go package and build with CGO as-is (e.g. github.com/datadog/zstd package and others). More convenient but some limitations on CFLAGS for security reasons post-1.10. All works fine and was not particularly complex to set up. GC changes have caused us to need more explicit `runtime.KeepAlive` calls after CGO interop however.