Skip to content

Commit 87065a3

Browse files
committed
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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent da67c23 commit 87065a3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/cmd/go/internal/work/build.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2203,6 +2203,9 @@ func (gcToolchain) gc(b *Builder, p *load.Package, archive, obj string, asmhdr b
22032203
if p.Internal.BuildID != "" {
22042204
gcargs = append(gcargs, "-buildid", p.Internal.BuildID)
22052205
}
2206+
if p.Internal.OmitDebug {
2207+
gcargs = append(gcargs, "-dwarf=false")
2208+
}
22062209

22072210
for _, path := range p.Imports {
22082211
if i := strings.LastIndex(path, "/vendor/"); i >= 0 {

0 commit comments

Comments
 (0)