aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-01-26 22:41:32 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-02-13 20:00:04 +0800
commite0fb4d1da9d22d5aaec1ae85dd002343ebd97339 (patch)
treea18b99b85bcb5b79332ac6bf0e43aa5be4f7757a
parentac2a0e615bd45eab81cd793cde5a4eef2a8581c8 (diff)
downloaddexon-e0fb4d1da9d22d5aaec1ae85dd002343ebd97339.tar
dexon-e0fb4d1da9d22d5aaec1ae85dd002343ebd97339.tar.gz
dexon-e0fb4d1da9d22d5aaec1ae85dd002343ebd97339.tar.bz2
dexon-e0fb4d1da9d22d5aaec1ae85dd002343ebd97339.tar.lz
dexon-e0fb4d1da9d22d5aaec1ae85dd002343ebd97339.tar.xz
dexon-e0fb4d1da9d22d5aaec1ae85dd002343ebd97339.tar.zst
dexon-e0fb4d1da9d22d5aaec1ae85dd002343ebd97339.zip
build: work around CGO linker bug on pre-1.8 Go
-rw-r--r--build/ci.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/build/ci.go b/build/ci.go
index 51540f9b6..d8c76567c 100644
--- a/build/ci.go
+++ b/build/ci.go
@@ -236,6 +236,14 @@ func goToolArch(arch string, subcmd string, args ...string) *exec.Cmd {
gocmd := filepath.Join(runtime.GOROOT(), "bin", "go")
cmd := exec.Command(gocmd, subcmd)
cmd.Args = append(cmd.Args, args...)
+
+ if subcmd == "build" || subcmd == "install" || subcmd == "test" {
+ // Go CGO has a Windows linker error prior to 1.8 (https://github.com/golang/go/issues/8756).
+ // Work around issue by allowing multiple definitions for <1.8 builds.
+ if runtime.GOOS == "windows" && runtime.Version() < "go1.8" {
+ cmd.Args = append(cmd.Args, []string{"-ldflags", "-extldflags -Wl,--allow-multiple-definition"}...)
+ }
+ }
cmd.Env = []string{
"GO15VENDOREXPERIMENT=1",
"GOPATH=" + build.GOPATH(),