Commit eeb8aebe authored by Oryan Moshe's avatar Oryan Moshe Committed by Ian Lance Taylor

cmd/cgo: pass explicit -O0 to the compiler

The current implementation removes all of the optimization flags from
the compiler.
Added the -O0 optimization flag after the removal loop, so go can
compile cgo on every OS consistently.

Fixes #26487

Change-Id: Ia98bca90def186dfe10f50b1787c2f40d85533da
Reviewed-on: https://go-review.googlesource.com/127755
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent a3381faf
......@@ -1693,6 +1693,9 @@ func (p *Package) gccErrors(stdin []byte) string {
}
}
// Force -O0 optimization
nargs = append(nargs, "-O0")
if *debugGcc {
fmt.Fprintf(os.Stderr, "$ %s <<EOF\n", strings.Join(nargs, " "))
os.Stderr.Write(stdin)
......
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