Introduce #[cfg(target_feature = "cg_clif")]

This commit is contained in:
bjorn3 2020-06-20 16:22:03 +02:00
parent 392348d3d1
commit 431cebdca1
2 changed files with 10 additions and 2 deletions

View File

@ -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")]
{

View File

@ -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<rustc_span::Symbol> {
vec![rustc_span::Symbol::intern("cg_clif")]
}
fn codegen_crate<'tcx>(
&self,
tcx: TyCtxt<'tcx>,