From 895d832da9285ae97418dc83688bcec536ee4857 Mon Sep 17 00:00:00 2001 From: Jethro Beekman Date: Thu, 1 Nov 2018 15:59:07 -0700 Subject: [PATCH] Add SGX target --- coresimd/x86/cpuid.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/coresimd/x86/cpuid.rs b/coresimd/x86/cpuid.rs index 117b593bd3..54c61464c3 100644 --- a/coresimd/x86/cpuid.rs +++ b/coresimd/x86/cpuid.rs @@ -80,11 +80,15 @@ pub unsafe fn __cpuid(leaf: u32) -> CpuidResult { /// Does the host support the `cpuid` instruction? #[inline] pub fn has_cpuid() -> bool { - #[cfg(target_arch = "x86_64")] + #[cfg(target_env = "sgx")] + { + false + } + #[cfg(all(not(target_env = "sgx"), target_arch = "x86_64"))] { true } - #[cfg(target_arch = "x86")] + #[cfg(all(not(target_env = "sgx"), target_arch = "x86"))] { // Optimization for i586 and i686 Rust targets which SSE enabled // and support cpuid: