aboutsummaryrefslogtreecommitdiffstats
path: root/build_darwin.sh
diff options
context:
space:
mode:
authorTeddy Wing2020-03-10 23:44:32 +0100
committerTeddy Wing2020-03-11 00:41:34 +0100
commit428fb6dcab1377dd887d65eb2a496f6d5bbe1b6c (patch)
tree8a49ff14471a8678e552710e833230ab5ee7880a /build_darwin.sh
parent17405ab3fd75474562f921a58715a50ca28f1b5a (diff)
downloadgo-notifier-428fb6dcab1377dd887d65eb2a496f6d5bbe1b6c.tar.bz2
Fix `-sectcreate` LDFLAGS error when building on Go >= 1.10
I was trying to build the project and ended up with this error: $ go get go build github.com/keybase/go-notifier: invalid flag in #cgo LDFLAGS: -sectcreate Found this issue https://github.com/golang/go/issues/23937 related to Go 1.10 that describes compiler flags as needing to be whitelisted for security. > Options specified by cgo using #cgo CFLAGS and the like are now > checked against a whitelist of permitted options. This closes a > security hole in which a downloaded package uses compiler options like > -fplugin to run arbitrary code on the machine where it is being built. > This can cause a build error such as invalid flag in #cgo CFLAGS. https://tip.golang.org/doc/go1.10#cgo https://github.com/golang/go/wiki/InvalidFlag The `-sectcreate` flag is included in the whitelist: re(`-Wl,-sectcreate,([^,@\-][^,]+),([^,@\-][^,]+),([^,@\-][^,]+)`), https://github.com/golang/go/commit/eef2fd28ca7023be3a3f1c62039c2643bffac948#diff-4edde0d5efc092a14e579fd0de312bdeR149 However, the format is different from before. The linker flag arguments must now be comma-separated, and prefixed with `-Wl,`. Fixes #3.
Diffstat (limited to 'build_darwin.sh')
0 files changed, 0 insertions, 0 deletions