Skip to content

Commit

Permalink
go plugin: fix build on darwin
Browse files Browse the repository at this point in the history
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] golang/go#8801 (comment)
  • Loading branch information
tonytheodore committed Jul 6, 2016
1 parent ed68885 commit b57e1bc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions plugins/go/go-native.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 2 additions & 0 deletions plugins/go/go.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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 \'; \
Expand Down

0 comments on commit b57e1bc

Please sign in to comment.