You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are multiple approaches to support static/dynamic linking, here is mine:
Abstract all cgo with an interface that accepts accepts and returns cgo types
Do all the go<->cgo heavy lifting in Wrapper but delegate the real cgo call to the interface.
Create one interface implementation for dynamic loading, maybe called DynamicWrapper. Put all the related c and go code in a separated files. Add an opt-out tag (act_dynload)? to this file so users that don't need it can remove it at build time.
Create on interface implementation for static/dynamic lining, maybe called LinkWrapper. Put all the relatedc and go code in a separated files. Add an opt-in tag (act_link)? to this file for users who want to support this mode.
This allows to support the two scenarios and any combination of them with a small runtime overhead.
We are using cdynamic.cc headers at the moment for the cgo bindings. Is there a way to statically link the libraries with go?
The text was updated successfully, but these errors were encountered: