mirror of
https://github.com/emmansun/gmsm.git
synced 2025-05-19 15:36:18 +08:00
fixbug: Apple Silicon build fail.
This commit is contained in:
parent
7fee50dfe9
commit
8fc2696d46
@ -1,6 +1,20 @@
|
||||
package cpuid
|
||||
|
||||
import "golang.org/x/sys/cpu"
|
||||
import (
|
||||
"runtime"
|
||||
|
||||
var HasAES = cpu.ARM64.HasAES
|
||||
var HasGFMUL = cpu.ARM64.HasPMULL
|
||||
"golang.org/x/sys/cpu"
|
||||
)
|
||||
|
||||
var HasAES = false
|
||||
var HasGFMUL = false
|
||||
|
||||
func init() {
|
||||
if runtime.GOOS == "darwin/arm64" {
|
||||
HasAES = true
|
||||
HasGFMUL = true
|
||||
} else {
|
||||
HasAES = cpu.ARM64.HasAES
|
||||
HasGFMUL = cpu.ARM64.HasPMULL
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +0,0 @@
|
||||
//go:build arm64 && darwin && !ios
|
||||
|
||||
package cpuid
|
||||
|
||||
// There are no hw.optional sysctl values for the below features on Mac OS 11.0
|
||||
// to detect their supported state dynamically. Assume the CPU features that
|
||||
// Apple Silicon M1 supports to be available as a minimal set of features
|
||||
// to all Go programs running on darwin/arm64.
|
||||
var HasAES = true
|
||||
var HasGFMUL = true
|
Loading…
x
Reference in New Issue
Block a user