mirror of https://github.com/golang/go.git
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:
parent
66736880ca
commit
2a6544b604
|
|
@ -3088,7 +3088,7 @@ func (b *builder) gccSupportsFlag(flag string) bool {
|
|||
}
|
||||
cmd := exec.Command(cmdArgs[0], cmdArgs[1:]...)
|
||||
cmd.Dir = b.work
|
||||
cmd.Env = envForDir(cmd.Dir, os.Environ())
|
||||
cmd.Env = mergeEnvLists([]string{"LC_ALL=C"}, envForDir(cmd.Dir, os.Environ()))
|
||||
out, err := cmd.CombinedOutput()
|
||||
supported := err == nil && !bytes.Contains(out, []byte("unrecognized"))
|
||||
b.flagCache[flag] = supported
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue