|author||Cherry Zhang <email@example.com>||Wed Aug 26 18:19:03 2020 -0400|
|committer||Cherry Zhang <firstname.lastname@example.org>||Tue Sep 08 15:09:48 2020 +0000|
cmd/link: strip STAB (symbolic debugging) symbols on darwin On darwin, with external linking, the system linker produces STAB (symbolic debugging) symbols in the binary's symbol table. These include paths of the intermediate object files, like <tmpdir>/go.o, which changes from run to run, making the build non-reproducible. Since we run dsymutil to produce debug info and combine them back into the binary, we don't need those STAB symbols anymore. Strip them after running dsymutil. If DWARF is not enabled, we don't run dsymutil. We can pass "-Wl,-S" to let the system linker not generate those symbols. While here, also make it more consistent about DWARF combining. Currently we only do DWARF combining on macOS/AMD64, when DWARF is enabled. On ARM64, we run dsymutil, but then throw the result away. This CL changes it to not run dsymutil (and strip) on ARM64. TODO: add a test. We don't do it here as it fails on some (non-darwin) platforms. Fixes #40979. Change-Id: If770f7828cdb858857d6079e0585bf067f8f7a92 Reviewed-on: https://go-review.googlesource.com/c/go/+/250944 Run-TryBot: Cherry Zhang <email@example.com> TryBot-Result: Gobot Gobot <firstname.lastname@example.org> Reviewed-by: Ian Lance Taylor <email@example.com> Reviewed-by: Than McIntosh <firstname.lastname@example.org>
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
Official binary distributions are available at https://golang.org/dl/.
If a binary distribution is not available for your combination of operating system and architecture, visit https://golang.org/doc/install/source or load doc/install-source.html in your web browser for source installation instructions.
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines: https://golang.org/doc/contribute.html
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://golang.org/wiki/Questions for a list of places to ask questions about the Go language.