Skip to content
This repository was archived by the owner on May 16, 2021. It is now read-only.

Commit 9ebf95d

Browse files
respect CPU overrides via GODEBUG=cpu.all=off
See golang/go#33963.
1 parent 2c65562 commit 9ebf95d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

common.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,6 +1112,12 @@ func initDefaultCipherSuites() {
11121112
hasGCMAsm = hasGCMAsmAMD64 || hasGCMAsmARM64 || hasGCMAsmS390X
11131113
)
11141114

1115+
// x/sys/cpu does not respect GODEBUG=cpu.all=off. As a workaround,
1116+
// check it here. See https://github.com/golang/go/issues/33963
1117+
if strings.Contains(os.Getenv("GODEBUG"), "cpu.all=off") {
1118+
hasGCMAsm = false
1119+
}
1120+
11151121
if hasGCMAsm {
11161122
// If AES-GCM hardware is provided then prioritise AES-GCM
11171123
// cipher suites.

0 commit comments

Comments
 (0)