From 25c30821afda5149976cfedb6c945e49c5ff075a Mon Sep 17 00:00:00 2001 From: Jethro Beekman Date: Thu, 1 Nov 2018 15:59:07 -0700 Subject: [PATCH] Add SGX target --- library/stdarch/coresimd/x86/cpuid.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/library/stdarch/coresimd/x86/cpuid.rs b/library/stdarch/coresimd/x86/cpuid.rs index b459ab58aa31..109627f85f9f 100644 --- a/library/stdarch/coresimd/x86/cpuid.rs +++ b/library/stdarch/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: