Skip to content

Commit

Permalink
Strip debug symbols from binaries
Browse files Browse the repository at this point in the history
The debug symbols are only required for external tools (like debuggers or third party profilers). This does not affect Go stack traces or pprof.

Closes elastic#12768
  • Loading branch information
andrewkroh committed Aug 15, 2019
1 parent 787f0d4 commit 7ab10b8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-developer.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ The list below covers the major changes between 7.0.0-rc2 and master only.
- Add support to close beat.Client via beat.CloseRef (a subset of context.Context). {pull}13031[13031]
- Add checks for types and formats used in fields definitions in `fields.yml` files. {pull}13188[13188]
- Makefile included in generator copies files from beats repository using `git archive` instead of cp. {pull}13193[13193]
- Strip debug symbols from binaries to reduce binary sizes. {issue}12768[12768]
3 changes: 3 additions & 0 deletions dev-tools/mage/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ func DefaultBuildArgs() BuildArgs {
args := BuildArgs{
Name: BeatName,
CGO: build.Default.CgoEnabled,
LDFlags: []string{
"-s", // Strip all debug symbols from binary (does not affect Go stack traces).
},
Vars: map[string]string{
"github.com/elastic/beats/libbeat/version.buildTime": "{{ date }}",
"github.com/elastic/beats/libbeat/version.commit": "{{ commit }}",
Expand Down

0 comments on commit 7ab10b8

Please sign in to comment.