It's really painful to use environment variable to pass allowed **CGO** flags. It would be great to be able to pass this stuff as an build flag. Eg: go build -cgo-ldflags-allow '.*'