aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/cgo/main.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2022-04-27 09:03:35 -0400
committerRuss Cox <rsc@golang.org>2022-04-29 14:23:19 +0000
commite5407501cb5c43f9ba874fe5dad215435acbf5a2 (patch)
tree656e8f9892a61d65a75c05b933570de49c2b5a4a /src/cmd/cgo/main.go
parentfe006d641079e8943833573bd1275ef51eb7fb60 (diff)
downloadgo-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/cgo/main.go')
-rw-r--r--src/cmd/cgo/main.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cmd/cgo/main.go b/src/cmd/cgo/main.go
index 364d8b81fb..75d48c2ede 100644
--- a/src/cmd/cgo/main.go
+++ b/src/cmd/cgo/main.go
@@ -11,7 +11,6 @@
package main
import (
- "crypto/md5"
"flag"
"fmt"
"go/ast"
@@ -28,6 +27,7 @@ import (
"strings"
"cmd/internal/edit"
+ "cmd/internal/notsha256"
"cmd/internal/objabi"
)
@@ -329,8 +329,8 @@ func main() {
// we use to coordinate between gcc and ourselves.
// We already put _cgo_ at the beginning, so the main
// concern is other cgo wrappers for the same functions.
- // Use the beginning of the md5 of the input to disambiguate.
- h := md5.New()
+ // Use the beginning of the notsha256 of the input to disambiguate.
+ h := notsha256.New()
io.WriteString(h, *importPath)
fs := make([]*File, len(goFiles))
for i, input := range goFiles {