]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: don't generate DWARF in the compiler if the linker will discard it
authorJosh Bleecher Snyder <josharian@gmail.com>
Sun, 16 Apr 2017 13:14:27 +0000 (06:14 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Mon, 17 Apr 2017 03:16:36 +0000 (03:16 +0000)
Change-Id: I7610f968f5c22b51a6a8813d6f31ccb772a12ba9
Reviewed-on: https://go-review.googlesource.com/40858
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/go/internal/work/build.go

index 37c84887a42db4f4970b715c34ae46933972683f..0e1cadd390a290795512e11bac7e93cc8db828f5 100644 (file)
@@ -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 {