From b57e1bc835830f89cbfd60712dbe59892229dfb0 Mon Sep 17 00:00:00 2001 From: Tony Theodore Date: Wed, 6 Jul 2016 19:09:41 +1000 Subject: go plugin: fix build on darwin build fails with: ``` fatal error: runtime: bsdthread_register error (unset DYLD_INSERT_LIBRARIES) ``` building with `-ldflags -linkmode=external`[1] and `CGO_ENABLED=1` has no affect on `go-native`, it does let `go` bootstrap, but then fails with a similar error: ``` fatal error: runtime: bsdthread_register error ``` easiest to unset DYLD_INSERT_LIBRARIES - no need to check for `darwin` as it only exists on that platform. [1] https://github.com/golang/go/issues/8801#issuecomment-66460009 --- plugins/go/go-native.mk | 1 + plugins/go/go.mk | 2 ++ 2 files changed, 3 insertions(+) diff --git a/plugins/go/go-native.mk b/plugins/go/go-native.mk index fb724ef..2278d2c 100644 --- a/plugins/go/go-native.mk +++ b/plugins/go/go-native.mk @@ -22,6 +22,7 @@ endef define $(PKG)_BUILD cd '$(1)/src' && \ GOROOT_FINAL='$(PREFIX)/$(TARGET)/go' \ + DYLD_INSERT_LIBRARIES= \ ./make.bash mkdir -p '$(PREFIX)/$(TARGET)/go' diff --git a/plugins/go/go.mk b/plugins/go/go.mk index 3676406..a28f0ed 100644 --- a/plugins/go/go.mk +++ b/plugins/go/go.mk @@ -24,6 +24,7 @@ define $(PKG)_BUILD GOROOT_FINAL='$(PREFIX)/$(TARGET)/go' \ GOOS=windows \ GOARCH='$(if $(findstring x86_64,$(TARGET)),amd64,386)' \ + DYLD_INSERT_LIBRARIES= \ ./make.bash mkdir -p '$(PREFIX)/$(TARGET)/go' @@ -39,6 +40,7 @@ define $(PKG)_BUILD echo 'CGO_ENABLED=1 \'; \ echo 'GOOS=windows \'; \ echo 'GOARCH=$(if $(findstring x86_64,$(TARGET)),amd64,386) \'; \ + echo 'DYLD_INSERT_LIBRARIES= \'; \ echo 'CC=$(PREFIX)/bin/$(TARGET)-gcc \'; \ echo 'CXX=$(PREFIX)/bin/$(TARGET)-g++ \'; \ echo 'PKG_CONFIG=$(PREFIX)/bin/$(TARGET)-pkg-config \'; \ -- cgit v0.12