Fix SGX target_env collision
Signed-off-by: Yu Ding <dingelish@gmail.com>
This commit is contained in:
parent
35d9cc37bb
commit
a9a108548c
2
build.rs
2
build.rs
|
@ -22,7 +22,7 @@ fn main() {
|
|||
|
||||
// Forcibly enable memory intrinsics on wasm32 & SGX as we don't have a libc to
|
||||
// provide them.
|
||||
if target.contains("wasm32") || target.contains("sgx") {
|
||||
if target.contains("wasm32") || (target.contains("sgx") && target.contains("fortanix")) {
|
||||
println!("cargo:rustc-cfg=feature=\"mem\"");
|
||||
}
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#![feature(abi_unadjusted)]
|
||||
#![feature(linkage)]
|
||||
#![feature(lang_items)]
|
||||
#![feature(cfg_target_vendor)]
|
||||
#![allow(unused_features)]
|
||||
#![no_builtins]
|
||||
#![cfg_attr(feature = "compiler-builtins", feature(staged_api))]
|
||||
|
@ -49,7 +50,7 @@ pub mod float;
|
|||
|
||||
#[cfg(any(all(target_arch = "wasm32", target_os = "unknown"),
|
||||
all(target_arch = "arm", target_os = "none"),
|
||||
target_env = "sgx"))]
|
||||
all(target_vendor = "fortanix", target_env = "sgx")))]
|
||||
pub mod math;
|
||||
pub mod mem;
|
||||
|
||||
|
|
|
@ -15,7 +15,8 @@ macro_rules! no_mangle {
|
|||
}
|
||||
|
||||
// only for the wasm32-unknown-unknown target
|
||||
#[cfg(any(all(target_arch = "wasm32", target_os = "unknown"), target_env = "sgx"))]
|
||||
#[cfg(any(all(target_arch = "wasm32", target_os = "unknown"),
|
||||
all(target_vendor = "fortanix", target_env = "sgx")))]
|
||||
no_mangle! {
|
||||
fn acos(x: f64) -> f64;
|
||||
fn asin(x: f64) -> f64;
|
||||
|
@ -66,7 +67,7 @@ no_mangle! {
|
|||
fn tanhf(n: f32) -> f32;
|
||||
}
|
||||
|
||||
#[cfg(target_env = "sgx")]
|
||||
#[cfg(all(target_vendor = "fortanix", target_env = "sgx"))]
|
||||
no_mangle! {
|
||||
fn ceil(x: f64) -> f64;
|
||||
fn ceilf(x: f32) -> f32;
|
||||
|
|
Loading…
Reference in New Issue