Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
build: respect environment LDFLAGS and strip the build path #1994
golang does not natively respect LDFLAGS, but you can pass them on the command line using -ldflags=-extldflags=...
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)
I've been trying to think what to do for go 1.9, the problem is that
From the release notes:
I think the solution is to do string comparison on the output of