adding a build tag specific cgo bridge #190
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose of this PR
I am attempting to do some static linking and also to use an alternative LIBC implementation (musl) this requires that I have greater control over the LDFLAGS and CFLAGS. The current flags hard code the location of the library and include files, requiring some file copypasta.
What this PR does
Adds an optional
customlib
build tag that when specified during builds requires that the user provide all the CFLAG and LDFLAG variables.What this allows
I can build the upstream wasmerio/wasmer package with custom targets, etc.. and then build my golang application with total control over which wasmer library file is included.
Example Usage
Assuming that i have cloned the wasmer repo to
/wasmer
and built an appropriate wasmer C-API I can then perform the following to get a sweet sweet statically compiled executable using the MUSL libc:The additional build tag will not affect existing users at all.