Commit 4bea6c65 authored by Robert Griesemer's avatar Robert Griesemer

go/internal/gccgoimporter: backport from x/tools to ensure identical code

This change backports a minor modification of the x/tools version of this
code back into the std library. It simply ensures that both versions of
the code are the same and will simplify keeping them in sync down the
road.

While this is an API change, this is an internal package, so we're ok.

Updates #27891.

Change-Id: Ib153141382f727a2692ca80179ae09c4a383ba4f
Reviewed-on: https://go-review.googlesource.com/c/142894Reviewed-by: 's avatarAlan Donovan <adonovan@google.com>
parent bb3e2117
......@@ -26,8 +26,10 @@ type GccgoInstallation struct {
}
// Ask the driver at the given path for information for this GccgoInstallation.
func (inst *GccgoInstallation) InitFromDriver(gccgoPath string) (err error) {
cmd := exec.Command(gccgoPath, "-###", "-S", "-x", "go", "-")
// The given arguments are passed directly to the call of the driver.
func (inst *GccgoInstallation) InitFromDriver(gccgoPath string, args ...string) (err error) {
argv := append([]string{"-###", "-S", "-x", "go", "-"}, args...)
cmd := exec.Command(gccgoPath, argv...)
stderr, err := cmd.StderrPipe()
if err != nil {
return
......@@ -55,7 +57,8 @@ func (inst *GccgoInstallation) InitFromDriver(gccgoPath string) (err error) {
}
}
stdout, err := exec.Command(gccgoPath, "-dumpversion").Output()
argv = append([]string{"-dumpversion"}, args...)
stdout, err := exec.Command(gccgoPath, argv...).Output()
if err != nil {
return
}
......
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