From: Oryan Moshe Date: Fri, 3 Aug 2018 11:52:39 +0000 (+0300) Subject: cmd/cgo: pass explicit -O0 to the compiler X-Git-Tag: go1.12beta1~1304 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=eeb8aebed6d158ad55cea346fdd659f6d6112de5;p=gostls13.git 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 TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- diff --git a/src/cmd/cgo/gcc.go b/src/cmd/cgo/gcc.go index 20e794b4be..019ee64c8e 100644 --- a/src/cmd/cgo/gcc.go +++ b/src/cmd/cgo/gcc.go @@ -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 <