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
This commit is contained in:
Tony Theodore 2016-07-06 19:09:41 +10:00
parent ed68885143
commit b57e1bc835
2 changed files with 3 additions and 0 deletions

View File

@ -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'

View File

@ -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 \'; \