]> Cypherpunks repositories - gostls13.git/commit
cmd/go: pass -no-pie along with -Wl,-r to gcc when supported on linux
authorMichael Hudson-Doyle <michael.hudson@canonical.com>
Thu, 7 Jan 2016 23:57:02 +0000 (12:57 +1300)
committerMichael Hudson-Doyle <michael.hudson@canonical.com>
Mon, 11 Jan 2016 21:20:00 +0000 (21:20 +0000)
commitb80b098bc523871d0657f8f68ed71882558f557f
tree86683f09ff6c06547dd0836256619c7abe9077cf
parentba593d6ab861222ee03b87a6f733afac48f5a04e
cmd/go: pass -no-pie along with -Wl,-r to gcc when supported on linux

Go fails to build on a system which has PIE enabled by default like this:

/usr/bin/ld: -r and -pie may not be used together
collect2: error: ld returned 1 exit status

The only system I know that has this property right now is Ubuntu Xenial
running on s390x, which is hardly the most accessible system, but it's planned
to enable this on amd64 soon too. The fix is to pass -no-pie along with -Wl,-r
to the compiler, but unfortunately that flag is very new as well. So this does
a test compile of a trivial file to see if the flag is supported.

Change-Id: I1345571142b7c3a96212e43297d19e84ec4a3d41
Reviewed-on: https://go-review.googlesource.com/18359
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/cmd/go/build.go