commit
4890819c37
4
build.rs
4
build.rs
@ -17,9 +17,9 @@ fn main() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Forcibly enable memory intrinsics on wasm32 as we don't have a libc to
|
// Forcibly enable memory intrinsics on wasm32 & SGX as we don't have a libc to
|
||||||
// provide them.
|
// provide them.
|
||||||
if target.contains("wasm32") {
|
if target.contains("wasm32") || target.contains("sgx") {
|
||||||
println!("cargo:rustc-cfg=feature=\"mem\"");
|
println!("cargo:rustc-cfg=feature=\"mem\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,7 +48,8 @@ pub mod int;
|
|||||||
pub mod float;
|
pub mod float;
|
||||||
|
|
||||||
#[cfg(any(all(target_arch = "wasm32", target_os = "unknown"),
|
#[cfg(any(all(target_arch = "wasm32", target_os = "unknown"),
|
||||||
all(target_arch = "arm", target_os = "none")))]
|
all(target_arch = "arm", target_os = "none"),
|
||||||
|
target_env = "sgx"))]
|
||||||
pub mod math;
|
pub mod math;
|
||||||
pub mod mem;
|
pub mod mem;
|
||||||
|
|
||||||
|
15
src/math.rs
15
src/math.rs
@ -15,7 +15,7 @@ macro_rules! no_mangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// only for the wasm32-unknown-unknown target
|
// only for the wasm32-unknown-unknown target
|
||||||
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
|
#[cfg(any(all(target_arch = "wasm32", target_os = "unknown"), target_env = "sgx"))]
|
||||||
no_mangle! {
|
no_mangle! {
|
||||||
fn acos(x: f64) -> f64;
|
fn acos(x: f64) -> f64;
|
||||||
fn asin(x: f64) -> f64;
|
fn asin(x: f64) -> f64;
|
||||||
@ -51,6 +51,19 @@ no_mangle! {
|
|||||||
fn fmodf(x: f32, y: f32) -> f32;
|
fn fmodf(x: f32, y: f32) -> f32;
|
||||||
fn fma(x: f64, y: f64, z: f64) -> f64;
|
fn fma(x: f64, y: f64, z: f64) -> f64;
|
||||||
fn fmaf(x: f32, y: f32, z: f32) -> f32;
|
fn fmaf(x: f32, y: f32, z: f32) -> f32;
|
||||||
|
fn acosf(n: f32) -> f32;
|
||||||
|
fn asinf(n: f32) -> f32;
|
||||||
|
fn atan2f(a: f32, b: f32) -> f32;
|
||||||
|
fn atanf(n: f32) -> f32;
|
||||||
|
fn cbrtf(n: f32) -> f32;
|
||||||
|
fn coshf(n: f32) -> f32;
|
||||||
|
fn expm1f(n: f32) -> f32;
|
||||||
|
fn fdimf(a: f32, b: f32) -> f32;
|
||||||
|
fn hypotf(x: f32, y: f32) -> f32;
|
||||||
|
fn log1pf(n: f32) -> f32;
|
||||||
|
fn sinhf(n: f32) -> f32;
|
||||||
|
fn tanf(n: f32) -> f32;
|
||||||
|
fn tanhf(n: f32) -> f32;
|
||||||
}
|
}
|
||||||
|
|
||||||
// only for the thumb*-none-eabi* targets
|
// only for the thumb*-none-eabi* targets
|
||||||
|
Loading…
Reference in New Issue
Block a user