From: Josh Bleecher Snyder Date: Sun, 16 Apr 2017 13:14:27 +0000 (-0700) Subject: cmd/go: don't generate DWARF in the compiler if the linker will discard it X-Git-Tag: go1.9beta1~669 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=87065a3c13f373072c1db81dbf3832f0b9e17492;p=gostls13.git cmd/go: don't generate DWARF in the compiler if the linker will discard it Change-Id: I7610f968f5c22b51a6a8813d6f31ccb772a12ba9 Reviewed-on: https://go-review.googlesource.com/40858 Run-TryBot: Josh Bleecher Snyder TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- diff --git a/src/cmd/go/internal/work/build.go b/src/cmd/go/internal/work/build.go index 37c84887a4..0e1cadd390 100644 --- a/src/cmd/go/internal/work/build.go +++ b/src/cmd/go/internal/work/build.go @@ -2203,6 +2203,9 @@ func (gcToolchain) gc(b *Builder, p *load.Package, archive, obj string, asmhdr b if p.Internal.BuildID != "" { gcargs = append(gcargs, "-buildid", p.Internal.BuildID) } + if p.Internal.OmitDebug { + gcargs = append(gcargs, "-dwarf=false") + } for _, path := range p.Imports { if i := strings.LastIndex(path, "/vendor/"); i >= 0 {