diff options
| author | Hiroshi Ioka <hirochachacha@gmail.com> | 2017-09-04 21:23:29 +0900 |
|---|---|---|
| committer | David Crawshaw <crawshaw@golang.org> | 2017-09-10 12:54:13 +0000 |
| commit | 1134411a833caa79017a1fffb9dd9afb102d5da9 (patch) | |
| tree | b831ac0e0fd9e7566c6a90b2c83c045510c44bed /misc/cgo/testplugin/test.bash | |
| parent | 1053ae5cf51bcc9d0b38c087880dda49b4825e0f (diff) | |
| download | go-1134411a833caa79017a1fffb9dd9afb102d5da9.tar.xz | |
cmd/go, cmd/link, cmd/dist: re-enable plugin mode on darwin/amd64
1. remove broken verification
The runtime check assumes that no-pcln symbol entry have zero value,
but the linker emit no entries if the symbol is no-pcln.
As a result, if there are no-pcln symbols at the very end of pcln
table, it will panic.
2. correct condition of export
Handle special chracters in pluginpath correcty.
Export "go.itab.*", so different plugins can share the same itab.
Fixes #18190
Change-Id: Ia4f9c51d83ce8488a9470520f1ee9432802cfc1d
Reviewed-on: https://go-review.googlesource.com/61091
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'misc/cgo/testplugin/test.bash')
| -rwxr-xr-x | misc/cgo/testplugin/test.bash | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/misc/cgo/testplugin/test.bash b/misc/cgo/testplugin/test.bash index f64be9b0ff..b532676eb6 100755 --- a/misc/cgo/testplugin/test.bash +++ b/misc/cgo/testplugin/test.bash @@ -40,11 +40,21 @@ GOPATH=$(pwd) go build -buildmode=plugin iface_b GOPATH=$(pwd) go build iface LD_LIBRARY_PATH=$(pwd) ./iface +function _timeout() ( + set -e + $2 & + p=$! + (sleep $1; kill $p 2>/dev/null) & + p2=$! + wait $p 2>/dev/null + kill -0 $p2 2>/dev/null +) + # Test for issue 18676 - make sure we don't add the same itab twice. # The buggy code hangs forever, so use a timeout to check for that. GOPATH=$(pwd) go build -buildmode=plugin -o plugin.so src/issue18676/plugin.go GOPATH=$(pwd) go build -o issue18676 src/issue18676/main.go -timeout 10s ./issue18676 +_timeout 10 ./issue18676 # Test for issue 19534 - that we can load a plugin built in a path with non-alpha # characters |
