Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: respect environment LDFLAGS and strip the build path
golang does not natively respect LDFLAGS, but you can pass them on the command line using -ldflags=-extldflags=... This is important for distributions, in order to provide common functionality such as hardening flags. Also strip the prefixed root source directory from the embedded source file paths. This is not important information for the debugger, which should only care about paths relative to $GOPATH, and results in less build environment metadata leaking into the final binary. (This also aids in reproducible builds when using different build directories, see e.g. golang/go#16860)
- Loading branch information