Skip to content

Commit e43c838

Browse files
author
Jethro Beekman
committed
Add SGX target
1 parent 14685d2 commit e43c838

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-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

+1-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;

0 commit comments

Comments
 (0)