Commit 1a3e66c
committed
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: I56c7540ea856a3bdccf8d44b5c3dbd48035450151 parent 9d812cf commit 1a3e66c
3 files changed
+2
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | 224 | | |
228 | 225 | | |
229 | 226 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1584 | 1584 | | |
1585 | 1585 | | |
1586 | 1586 | | |
1587 | | - | |
1588 | | - | |
1589 | | - | |
1590 | | - | |
1591 | | - | |
1592 | | - | |
1593 | 1587 | | |
1594 | 1588 | | |
1595 | 1589 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
102 | 103 | | |
103 | 104 | | |
104 | 105 | | |
| |||
0 commit comments