summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCherry Mui <cherryyz@google.com>2022-11-03 12:21:58 -0400
committerCherry Mui <cherryyz@google.com>2022-11-03 16:57:09 +0000
commit1f65c399befa37e6727bb1a1a40aca65c4b6bcc4 (patch)
treeda48d87970c912fc929e54becaf5fa840bab64da
parentb07e845e764806fa888cb4e99c8ace4625f0472f (diff)
downloadgo-git-1f65c399befa37e6727bb1a1a40aca65c4b6bcc4.tar.gz
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: Than McIntosh <thanm@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
-rw-r--r--src/cmd/objdump/objdump_test.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cmd/objdump/objdump_test.go b/src/cmd/objdump/objdump_test.go
index fa6a1b9a68..b747d0d542 100644
--- a/src/cmd/objdump/objdump_test.go
+++ b/src/cmd/objdump/objdump_test.go
@@ -290,6 +290,10 @@ func TestDisasmPIE(t *testing.T) {
if !platform.BuildModeSupported("gc", "pie", 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()
testDisasm(t, "fmthello.go", false, false, "-buildmode=pie")
}