From e7e72f1eb70e22329bd8fa00e749d60d4777f7f0 Mon Sep 17 00:00:00 2001 From: Yu Ding Date: Sat, 25 Jan 2020 21:45:24 -0800 Subject: [PATCH] Port 0.7.3 to SGX --- .drone.yml | 101 +++++++++++++++++++++ .github/pull.yml | 5 + Cargo.toml | 29 +++--- Xargo.toml | 95 +++++++++++++++++++ rand_chacha/Cargo.toml | 10 +- rand_chacha/src/chacha.rs | 7 +- rand_chacha/src/lib.rs | 8 ++ rand_core/Cargo.toml | 8 +- rand_core/src/error.rs | 5 +- rand_core/src/lib.rs | 17 ++++ rand_distr/Cargo.toml | 5 + rand_distr/src/dirichlet.rs | 3 + rand_distr/src/lib.rs | 7 ++ rand_pcg/Cargo.toml | 2 +- src/distributions/dirichlet.rs | 2 + src/distributions/weighted/alias_method.rs | 1 + src/distributions/weighted/mod.rs | 2 + src/lib.rs | 19 +++- src/rngs/adapter/reseeding.rs | 4 +- src/seq/index.rs | 1 + src/seq/mod.rs | 1 + x86_64-unknown-linux-sgx.json | 31 +++++++ 22 files changed, 337 insertions(+), 26 deletions(-) create mode 100644 .drone.yml create mode 100644 .github/pull.yml create mode 100644 Xargo.toml create mode 100644 x86_64-unknown-linux-sgx.json diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 00000000000..11ccfad4544 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,101 @@ +kind: pipeline +name: rand-sgx-xargo-1604-release + +steps: +- name: release-compile + image: baiduxlab/sgx-rust:1604-1.1.0 + commands: + - . /opt/sgxsdk/environment + - . /root/.cargo/env + - RUST_TARGET_PATH=`pwd` xargo build --target x86_64-unknown-linux-sgx --release + +--- + +kind: pipeline +name: rand-sgx-xargo-1604-debug + +steps: +- name: debug-compile + image: baiduxlab/sgx-rust:1604-1.1.0 + commands: + - . /opt/sgxsdk/environment + - . /root/.cargo/env + - RUST_TARGET_PATH=`pwd` xargo build --target x86_64-unknown-linux-sgx + +--- + +kind: pipeline +name: rand-sgx-xargo-1804-release + +steps: +- name: release-compile + image: baiduxlab/sgx-rust:1804-1.1.0 + commands: + - . /opt/sgxsdk/environment + - . /root/.cargo/env + - RUST_TARGET_PATH=`pwd` xargo build --target x86_64-unknown-linux-sgx --release + +--- + +kind: pipeline +name: rand-sgx-xargo-1804-debug + +steps: +- name: debug-compile + image: baiduxlab/sgx-rust:1804-1.1.0 + commands: + - . /opt/sgxsdk/environment + - . /root/.cargo/env + - RUST_TARGET_PATH=`pwd` xargo build --target x86_64-unknown-linux-sgx + +--- + +kind: pipeline +name: rand-sgx-1604-release + +steps: +- name: release-compile + image: baiduxlab/sgx-rust:1604-1.1.0 + commands: + - . /opt/sgxsdk/environment + - . /root/.cargo/env + - cargo build --release + +--- + +kind: pipeline +name: rand-sgx-1604-hw-debug + +steps: +- name: debug-compile + image: baiduxlab/sgx-rust:1604-1.1.0 + commands: + - . /opt/sgxsdk/environment + - . /root/.cargo/env + - cargo build + +--- + +kind: pipeline +name: rand-sgx-1804-release + +steps: +- name: release-compile + image: baiduxlab/sgx-rust:1804-1.1.0 + commands: + - . /opt/sgxsdk/environment + - . /root/.cargo/env + - cargo build --release + +--- + +kind: pipeline +name: rand-sgx-1804-debug + +steps: +- name: debug-compile + image: baiduxlab/sgx-rust:1804-1.1.0 + commands: + - . /opt/sgxsdk/environment + - . /root/.cargo/env + - cargo build diff --git a/.github/pull.yml b/.github/pull.yml new file mode 100644 index 00000000000..abbbbe4e4e6 --- /dev/null +++ b/.github/pull.yml @@ -0,0 +1,5 @@ +version: "1" +rules: + - base: master + upstream: rust-random:master + mergeMethod: none diff --git a/Cargo.toml b/Cargo.toml index ac64187cf69..c6c3d37d4a5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ Random number generators and other randomness functionality. """ keywords = ["random", "rng"] categories = ["algorithms", "no-std"] -exclude = ["/utils/*", "/.travis.yml", "/appveyor.yml", ".gitignore"] +exclude = ["/utils/*", "/.travis.yml", "/appveyor.yml", ".gitignore", "/sgx/*"] autobenches = true edition = "2018" @@ -21,20 +21,21 @@ travis-ci = { repository = "rust-random/rand" } appveyor = { repository = "rust-random/rand" } [features] +default = ["std", "mesalock_sgx"] # without "std" rand uses libcore # Meta-features: -default = ["std"] # without "std" rand uses libcore nightly = ["simd_support"] # enables all features requiring nightly rust serde1 = [] # does nothing, deprecated # Optional dependencies: -std = ["rand_core/std", "rand_chacha/std", "alloc", "getrandom", "libc"] +std = ["rand_core/std", "rand_core/mesalock_sgx", "rand_chacha/std", "rand_chacha/mesalock_sgx", "alloc", "getrandom"] alloc = ["rand_core/alloc"] # enables Vec and Box support (without std) # re-export optional WASM dependencies to avoid breakage: # Warning: wasm-bindgen and stdweb features will be removed in rand 0.8; # recommended to activate via the getrandom crate instead. -wasm-bindgen = ["getrandom_package/wasm-bindgen"] -stdweb = ["getrandom_package/stdweb"] +#wasm-bindgen = ["getrandom_package/wasm-bindgen"] +#stdweb = ["getrandom_package/stdweb"] getrandom = ["getrandom_package", "rand_core/getrandom"] +mesalock_sgx = ["sgx_tstd"] # Configuration: simd_support = ["packed_simd"] # enables SIMD support @@ -47,7 +48,7 @@ members = [ "rand_chacha", "rand_hc", "rand_pcg", - "tests/wasm_bindgen", + #"tests/wasm_bindgen", ] [dependencies] @@ -56,8 +57,9 @@ rand_pcg = { path = "rand_pcg", version = "0.2", optional = true } # Do not depend on 'getrandom_package' directly; use the 'getrandom' feature! # This is a dependency because: we forward wasm feature flags # This is renamed because: we need getrandom to depend on rand_core/getrandom -getrandom_package = { version = "0.1.1", package = "getrandom", optional = true } -log = { version = "0.4.4", optional = true } +getrandom_package = { git = "https://github.com/mesalock-linux/getrandom-sgx.git", package = "getrandom", optional = true } +log = { git = "https://github.com/mesalock-linux/log-sgx.git", optional = true } +sgx_tstd = { version = "1.0", rev = "v1.1.0", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true } [dependencies.packed_simd] # NOTE: so far no version works reliably due to dependence on unstable features @@ -68,19 +70,20 @@ features = ["into_bits"] [target.'cfg(unix)'.dependencies] # Used for fork protection (reseeding.rs) -libc = { version = "0.2.22", optional = true, default-features = false } +# SGX does not provide fork. No need for fork protection +#libc = { version = "0.2.22", optional = true, default-features = false } # Emscripten does not support 128-bit integers, which are used by ChaCha code. # We work around this by using a different RNG. [target.'cfg(not(target_os = "emscripten"))'.dependencies] rand_chacha = { path = "rand_chacha", version = "0.2.1", default-features = false } -[target.'cfg(target_os = "emscripten")'.dependencies] -rand_hc = { path = "rand_hc", version = "0.2" } +#[target.'cfg(target_os = "emscripten")'.dependencies] +#rand_hc = { path = "rand_hc", version = "0.2" } [dev-dependencies] -rand_pcg = { path = "rand_pcg", version = "0.2" } +#rand_pcg = { path = "rand_pcg", version = "0.2" } # Only for benches: -rand_hc = { path = "rand_hc", version = "0.2" } +#rand_hc = { path = "rand_hc", version = "0.2" } [package.metadata.docs.rs] all-features = true diff --git a/Xargo.toml b/Xargo.toml new file mode 100644 index 00000000000..ef14c9685c6 --- /dev/null +++ b/Xargo.toml @@ -0,0 +1,95 @@ +[dependencies] +alloc = {} + +[dependencies.sgx_types] +git = "https://github.com/apache/teaclave-sgx-sdk.git" +stage = 1 + +[dependencies.sgx_alloc] +git = "https://github.com/apache/teaclave-sgx-sdk.git" +stage = 1 + +[dependencies.sgx_unwind] +git = "https://github.com/apache/teaclave-sgx-sdk.git" +stage = 1 + +[dependencies.sgx_demangle] +git = "https://github.com/apache/teaclave-sgx-sdk.git" +stage = 1 + +[dependencies.panic_abort] +git = "https://github.com/apache/teaclave-sgx-sdk.git" +stage = 1 + +[dependencies.sgx_libc] +git = "https://github.com/apache/teaclave-sgx-sdk.git" +stage = 2 + +[dependencies.sgx_tkey_exchange] +git = "https://github.com/apache/teaclave-sgx-sdk.git" +stage = 2 + +[dependencies.sgx_tservice] +git = "https://github.com/apache/teaclave-sgx-sdk.git" +stage = 2 + +[dependencies.sgx_tse] +git = "https://github.com/apache/teaclave-sgx-sdk.git" +stage = 2 + +[dependencies.sgx_tcrypto] +git = "https://github.com/apache/teaclave-sgx-sdk.git" +stage = 2 + +[dependencies.sgx_trts] +git = "https://github.com/apache/teaclave-sgx-sdk.git" +stage = 3 + +[dependencies.sgx_backtrace_sys] +git = "https://github.com/apache/teaclave-sgx-sdk.git" +stage = 3 + +[dependencies.panic_unwind] +git = "https://github.com/apache/teaclave-sgx-sdk.git" +stage = 3 + +[dependencies.sgx_tdh] +git = "https://github.com/apache/teaclave-sgx-sdk.git" +stage = 4 + +[dependencies.sgx_tseal] +git = "https://github.com/apache/teaclave-sgx-sdk.git" +stage = 4 + +[dependencies.sgx_tprotected_fs] +git = "https://github.com/apache/teaclave-sgx-sdk.git" +stage = 4 + +[dependencies.std] +git = "https://github.com/apache/teaclave-sgx-sdk.git" +features = ["backtrace", "net"] +stage = 5 + +[dependencies.sgx_no_tstd] +git = "https://github.com/apache/teaclave-sgx-sdk.git" +stage = 5 + +[dependencies.sgx_rand] +git = "https://github.com/apache/teaclave-sgx-sdk.git" +stage = 6 + +[dependencies.sgx_serialize] +git = "https://github.com/apache/teaclave-sgx-sdk.git" +stage = 6 + +[dependencies.sgx_tunittest] +git = "https://github.com/apache/teaclave-sgx-sdk.git" +stage = 6 + +[dependencies.sgx_backtrace] +git = "https://github.com/apache/teaclave-sgx-sdk.git" +stage = 7 + +[dependencies.sgx_cov] +git = "https://github.com/apache/teaclave-sgx-sdk.git" +stage = 7 diff --git a/rand_chacha/Cargo.toml b/rand_chacha/Cargo.toml index 6a47b863417..0ec107bf73a 100644 --- a/rand_chacha/Cargo.toml +++ b/rand_chacha/Cargo.toml @@ -20,9 +20,11 @@ appveyor = { repository = "rust-random/rand" } [dependencies] rand_core = { path = "../rand_core", version = "0.5" } -c2-chacha = { version = "0.2.2", default-features = false, features = ["simd"] } +c2-chacha = { git = "https://github.com/mesalock-linux/cryptocorrosion-sgx" } +sgx_tstd = { rev = "v1.1.0", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true } [features] -default = ["std", "simd"] -std = ["c2-chacha/std"] -simd = [] # deprecated +default = ["std", "simd", "mesalock_sgx"] +std = ["c2-chacha/simd"] +simd = [] +mesalock_sgx = ["sgx_tstd"] diff --git a/rand_chacha/src/chacha.rs b/rand_chacha/src/chacha.rs index a40a7d38059..5adf5f12768 100644 --- a/rand_chacha/src/chacha.rs +++ b/rand_chacha/src/chacha.rs @@ -9,8 +9,12 @@ //! The ChaCha random number generator. #[cfg(not(feature = "std"))] use core; -#[cfg(feature = "std")] use std as core; +#[cfg(all(feature = "std", feature = "mesalock_sgx", target_env = "sgx"))] +use std as core; +#[cfg(all(feature = "mesalock_sgx", not(target_env = "sgx")))] +use core::fmt; +#[cfg(all(feature = "mesalock_sgx", target_env = "sgx"))] use self::core::fmt; use c2_chacha::guts::ChaCha; use rand_core::block::{BlockRng, BlockRngCore}; @@ -56,6 +60,7 @@ where T: Copy + Default new } } + impl fmt::Debug for Array64 { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "Array64 {{}}") diff --git a/rand_chacha/src/lib.rs b/rand_chacha/src/lib.rs index 63f7e2484b5..74a9ed066c2 100644 --- a/rand_chacha/src/lib.rs +++ b/rand_chacha/src/lib.rs @@ -18,6 +18,14 @@ #![doc(test(attr(allow(unused_variables), deny(warnings))))] #![cfg_attr(not(feature = "std"), no_std)] +#![cfg_attr(all(feature = "mesalock_sgx", + not(target_env = "sgx")), no_std)] +#![cfg_attr(all(target_env = "sgx", target_vendor = "mesalock"), feature(rustc_private))] + +#[cfg(all(feature = "mesalock_sgx", not(target_env = "sgx")))] +#[macro_use] +extern crate sgx_tstd as std; + pub use rand_core; mod chacha; diff --git a/rand_core/Cargo.toml b/rand_core/Cargo.toml index 945e3f63896..7ea35f7e9cd 100644 --- a/rand_core/Cargo.toml +++ b/rand_core/Cargo.toml @@ -19,13 +19,15 @@ travis-ci = { repository = "rust-random/rand" } appveyor = { repository = "rust-random/rand" } [features] -std = ["alloc", "getrandom", "getrandom/std"] # use std library; should be default but for above bug +std = ["alloc", "getrandom", "getrandom/std", "mesalock_sgx"] # use std library; should be default but for above bug alloc = [] # enables Vec and Box support without std serde1 = ["serde"] # enables serde for BlockRng wrapper +mesalock_sgx = ["alloc", "sgx_tstd"] [dependencies] -serde = { version = "1", features = ["derive"], optional = true } -getrandom = { version = "0.1", optional = true } +serde = { git = "https://github.com/mesalock-linux/serde-sgx.git", features = ["derive"], optional = true } +getrandom = { git = "https://github.com/mesalock-linux/getrandom-sgx", optional = true } +sgx_tstd = { rev = "v1.1.0", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true } [package.metadata.docs.rs] all-features = true diff --git a/rand_core/src/error.rs b/rand_core/src/error.rs index b48438153ce..63d6255964d 100644 --- a/rand_core/src/error.rs +++ b/rand_core/src/error.rs @@ -9,8 +9,11 @@ //! Error types use core::fmt; -use core::num::NonZeroU32; +#[cfg(all(feature="std", feature="mesalock_sgx", not(target_env="sgx")))] +use std::prelude::v1::*; + +use core::num::NonZeroU32; /// Error type of random number generators /// diff --git a/rand_core/src/lib.rs b/rand_core/src/lib.rs index 281bedde745..bdd773852ca 100644 --- a/rand_core/src/lib.rs +++ b/rand_core/src/lib.rs @@ -38,6 +38,23 @@ #![allow(clippy::unreadable_literal)] #![cfg_attr(not(feature = "std"), no_std)] +#![cfg_attr(all(feature="alloc", not(feature="std")), feature(alloc))] +#![cfg_attr(any(not(feature = "std"), + all(feature = "mesalock_sgx", not(target_env = "sgx"))), + no_std)] +#![cfg_attr(all(target_env = "sgx", target_vendor = "mesalock"), feature(rustc_private))] +#![allow(clippy::unreadable_literal)] + +#[cfg(all(feature = "mesalock_sgx", not(target_env = "sgx")))] +#[macro_use] +extern crate sgx_tstd as std; + +#[cfg(all(feature="mesalock_sgx", not(target_env="sgx")))] +use std::prelude::v1::*; + +#[cfg(any(all(feature="std", not(feature="mesalock_sgx")), + target_env = "sgx"))] +extern crate core; use core::convert::AsMut; use core::default::Default; diff --git a/rand_distr/Cargo.toml b/rand_distr/Cargo.toml index d9971562353..fd6a66ed4ca 100644 --- a/rand_distr/Cargo.toml +++ b/rand_distr/Cargo.toml @@ -18,8 +18,13 @@ edition = "2018" travis-ci = { repository = "rust-random/rand" } appveyor = { repository = "rust-random/rand" } +[features] +default = ["mesalock_sgx"] +mesalock_sgx = ["sgx_tstd"] + [dependencies] rand = { path = "..", version = "0.7" } +sgx_tstd = { version = "1.0", rev = "v1.1.0", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true } [dev-dependencies] rand_pcg = { version = "0.2", path = "../rand_pcg" } diff --git a/rand_distr/src/dirichlet.rs b/rand_distr/src/dirichlet.rs index 84c7c933915..4cf7a77e02d 100644 --- a/rand_distr/src/dirichlet.rs +++ b/rand_distr/src/dirichlet.rs @@ -9,6 +9,9 @@ //! The dirichlet distribution. +#[cfg(all(feature="mesalock_sgx", not(target_env="sgx")))] +use std::prelude::v1::*; + use crate::utils::Float; use crate::{Distribution, Exp1, Gamma, Open01, StandardNormal}; use rand::Rng; diff --git a/rand_distr/src/lib.rs b/rand_distr/src/lib.rs index 0e7beb91b5d..d96ad08f8e3 100644 --- a/rand_distr/src/lib.rs +++ b/rand_distr/src/lib.rs @@ -67,6 +67,13 @@ //! - [`UnitCircle`] distribution //! - [`UnitDisc`] distribution +#![cfg_attr(all(feature = "mesalock_sgx", not(target_env = "sgx")), no_std)] +#![cfg_attr(all(target_env = "sgx", target_vendor = "mesalock"), feature(rustc_private))] + +#[cfg(all(feature = "mesalock_sgx", not(target_env = "sgx")))] +#[macro_use] +extern crate sgx_tstd as std; + pub use rand::distributions::{ uniform, weighted, Alphanumeric, Bernoulli, BernoulliError, DistIter, Distribution, Open01, OpenClosed01, Standard, Uniform, diff --git a/rand_pcg/Cargo.toml b/rand_pcg/Cargo.toml index 7cfae7987ab..c10ec41fbb5 100644 --- a/rand_pcg/Cargo.toml +++ b/rand_pcg/Cargo.toml @@ -23,7 +23,7 @@ serde1 = ["serde"] [dependencies] rand_core = { path = "../rand_core", version = "0.5" } -serde = { version = "1", features = ["derive"], optional = true } +serde = { git="https://github.com/mesalock-linux/serde-sgx.git", features = ["derive"], optional = true } [dev-dependencies] # This is for testing serde, unfortunately we can't specify feature-gated dev diff --git a/src/distributions/dirichlet.rs b/src/distributions/dirichlet.rs index a75678a8504..33f3c60aa34 100644 --- a/src/distributions/dirichlet.rs +++ b/src/distributions/dirichlet.rs @@ -11,6 +11,8 @@ #![allow(deprecated)] #![allow(clippy::all)] +#[cfg(feature="mesalock_sgx")] use std::prelude::v1::*; + use crate::distributions::gamma::Gamma; use crate::distributions::Distribution; use crate::Rng; diff --git a/src/distributions/weighted/alias_method.rs b/src/distributions/weighted/alias_method.rs index 7d42a35267b..75e355faac5 100644 --- a/src/distributions/weighted/alias_method.rs +++ b/src/distributions/weighted/alias_method.rs @@ -1,6 +1,7 @@ //! This module contains an implementation of alias method for sampling random //! indices with probabilities proportional to a collection of weights. +#[cfg(feature="mesalock_sgx")] use std::prelude::v1::*; use super::WeightedError; #[cfg(not(feature = "std"))] use crate::alloc::vec; #[cfg(not(feature = "std"))] use crate::alloc::vec::Vec; diff --git a/src/distributions/weighted/mod.rs b/src/distributions/weighted/mod.rs index 357e3a9f024..95c34432805 100644 --- a/src/distributions/weighted/mod.rs +++ b/src/distributions/weighted/mod.rs @@ -27,6 +27,8 @@ use core::fmt; // Note that this whole module is only imported if feature="alloc" is enabled. #[cfg(not(feature = "std"))] use crate::alloc::vec::Vec; +#[cfg(feature="mesalock_sgx")] use std::prelude::v1::*; + /// A distribution using weighted sampling to pick a discretely selected /// item. /// diff --git a/src/lib.rs b/src/lib.rs index d42a79fb124..447cb18db30 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -56,7 +56,24 @@ clippy::float_cmp )] -#[cfg(all(feature = "alloc", not(feature = "std")))] extern crate alloc; +#![cfg_attr(any(not(feature="std"), + all(feature = "mesalock_sgx", not(target_env = "sgx"))), + no_std)] +#![cfg_attr(all(feature="alloc", not(feature="std")), feature(alloc))] + +#![cfg_attr(all(target_env = "sgx", target_vendor = "mesalock"), feature(rustc_private))] + +#![allow(clippy::excessive_precision, clippy::unreadable_literal, clippy::float_cmp)] + +#[cfg(all(feature = "mesalock_sgx", not(target_env = "sgx")))] +#[macro_use] +extern crate sgx_tstd as std; + +#[cfg(any(all(feature="std", not(feature="mesalock_sgx")), + target_env = "sgx"))] +extern crate core; + +#[cfg(all(feature="alloc", not(feature="std")))] extern crate alloc; #[allow(unused)] macro_rules! trace { ($($x:tt)*) => ( diff --git a/src/rngs/adapter/reseeding.rs b/src/rngs/adapter/reseeding.rs index 5460e3431f9..b9e39733839 100644 --- a/src/rngs/adapter/reseeding.rs +++ b/src/rngs/adapter/reseeding.rs @@ -279,7 +279,7 @@ where } -#[cfg(all(unix, feature = "std", not(target_os = "emscripten")))] +#[cfg(all(unix, not(target_os="emscripten"),not(feature="mesalock_sgx")))] mod fork { use core::sync::atomic::{AtomicUsize, Ordering}; use std::sync::Once; @@ -316,7 +316,7 @@ mod fork { } } -#[cfg(not(all(unix, feature = "std", not(target_os = "emscripten"))))] +#[cfg(not(all(unix, not(target_os="emscripten"), not(feature="mesalock_sgx"))))] mod fork { pub fn get_fork_counter() -> usize { 0 diff --git a/src/seq/index.rs b/src/seq/index.rs index 551d409e71c..31f8e34667b 100644 --- a/src/seq/index.rs +++ b/src/seq/index.rs @@ -13,6 +13,7 @@ #[cfg(all(feature = "alloc", not(feature = "std")))] use crate::alloc::vec::{self, Vec}; #[cfg(feature = "std")] use std::vec; +#[cfg(feature="mesalock_sgx")] use std::prelude::v1::*; // BTreeMap is not as fast in tests, but better than nothing. #[cfg(all(feature = "alloc", not(feature = "std")))] use crate::alloc::collections::BTreeSet; diff --git a/src/seq/mod.rs b/src/seq/mod.rs index dabf3292794..29d979ebfbf 100644 --- a/src/seq/mod.rs +++ b/src/seq/mod.rs @@ -30,6 +30,7 @@ #[cfg(feature = "alloc")] use core::ops::Index; #[cfg(all(feature = "alloc", not(feature = "std")))] use crate::alloc::vec::Vec; +#[cfg(feature="mesalock_sgx")] use std::prelude::v1::*; #[cfg(feature = "alloc")] use crate::distributions::uniform::{SampleBorrow, SampleUniform}; diff --git a/x86_64-unknown-linux-sgx.json b/x86_64-unknown-linux-sgx.json new file mode 100644 index 00000000000..10d37a74908 --- /dev/null +++ b/x86_64-unknown-linux-sgx.json @@ -0,0 +1,31 @@ +{ + "arch": "x86_64", + "cpu": "x86-64", + "data-layout": "e-m:e-i64:64-f80:128-n8:16:32:64-S128", + "dynamic-linking": true, + "env": "sgx", + "exe-allocation-crate": "alloc_system", + "executables": true, + "has-elf-tls": true, + "has-rpath": true, + "linker-flavor": "gcc", + "linker-is-gnu": true, + "llvm-target": "x86_64-unknown-linux-gnu", + "max-atomic-width": 64, + "os": "linux", + "position-independent-executables": true, + "pre-link-args": { + "gcc": [ + "-Wl,--as-needed", + "-Wl,-z,noexecstack", + "-m64" + ] + }, + "relro-level": "full", + "stack-probes": true, + "target-c-int-width": "32", + "target-endian": "little", + "target-family": "unix", + "target-pointer-width": "64", + "vendor": "mesalock" +}