diff options
author | Russ Cox <rsc@golang.org> | 2022-04-27 09:03:35 -0400 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2022-04-29 14:23:19 +0000 |
commit | e5407501cb5c43f9ba874fe5dad215435acbf5a2 (patch) | |
tree | 656e8f9892a61d65a75c05b933570de49c2b5a4a /src/cmd/compile/internal/liveness/plive.go | |
parent | fe006d641079e8943833573bd1275ef51eb7fb60 (diff) | |
download | go-e5407501cb5c43f9ba874fe5dad215435acbf5a2.tar.gz go-e5407501cb5c43f9ba874fe5dad215435acbf5a2.zip |
[dev.boringcrypto] cmd: use notsha256 instead of md5, sha1, sha256
When we add GOEXPERIMENT=boringcrypto, the bootstrap process
will not converge if the compiler itself depends on the boringcrypto
cgo-based implementations of sha1 and sha256.
Using notsha256 avoids boringcrypto and makes bootstrap converge.
Removing md5 is not strictly necessary but it seemed worthwhile to
be consistent.
For #51940.
Change-Id: Iba649507e0964d1a49a1d16e463dd23c4e348f14
Reviewed-on: https://go-review.googlesource.com/c/go/+/402595
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/liveness/plive.go')
-rw-r--r-- | src/cmd/compile/internal/liveness/plive.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/compile/internal/liveness/plive.go b/src/cmd/compile/internal/liveness/plive.go index bd0a6fa1a3..93f49fad45 100644 --- a/src/cmd/compile/internal/liveness/plive.go +++ b/src/cmd/compile/internal/liveness/plive.go @@ -15,7 +15,6 @@ package liveness import ( - "crypto/sha1" "fmt" "os" "sort" @@ -30,6 +29,7 @@ import ( "cmd/compile/internal/ssa" "cmd/compile/internal/typebits" "cmd/compile/internal/types" + "cmd/internal/notsha256" "cmd/internal/obj" "cmd/internal/objabi" "cmd/internal/src" @@ -959,7 +959,7 @@ func (lv *liveness) enableClobber() { // Clobber only functions where the hash of the function name matches a pattern. // Useful for binary searching for a miscompiled function. hstr := "" - for _, b := range sha1.Sum([]byte(lv.f.Name)) { + for _, b := range notsha256.Sum256([]byte(lv.f.Name)) { hstr += fmt.Sprintf("%08b", b) } if !strings.HasSuffix(hstr, h) { |