cmd/dist: use -buildmode=pie for pie testing
authorLynn Boger <laboger@linux.vnet.ibm.com>
Thu, 28 Sep 2017 14:26:39 +0000 (10:26 -0400)
committerMichael Hudson-Doyle <mwhudson@debian.org>
Tue, 30 Jan 2018 02:01:08 +0000 (02:01 +0000)
commit67b4b454bb7e11d3dde3067c96c5f0047f2853e4
tree35d0548caa44db292f26e00be748002679107065
parent4a9c63fabaaebec7bf6adcc8e352a8c4dfff93fc
cmd/dist: use -buildmode=pie for pie testing

Some tests in misc/cgo/test are run with various options including
'-linkmode=external "-extldflags=-pie"'. On ppc64x passing -pie to
the external linker with code that was not compiled as position
independent is incorrect. This works by luck in many cases but is
not guaranteed to work. I suspect it is an issue on other targets
as well.

This will now run the tests using -buildmode=pie for the platforms
that support that buildmode option.

Fixes #21954

Change-Id: I25fc7573f2d3cb5b0d1c691a0ac91aef7715404f
Reviewed-on: https://go-review.googlesource.com/66870
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 0004-cmd-dist-use-buildmode-pie-for-pie-testing.patch
src/cmd/dist/test.go