mirror of
https://github.com/golang/go
synced 2024-09-04 23:44:16 +00:00
cmd/cgo: ensure the command passed to run retains a trailing dash
This was accidentally broken by CL 127755. Fixes #29333 Change-Id: I5e92048c64a55c1699d6c38eb4dbbd51c817b820 Reviewed-on: https://go-review.googlesource.com/c/155037 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
d902f23ec4
commit
d9e2ba4fcc
|
@ -5,7 +5,8 @@
|
||||||
package cgotest
|
package cgotest
|
||||||
|
|
||||||
/*
|
/*
|
||||||
#include "issue4339.h"
|
// We've historically permitted #include <>, so test it here. Issue 29333.
|
||||||
|
#include <issue4339.h>
|
||||||
*/
|
*/
|
||||||
import "C"
|
import "C"
|
||||||
|
|
||||||
|
|
|
@ -1992,8 +1992,10 @@ func (p *Package) gccErrors(stdin []byte) string {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Force -O0 optimization
|
// Force -O0 optimization but keep the trailing "-" at the end.
|
||||||
nargs = append(nargs, "-O0")
|
nargs = append(nargs, "-O0")
|
||||||
|
nl := len(nargs)
|
||||||
|
nargs[nl-2], nargs[nl-1] = nargs[nl-1], nargs[nl-2]
|
||||||
|
|
||||||
if *debugGcc {
|
if *debugGcc {
|
||||||
fmt.Fprintf(os.Stderr, "$ %s <<EOF\n", strings.Join(nargs, " "))
|
fmt.Fprintf(os.Stderr, "$ %s <<EOF\n", strings.Join(nargs, " "))
|
||||||
|
|
Loading…
Reference in a new issue