Skip to content
Snippets Groups Projects
Commit 1f65c399 authored by Cherry Mui's avatar Cherry Mui
Browse files

cmd/objdump: skip PIE test when cgo is disabled and PIE needs external linking

On some platforms, building PIE needs external linking, which
cannot run if cgo is not available.

Change-Id: I6d504aed0f0442cda0355d0beac606ad365e2046
Reviewed-on: https://go-review.googlesource.com/c/go/+/447616


Reviewed-by: default avatarThan McIntosh <thanm@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
parent b07e845e
No related branches found
No related tags found
No related merge requests found
...@@ -290,6 +290,10 @@ func TestDisasmPIE(t *testing.T) { ...@@ -290,6 +290,10 @@ func TestDisasmPIE(t *testing.T) {
if !platform.BuildModeSupported("gc", "pie", runtime.GOOS, runtime.GOARCH) { if !platform.BuildModeSupported("gc", "pie", runtime.GOOS, runtime.GOARCH) {
t.Skipf("skipping on %s/%s, PIE buildmode not supported", runtime.GOOS, runtime.GOARCH) t.Skipf("skipping on %s/%s, PIE buildmode not supported", runtime.GOOS, runtime.GOARCH)
} }
if !platform.InternalLinkPIESupported(runtime.GOOS, runtime.GOARCH) {
// require cgo on platforms that PIE needs external linking
testenv.MustHaveCGO(t)
}
t.Parallel() t.Parallel()
testDisasm(t, "fmthello.go", false, false, "-buildmode=pie") testDisasm(t, "fmthello.go", false, false, "-buildmode=pie")
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment