diff --git a/patches/0016-Disable-cpuid-intrinsic.patch b/patches/0016-Disable-cpuid-intrinsic.patch index ac24bc6e88c..0cccdb13ad6 100644 --- a/patches/0016-Disable-cpuid-intrinsic.patch +++ b/patches/0016-Disable-cpuid-intrinsic.patch @@ -11,12 +11,14 @@ diff --git a/src/stdarch/crates/core_arch/src/x86/cpuid.rs b/src/stdarch/crates/ index f313c42..ff952bc 100644 --- a/src/stdarch/crates/core_arch/src/x86/cpuid.rs +++ b/src/stdarch/crates/core_arch/src/x86/cpuid.rs -@@ -84,6 +84,9 @@ pub unsafe fn __cpuid(leaf: u32) -> CpuidResult { +@@ -84,6 +84,11 @@ pub unsafe fn __cpuid(leaf: u32) -> CpuidResult { /// Does the host support the `cpuid` instruction? #[inline] pub fn has_cpuid() -> bool { + // __cpuid intrinsic is not yet implemented -+ return false; ++ #[cfg(target_feature = "cg_clif")] { ++ return false; ++ } + #[cfg(target_env = "sgx")] { diff --git a/src/lib.rs b/src/lib.rs index 517ccd41706..cb89afbf619 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -188,11 +188,13 @@ impl CodegenBackend for CraneliftCodegenBackend { // rustdoc needs to be able to document functions that use all the features, so // whitelist them all target_features_whitelist::all_known_features() + .chain(Some(("cg_clif", None))) .map(|(a, b)| (a.to_string(), b)) .collect() } else { target_features_whitelist::target_feature_whitelist(tcx.sess) .iter() + .chain(&Some(("cg_clif", None))) .map(|&(a, b)| (a.to_string(), b)) .collect() } @@ -200,6 +202,10 @@ impl CodegenBackend for CraneliftCodegenBackend { } fn provide_extern(&self, _providers: &mut Providers<'_>) {} + fn target_features(&self, _sess: &Session) -> Vec { + vec![rustc_span::Symbol::intern("cg_clif")] + } + fn codegen_crate<'tcx>( &self, tcx: TyCtxt<'tcx>,