runtime: use -buildmode=pie in testCgoPprofPIE instead of -extldflags=-pie
authorLynn Boger <laboger@linux.vnet.ibm.com>
Fri, 27 Oct 2017 14:06:40 +0000 (10:06 -0400)
committerMichael Hudson-Doyle <mwhudson@debian.org>
Mon, 30 Oct 2017 23:16:17 +0000 (23:16 +0000)
Errors occur in runtime test testCgoPprofPIE when the test
is built by passing -pie to the external linker with code
that was not built as PIC. This occurs on ppc64le because
non-PIC is the default, and fails only on newer distros
where the address range used for programs is high enough
to cause relocation overflow. This test should be built
with -buildmode=pie since that correctly generates PIC
with -pie.

Related issues are #21954 and #22126.

Updates #22459

Change-Id: Ib641440bc9f94ad2b97efcda14a4b482647be8f7
Reviewed-on: https://go-review.googlesource.com/73970
Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Gbp-Pq: Name 0005-runtime-use-buildmode-pie-in-testCgoPprofPIE-instead.patch

src/runtime/crash_cgo_test.go

index a5cbbad69bbfd66e0621e54e2a3e6eca86154eb4..5b86d491806c895314248c7e738fba216b9188c0 100644 (file)
@@ -330,7 +330,7 @@ func TestCgoPprof(t *testing.T) {
 }
 
 func TestCgoPprofPIE(t *testing.T) {
-       testCgoPprof(t, "-ldflags=-extldflags=-pie", "CgoPprof")
+       testCgoPprof(t, "-buildmode=pie", "CgoPprof")
 }
 
 func TestCgoPprofThread(t *testing.T) {