-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Commit 8bab1c8
cmd/cgo: don't generate random numbers for symbols
If cgo is built with -flto the symbols in runtime/cgo is going to
include random numbers which would make builds unreproducible.
Settings -frandom-seeds ensures this is consistent across builds, and to
ensure we always use a reproducible seed across builds we use the
actionID as the seed string.
runtime/cgo built with "-frandom-seed=OFEc9OKoUMJwh3-5yFCH" would output
the following:
$ strings --all --bytes=8 $WORK/b055/_pkg_.a | grep "gnu.lto_.profile"
.gnu.lto_.profile.8403a797
.gnu.lto_.profile.8403a797
.gnu.lto_.profile.8403a797
.gnu.lto_.profile.8403a797
.gnu.lto_.profile.8403a797
.gnu.lto_.profile.8403a797
.gnu.lto_.profile.8403a797
.gnu.lto_.profile.8403a797
.gnu.lto_.profile.8403a797
.gnu.lto_.profile.8403a797
.gnu.lto_.profile.8403a797
.gnu.lto_.profile.8403a7971 parent 2e773a3 commit 8bab1c8
1 file changed
+7
-0
lines changedLines changed: 7 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
36 | 36 |
| |
37 | 37 |
| |
38 | 38 |
| |
39 | + | ||
39 | 40 |
| |
40 | 41 |
| |
41 | 42 |
| |
| |||
2368 | 2369 |
| |
2369 | 2370 |
| |
2370 | 2371 |
| |
2372 | + | ||
2373 | + | ||
2374 | + | ||
2375 | + | ||
2376 | + | ||
2377 | + | ||
2371 | 2378 |
| |
2372 | 2379 |
| |
2373 | 2380 |
| |
|
0 commit comments