]> Cypherpunks repositories - gostls13.git/commit
cmd/dist: omit DWARF in build release toolchain binaries
authorRuss Cox <rsc@golang.org>
Wed, 8 Mar 2023 19:48:41 +0000 (14:48 -0500)
committerGopher Robot <gobot@golang.org>
Mon, 13 Mar 2023 16:49:42 +0000 (16:49 +0000)
commitc67a27bf7520ae9440a665e80c7c3891bafb33d4
tree84643a9861cd1969b2cf19b70a8e66023ba2742f
parent91c82ff7c972d0bd6f67d49e11bcba25e7eb287e
cmd/dist: omit DWARF in build release toolchain binaries

The vast majority of users of Go toolchains have no need for
binaries like the go command and compiler to include DWARF
information, and the DWARF information is 34% of the size of
the overall Go toolchain zip files (14% when the toolchain is
unzipped on disk, because other parts get bigger).

To save network and disk, disable DWARF in build release binaries.
DWARF remains enabled when developing in the main branch
(signaled by no VERSION file existing), for better debuggability
when actually working on the compiler and go command.

Note that removing DWARF does not break the backtraces shown
when a binary panics, nor does it break other uses of stack traces
from within a Go program, such as runtime.Callers.

To build a release toolchain with DWARF included, people can use

GO_LDFLAGS=-w=0 ./make.bash

Change-Id: Ib0bbe1446adca4599066b2fb2f2734e6825c1106
Reviewed-on: https://go-review.googlesource.com/c/go/+/475378
Auto-Submit: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/compile/internal/ssa/stmtlines_test.go
src/cmd/dist/build.go