Skip to content

Commit 4890819

Browse files
authored
Merge pull request #263 from jethrogb/jb/sgx-target
Add SGX target
2 parents 939cbca + e43c838 commit 4890819

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

build.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ fn main() {
1717
return;
1818
}
1919

20-
// Forcibly enable memory intrinsics on wasm32 as we don't have a libc to
20+
// Forcibly enable memory intrinsics on wasm32 & SGX as we don't have a libc to
2121
// provide them.
22-
if target.contains("wasm32") {
22+
if target.contains("wasm32") || target.contains("sgx") {
2323
println!("cargo:rustc-cfg=feature=\"mem\"");
2424
}
2525

src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ pub mod int;
4848
pub mod float;
4949

5050
#[cfg(any(all(target_arch = "wasm32", target_os = "unknown"),
51-
all(target_arch = "arm", target_os = "none")))]
51+
all(target_arch = "arm", target_os = "none"),
52+
target_env = "sgx"))]
5253
pub mod math;
5354
pub mod mem;
5455

src/math.rs

+14-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ macro_rules! no_mangle {
1515
}
1616

1717
// only for the wasm32-unknown-unknown target
18-
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
18+
#[cfg(any(all(target_arch = "wasm32", target_os = "unknown"), target_env = "sgx"))]
1919
no_mangle! {
2020
fn acos(x: f64) -> f64;
2121
fn asin(x: f64) -> f64;
@@ -51,6 +51,19 @@ no_mangle! {
5151
fn fmodf(x: f32, y: f32) -> f32;
5252
fn fma(x: f64, y: f64, z: f64) -> f64;
5353
fn fmaf(x: f32, y: f32, z: f32) -> f32;
54+
fn acosf(n: f32) -> f32;
55+
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;
5467
}
5568

5669
// only for the thumb*-none-eabi* targets

0 commit comments

Comments
 (0)