about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorYu Ding <dingelish@gmail.com>2018-12-31 15:45:42 -0800
committerYu Ding <dingelish@gmail.com>2018-12-31 16:32:56 -0800
commitd04f5208ba67c90e145438b459f99f2d634026ae (patch)
tree89a54526da1c347910242fe2121327e8da4830b5 /src/libstd
parent6efaef61899f6551914156f69809aa7d5854399d (diff)
downloadrust-d04f5208ba67c90e145438b459f99f2d634026ae.tar.gz
rust-d04f5208ba67c90e145438b459f99f2d634026ae.zip
Bound sgx target_env with fortanix as target_vendor
Signed-off-by: Yu Ding <dingelish@gmail.com>
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/Cargo.toml2
-rw-r--r--src/libstd/lib.rs9
-rw-r--r--src/libstd/sys/mod.rs10
-rw-r--r--src/libstd/sys_common/mod.rs2
4 files changed, 14 insertions, 9 deletions
diff --git a/src/libstd/Cargo.toml b/src/libstd/Cargo.toml
index 5214f365a64..92876f7f2d8 100644
--- a/src/libstd/Cargo.toml
+++ b/src/libstd/Cargo.toml
@@ -37,7 +37,7 @@ rustc_lsan = { path = "../librustc_lsan" }
 rustc_msan = { path = "../librustc_msan" }
 rustc_tsan = { path = "../librustc_tsan" }
 
-[target.'cfg(any(all(target_arch = "wasm32", not(target_os = "emscripten")), target_env = "sgx"))'.dependencies]
+[target.'cfg(any(all(target_arch = "wasm32", not(target_os = "emscripten")), all(target_vendor = "fortanix", target_env = "sgx")))'.dependencies]
 dlmalloc = { version = "0.1", features = ['rustc-dep-of-std'] }
 
 [target.x86_64-fortanix-unknown-sgx.dependencies]
diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs
index 6ded43dfed1..3b7e8291d38 100644
--- a/src/libstd/lib.rs
+++ b/src/libstd/lib.rs
@@ -302,9 +302,10 @@
 #![feature(non_exhaustive)]
 #![feature(alloc_layout_extra)]
 #![feature(maybe_uninit)]
-#![cfg_attr(target_env = "sgx", feature(global_asm, range_contains, slice_index_methods,
-                                        decl_macro, coerce_unsized, sgx_platform,
-                                        min_const_unsafe_fn))]
+#![cfg_attr(all(target_vendor = "fortanix", target_env = "sgx"),
+            feature(global_asm, range_contains, slice_index_methods,
+                    decl_macro, coerce_unsized, sgx_platform,
+                    min_const_unsafe_fn))]
 
 #![default_lib_allocator]
 
@@ -347,7 +348,7 @@ extern crate backtrace_sys;
 // testing gives test-std access to real-std lang items and globals. See #2912
 #[cfg(test)] extern crate std as realstd;
 
-#[cfg(target_env = "sgx")]
+#[cfg(all(target_vendor = "fortanix", target_env = "sgx"))]
 #[macro_use]
 #[allow(unused_imports)] // FIXME: without `#[macro_use]`, get error: “cannot
                          // determine resolution for the macro `usercalls_asm`”
diff --git a/src/libstd/sys/mod.rs b/src/libstd/sys/mod.rs
index de9e09bf705..f398a2a6225 100644
--- a/src/libstd/sys/mod.rs
+++ b/src/libstd/sys/mod.rs
@@ -38,7 +38,7 @@ cfg_if! {
     } else if #[cfg(target_arch = "wasm32")] {
         mod wasm;
         pub use self::wasm::*;
-    } else if #[cfg(target_env = "sgx")] {
+    } else if #[cfg(all(target_vendor = "fortanix", target_env = "sgx"))] {
         mod sgx;
         pub use self::sgx::*;
     } else {
@@ -55,7 +55,9 @@ cfg_if! {
     if #[cfg(any(unix, target_os = "redox"))] {
         // On unix we'll document what's already available
         pub use self::ext as unix_ext;
-    } else if #[cfg(any(target_os = "cloudabi", target_arch = "wasm32", target_env = "sgx"))] {
+    } else if #[cfg(any(target_os = "cloudabi",
+                        target_arch = "wasm32",
+                        all(target_vendor = "fortanix", target_env = "sgx")))] {
         // On CloudABI and wasm right now the module below doesn't compile
         // (missing things in `libc` which is empty) so just omit everything
         // with an empty module
@@ -76,7 +78,9 @@ cfg_if! {
         // On windows we'll just be documenting what's already available
         #[allow(missing_docs)]
         pub use self::ext as windows_ext;
-    } else if #[cfg(any(target_os = "cloudabi", target_arch = "wasm32", target_env = "sgx"))] {
+    } else if #[cfg(any(target_os = "cloudabi",
+                        target_arch = "wasm32",
+                        all(target_vendor = "fortanix", target_env = "sgx")))] {
         // On CloudABI and wasm right now the shim below doesn't compile, so
         // just omit it
         #[unstable(issue = "0", feature = "std_internals")]
diff --git a/src/libstd/sys_common/mod.rs b/src/libstd/sys_common/mod.rs
index ee3916b35f9..c18b603a635 100644
--- a/src/libstd/sys_common/mod.rs
+++ b/src/libstd/sys_common/mod.rs
@@ -51,7 +51,7 @@ cfg_if! {
                  target_os = "l4re",
                  target_os = "redox",
                  all(target_arch = "wasm32", not(target_os = "emscripten")),
-                 target_env = "sgx"))] {
+                 all(target_vendor = "fortanix", target_env = "sgx")))] {
         pub use sys::net;
     } else {
         pub mod net;