Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/compile: make all positions x.go:1:1
This shrinks binaries by about 6%, if you're using -ldflags=-w. Backtraces should still work, with function names and PCs and arguments, but all line numbers will display as x.go:1. This breaks any tests that depend on correct line numbers. For example, net/http: --- FAIL: TestWriteHeaderNoCodeCheck_h1hijack (0.00s) x.go:1: stderr output = "http: response.WriteHeader on hijacked connection from net/http_test.testWriteHeaderAfterWrite.func1 (x.go:1)"; want "http: response.WriteHeader on hijacked connection from net/http_test.testWriteHeaderAfterWrite.func1 (clientserver_test.go:" --- FAIL: TestWriteHeaderNoCodeCheck_h1 (0.01s) x.go:1: stderr output = "http: superfluous response.WriteHeader call from net/http_test.testWriteHeaderAfterWrite.func1 (x.go:1)"; want "http: superfluous response.WriteHeader call from net/http_test.testWriteHeaderAfterWrite.func1 (clientserver_test.go:" FAIL FAIL net/http 13.940s Remove an invariant check in dwinl.go that's broken by this. See golang#38698. That may break debugging. But if you care enough about binary size to use this, you're already stripping binaries with -ldflags=-w. Remove a security check around cgo pragma placements. Unfortunate, but if you're using a hacked toolchain, you should always make sure your code still builds and passes tests with a regular toolchain. Change-Id: I56c7540ea856a3bdccf8d44b5c3dbd4803545015
- Loading branch information