Skip to content

Commit 58de9f3

Browse files
committed
runtime: use -buildmode=pie in testCgoPprofPIE instead of -extldflags=-pie
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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent 3c46f49 commit 58de9f3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/runtime/crash_cgo_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ func TestCgoPprof(t *testing.T) {
330330
}
331331

332332
func TestCgoPprofPIE(t *testing.T) {
333-
testCgoPprof(t, "-ldflags=-extldflags=-pie", "CgoPprof")
333+
testCgoPprof(t, "-buildmode=pie", "CgoPprof")
334334
}
335335

336336
func TestCgoPprofThread(t *testing.T) {

0 commit comments

Comments
 (0)