We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 939cbca + e43c838 commit 4890819Copy full SHA for 4890819
build.rs
@@ -17,9 +17,9 @@ fn main() {
17
return;
18
}
19
20
- // 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
21
// provide them.
22
- if target.contains("wasm32") {
+ if target.contains("wasm32") || target.contains("sgx") {
23
println!("cargo:rustc-cfg=feature=\"mem\"");
24
25
src/lib.rs
@@ -48,7 +48,8 @@ pub mod int;
48
pub mod float;
49
50
#[cfg(any(all(target_arch = "wasm32", target_os = "unknown"),
51
- all(target_arch = "arm", target_os = "none")))]
+ all(target_arch = "arm", target_os = "none"),
52
+ target_env = "sgx"))]
53
pub mod math;
54
pub mod mem;
55
src/math.rs
@@ -15,7 +15,7 @@ macro_rules! no_mangle {
15
16
// 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! {
fn acos(x: f64) -> f64;
fn asin(x: f64) -> f64;
@@ -51,6 +51,19 @@ no_mangle! {
fn fmodf(x: f32, y: f32) -> f32;
fn fma(x: f64, y: f64, z: f64) -> f64;
fn fmaf(x: f32, y: f32, z: f32) -> f32;
+ fn acosf(n: f32) -> f32;
+ fn asinf(n: f32) -> f32;
56
+ fn atan2f(a: f32, b: f32) -> f32;
57
+ fn atanf(n: f32) -> f32;
58
+ fn cbrtf(n: f32) -> f32;
59
+ fn coshf(n: f32) -> f32;
60
+ fn expm1f(n: f32) -> f32;
61
+ fn fdimf(a: f32, b: f32) -> f32;
62
+ fn hypotf(x: f32, y: f32) -> f32;
63
+ fn log1pf(n: f32) -> f32;
64
+ fn sinhf(n: f32) -> f32;
65
+ fn tanf(n: f32) -> f32;
66
+ fn tanhf(n: f32) -> f32;
67
68
69
// only for the thumb*-none-eabi* targets
0 commit comments