diff options
| author | bors <bors@rust-lang.org> | 2019-10-26 19:35:59 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-10-26 19:35:59 +0000 |
| commit | fae75cd216c481de048e4951697c8f8525669c65 (patch) | |
| tree | 157e46f84638aa1fa3b0339ced417876e8ca209a /src/libstd/sys/unix | |
| parent | 46e6c533d08a2c6d22083a2756a0b569e001c3c4 (diff) | |
| parent | 805a330ab4c7f33421acacbee0545f6991b2fc70 (diff) | |
| download | rust-fae75cd216c481de048e4951697c8f8525669c65.tar.gz rust-fae75cd216c481de048e4951697c8f8525669c65.zip | |
Auto merge of #65167 - hermitcore:rusty-hermit, r=alexcrichton
Redesign the interface to the unikernel HermitCore We are developing the unikernel HermitCore, where the kernel is written in Rust and is already part of the Rust Standard Library. The interface between the standard library and the kernel based on a small C library. With this pull request, we remove completely the dependency to C and use lld as linker. Currently, the kernel will be linked to the application as static library, which is published at https://github.com/hermitcore/libhermit-rs. We don’t longer support the C interface to the kernel. Consequently, we remove this part from the Rust Standard Library.
Diffstat (limited to 'src/libstd/sys/unix')
| -rw-r--r-- | src/libstd/sys/unix/alloc.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/unix/args.rs | 1 | ||||
| -rw-r--r-- | src/libstd/sys/unix/condvar.rs | 7 | ||||
| -rw-r--r-- | src/libstd/sys/unix/env.rs | 11 | ||||
| -rw-r--r-- | src/libstd/sys/unix/fs.rs | 8 | ||||
| -rw-r--r-- | src/libstd/sys/unix/mod.rs | 1 | ||||
| -rw-r--r-- | src/libstd/sys/unix/os.rs | 3 | ||||
| -rw-r--r-- | src/libstd/sys/unix/thread.rs | 1 | ||||
| -rw-r--r-- | src/libstd/sys/unix/time.rs | 4 |
9 files changed, 8 insertions, 30 deletions
diff --git a/src/libstd/sys/unix/alloc.rs b/src/libstd/sys/unix/alloc.rs index f47dc92d2de..cf4900b4894 100644 --- a/src/libstd/sys/unix/alloc.rs +++ b/src/libstd/sys/unix/alloc.rs @@ -53,7 +53,6 @@ unsafe impl GlobalAlloc for System { } #[cfg(any(target_os = "android", - target_os = "hermit", target_os = "redox", target_os = "solaris"))] #[inline] @@ -79,7 +78,6 @@ unsafe fn aligned_malloc(layout: &Layout) -> *mut u8 { } #[cfg(not(any(target_os = "android", - target_os = "hermit", target_os = "redox", target_os = "solaris")))] #[inline] diff --git a/src/libstd/sys/unix/args.rs b/src/libstd/sys/unix/args.rs index 288e9b5c126..82ef35ea7b5 100644 --- a/src/libstd/sys/unix/args.rs +++ b/src/libstd/sys/unix/args.rs @@ -56,7 +56,6 @@ impl DoubleEndedIterator for Args { target_os = "haiku", target_os = "l4re", target_os = "fuchsia", - target_os = "hermit", target_os = "redox"))] mod imp { use crate::os::unix::prelude::*; diff --git a/src/libstd/sys/unix/condvar.rs b/src/libstd/sys/unix/condvar.rs index 0a93fbf8ea7..6be844ded19 100644 --- a/src/libstd/sys/unix/condvar.rs +++ b/src/libstd/sys/unix/condvar.rs @@ -31,7 +31,6 @@ impl Condvar { target_os = "ios", target_os = "l4re", target_os = "android", - target_os = "hermit", target_os = "redox"))] pub unsafe fn init(&mut self) {} @@ -39,7 +38,6 @@ impl Condvar { target_os = "ios", target_os = "l4re", target_os = "android", - target_os = "hermit", target_os = "redox")))] pub unsafe fn init(&mut self) { use crate::mem::MaybeUninit; @@ -78,8 +76,7 @@ impl Condvar { // from changes made to the system time. #[cfg(not(any(target_os = "macos", target_os = "ios", - target_os = "android", - target_os = "hermit")))] + target_os = "android")))] pub unsafe fn wait_timeout(&self, mutex: &Mutex, dur: Duration) -> bool { use crate::mem; @@ -109,7 +106,7 @@ impl Condvar { // This implementation is modeled after libcxx's condition_variable // https://github.com/llvm-mirror/libcxx/blob/release_35/src/condition_variable.cpp#L46 // https://github.com/llvm-mirror/libcxx/blob/release_35/include/__mutex_base#L367 - #[cfg(any(target_os = "macos", target_os = "ios", target_os = "android", target_os = "hermit"))] + #[cfg(any(target_os = "macos", target_os = "ios", target_os = "android"))] pub unsafe fn wait_timeout(&self, mutex: &Mutex, mut dur: Duration) -> bool { use crate::ptr; use crate::time::Instant; diff --git a/src/libstd/sys/unix/env.rs b/src/libstd/sys/unix/env.rs index d724eeb8b3f..984bcfa4509 100644 --- a/src/libstd/sys/unix/env.rs +++ b/src/libstd/sys/unix/env.rs @@ -152,17 +152,6 @@ pub mod os { pub const EXE_EXTENSION: &str = ""; } -#[cfg(target_os = "hermit")] -pub mod os { - pub const FAMILY: &str = "unix"; - pub const OS: &str = "hermit"; - pub const DLL_PREFIX: &str = "lib"; - pub const DLL_SUFFIX: &str = ".so"; - pub const DLL_EXTENSION: &str = "so"; - pub const EXE_SUFFIX: &str = ""; - pub const EXE_EXTENSION: &str = ""; -} - #[cfg(target_os = "redox")] pub mod os { pub const FAMILY: &str = "unix"; diff --git a/src/libstd/sys/unix/fs.rs b/src/libstd/sys/unix/fs.rs index 5e1f10c03ce..cbf751bec95 100644 --- a/src/libstd/sys/unix/fs.rs +++ b/src/libstd/sys/unix/fs.rs @@ -502,12 +502,12 @@ impl DirEntry { lstat(&self.path()) } - #[cfg(any(target_os = "solaris", target_os = "haiku", target_os = "hermit"))] + #[cfg(any(target_os = "solaris", target_os = "haiku"))] pub fn file_type(&self) -> io::Result<FileType> { lstat(&self.path()).map(|m| m.file_type()) } - #[cfg(not(any(target_os = "solaris", target_os = "haiku", target_os = "hermit")))] + #[cfg(not(any(target_os = "solaris", target_os = "haiku")))] pub fn file_type(&self) -> io::Result<FileType> { match self.entry.d_type { libc::DT_CHR => Ok(FileType { mode: libc::S_IFCHR }), @@ -530,7 +530,6 @@ impl DirEntry { target_os = "haiku", target_os = "l4re", target_os = "fuchsia", - target_os = "hermit", target_os = "redox"))] pub fn ino(&self) -> u64 { self.entry.d_ino as u64 @@ -561,8 +560,7 @@ impl DirEntry { target_os = "linux", target_os = "emscripten", target_os = "l4re", - target_os = "haiku", - target_os = "hermit"))] + target_os = "haiku"))] fn name_bytes(&self) -> &[u8] { unsafe { CStr::from_ptr(self.entry.d_name.as_ptr()).to_bytes() diff --git a/src/libstd/sys/unix/mod.rs b/src/libstd/sys/unix/mod.rs index b1f7aac8b4b..d0bed0f038e 100644 --- a/src/libstd/sys/unix/mod.rs +++ b/src/libstd/sys/unix/mod.rs @@ -16,7 +16,6 @@ use crate::io::ErrorKind; #[cfg(all(not(rustdoc), target_os = "emscripten"))] pub use crate::os::emscripten as platform; #[cfg(all(not(rustdoc), target_os = "fuchsia"))] pub use crate::os::fuchsia as platform; #[cfg(all(not(rustdoc), target_os = "l4re"))] pub use crate::os::linux as platform; -#[cfg(all(not(rustdoc), target_os = "hermit"))] pub use crate::os::hermit as platform; #[cfg(all(not(rustdoc), target_os = "redox"))] pub use crate::os::redox as platform; pub use self::rand::hashmap_random_keys; diff --git a/src/libstd/sys/unix/os.rs b/src/libstd/sys/unix/os.rs index 169bb57ef78..10cdb25999c 100644 --- a/src/libstd/sys/unix/os.rs +++ b/src/libstd/sys/unix/os.rs @@ -43,7 +43,6 @@ extern { #[cfg_attr(any(target_os = "netbsd", target_os = "openbsd", target_os = "android", - target_os = "hermit", target_os = "redox", target_env = "newlib"), link_name = "__errno")] @@ -394,7 +393,7 @@ pub fn current_exe() -> io::Result<PathBuf> { crate::fs::read_to_string("sys:exe").map(PathBuf::from) } -#[cfg(any(target_os = "fuchsia", target_os = "l4re", target_os = "hermit"))] +#[cfg(any(target_os = "fuchsia", target_os = "l4re"))] pub fn current_exe() -> io::Result<PathBuf> { use crate::io::ErrorKind; Err(io::Error::new(ErrorKind::Other, "Not yet implemented!")) diff --git a/src/libstd/sys/unix/thread.rs b/src/libstd/sys/unix/thread.rs index 988881e3596..72b0ac493da 100644 --- a/src/libstd/sys/unix/thread.rs +++ b/src/libstd/sys/unix/thread.rs @@ -140,7 +140,6 @@ impl Thread { target_os = "haiku", target_os = "l4re", target_os = "emscripten", - target_os = "hermit", target_os = "redox"))] pub fn set_name(_name: &CStr) { // Newlib, Illumos, Haiku, and Emscripten have no way to set a thread name. diff --git a/src/libstd/sys/unix/time.rs b/src/libstd/sys/unix/time.rs index fd6796ad22c..a9122defa55 100644 --- a/src/libstd/sys/unix/time.rs +++ b/src/libstd/sys/unix/time.rs @@ -371,9 +371,9 @@ mod inner { } } - #[cfg(not(any(target_os = "dragonfly", target_os = "hermit")))] + #[cfg(not(target_os = "dragonfly"))] pub type clock_t = libc::c_int; - #[cfg(any(target_os = "dragonfly", target_os = "hermit"))] + #[cfg(target_os = "dragonfly")] pub type clock_t = libc::c_ulong; fn now(clock: clock_t) -> Timespec { |
