commit | e8f918535e6c9fc7b85a9dadc9e8035a2e1d1fa4 | [log] [tgz] |
---|---|---|
author | Cherry Zhang <cherryyz@google.com> | Wed Aug 26 18:19:03 2020 -0400 |
committer | Cherry Zhang <cherryyz@google.com> | Tue Sep 08 15:09:48 2020 +0000 |
tree | e16045b3cb9c52364a1d10d2c235e5d06b4edc18 | |
parent | 565ad134c994b7a831e1bea336fdc64f0aeefc85 [diff] |
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 <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
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/.
After downloading a binary release, visit https://golang.org/doc/install or load doc/install.html in your web browser for installation instructions.
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.