summaryrefslogtreecommitdiff
path: root/libgo/go
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2017-01-03 20:41:54 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2017-01-03 20:41:54 +0000
commit41981ad60fe3168651f4c6e8d1dc4b801ea4df1a (patch)
treee91a764a7f1c84b2581d2ad59d2e3c768e807937 /libgo/go
parent3b50f2026555b7c7902e74531f6cb230ac3d83c7 (diff)
downloadgcc-41981ad60fe3168651f4c6e8d1dc4b801ea4df1a.tar.gz
PR go/78789
runtime: don't build aeshash.c if the assembler doesn't support it This is for CentOS 5, whose assembler does not know the aesinc instruction. Fixes GCC PR 78789. Patch by Uros Bizjak. Reviewed-on: https://go-review.googlesource.com/34796 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244031 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/go')
-rw-r--r--libgo/go/runtime/alg.go1
-rw-r--r--libgo/go/runtime/runtime2.go3
-rw-r--r--libgo/go/runtime/stubs.go6
3 files changed, 9 insertions, 1 deletions
diff --git a/libgo/go/runtime/alg.go b/libgo/go/runtime/alg.go
index 5ec19d0a9f9..53312313017 100644
--- a/libgo/go/runtime/alg.go
+++ b/libgo/go/runtime/alg.go
@@ -233,6 +233,7 @@ func alginit() {
// Install aes hash algorithm if we have the instructions we need
if (GOARCH == "386" || GOARCH == "amd64") &&
GOOS != "nacl" &&
+ support_aes &&
cpuid_ecx&(1<<25) != 0 && // aes (aesenc)
cpuid_ecx&(1<<9) != 0 && // sse3 (pshufb)
cpuid_ecx&(1<<19) != 0 { // sse4.1 (pinsr{d,q})
diff --git a/libgo/go/runtime/runtime2.go b/libgo/go/runtime/runtime2.go
index 978a3172d0f..6686e1f29b3 100644
--- a/libgo/go/runtime/runtime2.go
+++ b/libgo/go/runtime/runtime2.go
@@ -771,7 +771,8 @@ var (
// Information about what cpu features are available.
// Set on startup.
- cpuid_ecx uint32
+ cpuid_ecx uint32
+ support_aes bool
// cpuid_edx uint32
// cpuid_ebx7 uint32
diff --git a/libgo/go/runtime/stubs.go b/libgo/go/runtime/stubs.go
index dde9ebdfdd6..c299ae0e8eb 100644
--- a/libgo/go/runtime/stubs.go
+++ b/libgo/go/runtime/stubs.go
@@ -272,6 +272,12 @@ func setCpuidECX(v uint32) {
cpuid_ecx = v
}
+// For gccgo, to communicate from the C code to the Go code.
+//go:linkname setSupportAES runtime.setSupportAES
+func setSupportAES(v bool) {
+ support_aes = v
+}
+
// typedmemmove copies a typed value.
// For gccgo for now.
//go:nosplit