Commit 814c749c authored by Ian Lance Taylor's avatar Ian Lance Taylor

cmd/go: force untranslated output when running GCC/clang driver

When we look for the tool ID to use for a compiler, force untranslated
output so that we can match the literal string "version".

Fixes https://gcc.gnu.org/PR84765

Change-Id: I607df445dbd3c5a7c3a6907601adcb039ac16fc1
Reviewed-on: https://go-review.googlesource.com/111575
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: default avatarThan McIntosh <thanm@google.com>
parent 8088a7fc
...@@ -235,6 +235,8 @@ func (b *Builder) gccgoToolID(name, language string) (string, error) { ...@@ -235,6 +235,8 @@ func (b *Builder) gccgoToolID(name, language string) (string, error) {
cmdline := str.StringList(cfg.BuildToolexec, name, "-###", "-x", language, "-c", "-") cmdline := str.StringList(cfg.BuildToolexec, name, "-###", "-x", language, "-c", "-")
cmd := exec.Command(cmdline[0], cmdline[1:]...) cmd := exec.Command(cmdline[0], cmdline[1:]...)
cmd.Env = base.EnvForDir(cmd.Dir, os.Environ()) cmd.Env = base.EnvForDir(cmd.Dir, os.Environ())
// Force untranslated output so that we see the string "version".
cmd.Env = append(cmd.Env, "LC_ALL=C")
out, err := cmd.CombinedOutput() out, err := cmd.CombinedOutput()
if err != nil { if err != nil {
return "", fmt.Errorf("%s: %v; output: %q", name, err, out) return "", fmt.Errorf("%s: %v; output: %q", name, err, out)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment