mirror of https://github.com/golang/go.git
misc/cgo/testplugin: pass GO_GCFLAGS
The noopt builder sets GO_GCFLAGS when building the standard library. Set it when building plugins to ensure the -shared packages built for it have the same inlining in the export data (and thus the same package version). Tested locally with GO_GCFLAGS="-N -l" ./all.bash Fixes #17937 Change-Id: Id037cfbf4af744c05c47bdc58eea60a5dba69533 Reviewed-on: https://go-review.googlesource.com/62511 Run-TryBot: David Crawshaw <crawshaw@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
1134411a83
commit
753bac3a55
|
|
@ -23,21 +23,21 @@ trap cleanup EXIT
|
||||||
rm -rf pkg sub
|
rm -rf pkg sub
|
||||||
mkdir sub
|
mkdir sub
|
||||||
|
|
||||||
GOPATH=$(pwd) go build -buildmode=plugin plugin1
|
GOPATH=$(pwd) go build -gcflags "$GO_GCFLAGS" -buildmode=plugin plugin1
|
||||||
GOPATH=$(pwd) go build -buildmode=plugin plugin2
|
GOPATH=$(pwd) go build -gcflags "$GO_GCFLAGS" -buildmode=plugin plugin2
|
||||||
cp plugin2.so plugin2-dup.so
|
cp plugin2.so plugin2-dup.so
|
||||||
GOPATH=$(pwd)/altpath go build -buildmode=plugin plugin-mismatch
|
GOPATH=$(pwd)/altpath go build -gcflags "$GO_GCFLAGS" -buildmode=plugin plugin-mismatch
|
||||||
GOPATH=$(pwd) go build -buildmode=plugin -o=sub/plugin1.so sub/plugin1
|
GOPATH=$(pwd) go build -gcflags "$GO_GCFLAGS" -buildmode=plugin -o=sub/plugin1.so sub/plugin1
|
||||||
GOPATH=$(pwd) go build -buildmode=plugin -o=unnamed1.so unnamed1/main.go
|
GOPATH=$(pwd) go build -gcflags "$GO_GCFLAGS" -buildmode=plugin -o=unnamed1.so unnamed1/main.go
|
||||||
GOPATH=$(pwd) go build -buildmode=plugin -o=unnamed2.so unnamed2/main.go
|
GOPATH=$(pwd) go build -gcflags "$GO_GCFLAGS" -buildmode=plugin -o=unnamed2.so unnamed2/main.go
|
||||||
GOPATH=$(pwd) go build host
|
GOPATH=$(pwd) go build -gcflags "$GO_GCFLAGS" host
|
||||||
|
|
||||||
LD_LIBRARY_PATH=$(pwd) ./host
|
LD_LIBRARY_PATH=$(pwd) ./host
|
||||||
|
|
||||||
# Test that types and itabs get properly uniqified.
|
# Test that types and itabs get properly uniqified.
|
||||||
GOPATH=$(pwd) go build -buildmode=plugin iface_a
|
GOPATH=$(pwd) go build -gcflags "$GO_GCFLAGS" -buildmode=plugin iface_a
|
||||||
GOPATH=$(pwd) go build -buildmode=plugin iface_b
|
GOPATH=$(pwd) go build -gcflags "$GO_GCFLAGS" -buildmode=plugin iface_b
|
||||||
GOPATH=$(pwd) go build iface
|
GOPATH=$(pwd) go build -gcflags "$GO_GCFLAGS" iface
|
||||||
LD_LIBRARY_PATH=$(pwd) ./iface
|
LD_LIBRARY_PATH=$(pwd) ./iface
|
||||||
|
|
||||||
function _timeout() (
|
function _timeout() (
|
||||||
|
|
@ -52,12 +52,12 @@ function _timeout() (
|
||||||
|
|
||||||
# Test for issue 18676 - make sure we don't add the same itab twice.
|
# 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.
|
# 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 -gcflags "$GO_GCFLAGS" -buildmode=plugin -o plugin.so src/issue18676/plugin.go
|
||||||
GOPATH=$(pwd) go build -o issue18676 src/issue18676/main.go
|
GOPATH=$(pwd) go build -gcflags "$GO_GCFLAGS" -o issue18676 src/issue18676/main.go
|
||||||
_timeout 10 ./issue18676
|
_timeout 10s ./issue18676
|
||||||
|
|
||||||
# Test for issue 19534 - that we can load a plugin built in a path with non-alpha
|
# Test for issue 19534 - that we can load a plugin built in a path with non-alpha
|
||||||
# characters
|
# characters
|
||||||
GOPATH=$(pwd) go build -buildmode=plugin -ldflags='-pluginpath=issue.19534' -o plugin.so src/issue19534/plugin.go
|
GOPATH=$(pwd) go build -gcflags "$GO_GCFLAGS" -buildmode=plugin -ldflags='-pluginpath=issue.19534' -o plugin.so src/issue19534/plugin.go
|
||||||
GOPATH=$(pwd) go build -o issue19534 src/issue19534/main.go
|
GOPATH=$(pwd) go build -gcflags "$GO_GCFLAGS" -o issue19534 src/issue19534/main.go
|
||||||
./issue19534
|
./issue19534
|
||||||
|
|
|
||||||
|
|
@ -837,14 +837,6 @@ func (t *tester) supportedBuildmode(mode string) bool {
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
case "plugin":
|
case "plugin":
|
||||||
if os.Getenv("GO_BUILDER_NAME") == "linux-amd64-noopt" {
|
|
||||||
// Skip the plugin tests on noopt. They're
|
|
||||||
// causing build failures potentially
|
|
||||||
// obscuring other issues. This is hopefully a
|
|
||||||
// temporary workaround. See golang.org/issue/17937.
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// linux-arm64 is missing because it causes the external linker
|
// linux-arm64 is missing because it causes the external linker
|
||||||
// to crash, see https://golang.org/issue/17138
|
// to crash, see https://golang.org/issue/17138
|
||||||
switch pair {
|
switch pair {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue