cmd/go, cmd/link: set LC_ALL=C when checking if host compiler supports -no-pie

Fixes #15900

Change-Id: Ieada5f4e3b3b2ae358414e013f3090b4b820569b
Reviewed-on: https://go-review.googlesource.com/23536
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Michael Hudson-Doyle 2016-05-31 20:05:39 +12:00
parent 66736880ca
commit 2a6544b604
2 changed files with 2 additions and 1 deletions

View file

@ -1235,6 +1235,7 @@ func hostlink() {
}
cmd := exec.Command(argv[0], "-c", "-no-pie", "trivial.c")
cmd.Dir = tmpdir
cmd.Env = append([]string{"LC_ALL=C"}, os.Environ()...)
out, err := cmd.CombinedOutput()
supported := err == nil && !bytes.Contains(out, []byte("unrecognized"))
if supported {