Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the libstd-modifications needed for the L4Re target #43972

Merged
merged 6 commits into from
Sep 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/libstd/os/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub use sys::unix_ext as unix;
#[stable(feature = "rust1", since = "1.0.0")]
pub use sys::windows_ext as windows;

#[cfg(any(dox, target_os = "linux"))]
#[cfg(any(dox, target_os = "linux", target_os = "l4re"))]
#[doc(cfg(target_os = "linux"))]
pub mod linux;

Expand Down
2 changes: 2 additions & 0 deletions src/libstd/os/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use fmt;
target_arch = "s390x")),
all(target_os = "android", any(target_arch = "aarch64",
target_arch = "arm")),
all(target_os = "l4re", target_arch = "x86_64"),
all(target_os = "fuchsia", target_arch = "aarch64")))]
#[stable(feature = "raw_os", since = "1.1.0")] pub type c_char = u8;
#[cfg(not(any(all(target_os = "linux", any(target_arch = "aarch64",
Expand All @@ -30,6 +31,7 @@ use fmt;
target_arch = "s390x")),
all(target_os = "android", any(target_arch = "aarch64",
target_arch = "arm")),
all(target_os = "l4re", target_arch = "x86_64"),
all(target_os = "fuchsia", target_arch = "aarch64"))))]
#[stable(feature = "raw_os", since = "1.1.0")] pub type c_char = i8;
#[stable(feature = "raw_os", since = "1.1.0")] pub type c_schar = i8;
Expand Down
2 changes: 2 additions & 0 deletions src/libstd/sys/redox/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ use sys_common::thread::start_thread;
use sys::{cvt, syscall};
use time::Duration;

pub const DEFAULT_MIN_STACK_SIZE: usize = 2 * 1024 * 1024;

pub struct Thread {
id: usize,
}
Expand Down
1 change: 1 addition & 0 deletions src/libstd/sys/unix/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ impl DoubleEndedIterator for Args {
target_os = "solaris",
target_os = "emscripten",
target_os = "haiku",
target_os = "l4re",
target_os = "fuchsia"))]
mod imp {
use os::unix::prelude::*;
Expand Down
10 changes: 8 additions & 2 deletions src/libstd/sys/unix/condvar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,16 @@ impl Condvar {
Condvar { inner: UnsafeCell::new(libc::PTHREAD_COND_INITIALIZER) }
}

#[cfg(any(target_os = "macos", target_os = "ios", target_os = "android"))]
#[cfg(any(target_os = "macos",
target_os = "ios",
target_os = "l4re",
target_os = "android"))]
pub unsafe fn init(&mut self) {}

#[cfg(not(any(target_os = "macos", target_os = "ios", target_os = "android")))]
#[cfg(not(any(target_os = "macos",
target_os = "ios",
target_os = "l4re",
target_os = "android")))]
pub unsafe fn init(&mut self) {
use mem;
let mut attr: libc::pthread_condattr_t = mem::uninitialized();
Expand Down
11 changes: 11 additions & 0 deletions src/libstd/sys/unix/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,14 @@ pub mod os {
pub const EXE_SUFFIX: &'static str = "";
pub const EXE_EXTENSION: &'static str = "";
}

#[cfg(target_os = "l4re")]
pub mod os {
pub const FAMILY: &'static str = "unix";
pub const OS: &'static str = "l4re";
pub const DLL_PREFIX: &'static str = "lib";
pub const DLL_SUFFIX: &'static str = ".so";
pub const DLL_EXTENSION: &'static str = "so";
pub const EXE_SUFFIX: &'static str = "";
pub const EXE_EXTENSION: &'static str = "";
}
2 changes: 2 additions & 0 deletions src/libstd/sys/unix/fd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ impl FileDesc {
target_os = "solaris",
target_os = "emscripten",
target_os = "fuchsia",
target_os = "l4re",
target_os = "haiku")))]
pub fn set_cloexec(&self) -> io::Result<()> {
unsafe {
Expand All @@ -155,6 +156,7 @@ impl FileDesc {
target_os = "solaris",
target_os = "emscripten",
target_os = "fuchsia",
target_os = "l4re",
target_os = "haiku"))]
pub fn set_cloexec(&self) -> io::Result<()> {
unsafe {
Expand Down
6 changes: 5 additions & 1 deletion src/libstd/sys/unix/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,21 @@ use sys::time::SystemTime;
use sys::{cvt, cvt_r};
use sys_common::{AsInner, FromInner};

#[cfg(any(target_os = "linux", target_os = "emscripten"))]
#[cfg(any(target_os = "linux", target_os = "emscripten", target_os = "l4re"))]
use libc::{stat64, fstat64, lstat64, off64_t, ftruncate64, lseek64, dirent64, readdir64_r, open64};
#[cfg(target_os = "android")]
use libc::{stat as stat64, fstat as fstat64, lstat as lstat64, lseek64,
dirent as dirent64, open as open64};
#[cfg(not(any(target_os = "linux",
target_os = "emscripten",
target_os = "l4re",
target_os = "android")))]
use libc::{stat as stat64, fstat as fstat64, lstat as lstat64, off_t as off64_t,
ftruncate as ftruncate64, lseek as lseek64, dirent as dirent64, open as open64};
#[cfg(not(any(target_os = "linux",
target_os = "emscripten",
target_os = "solaris",
target_os = "l4re",
target_os = "fuchsia")))]
use libc::{readdir_r as readdir64_r};

Expand Down Expand Up @@ -316,6 +318,7 @@ impl DirEntry {
target_os = "android",
target_os = "solaris",
target_os = "haiku",
target_os = "l4re",
target_os = "fuchsia"))]
pub fn ino(&self) -> u64 {
self.entry.d_ino as u64
Expand Down Expand Up @@ -346,6 +349,7 @@ impl DirEntry {
#[cfg(any(target_os = "android",
target_os = "linux",
target_os = "emscripten",
target_os = "l4re",
target_os = "haiku"))]
fn name_bytes(&self) -> &[u8] {
unsafe {
Expand Down
Loading