Merge branch 'various-rumprun-fixes' of https://github.com/gandro/libc into merge

This commit is contained in:
Alex Crichton 2016-02-29 21:11:59 -08:00
commit d8a037c325
7 changed files with 16 additions and 10 deletions

View File

@ -350,10 +350,6 @@ fn main() {
// they're implemented on rumprun yet, just let them slide for now. // they're implemented on rumprun yet, just let them slide for now.
// Some of them look like they have headers but then don't have // Some of them look like they have headers but then don't have
// corresponding actual definitions either... // corresponding actual definitions either...
"backtrace" |
"pthread_main_np" |
"pthread_set_name_np" |
"pthread_stackseg_np" |
"shm_open" | "shm_open" |
"shm_unlink" | "shm_unlink" |
"syscall" | "syscall" |

View File

@ -74,7 +74,7 @@
))] ))]
// Attributes needed when building as part of the standard library // Attributes needed when building as part of the standard library
#![cfg_attr(stdbuild, feature(no_std, core, core_slice_ext, staged_api, custom_attribute))] #![cfg_attr(stdbuild, feature(no_std, core, core_slice_ext, staged_api, custom_attribute, cfg_target_vendor))]
#![cfg_attr(stdbuild, no_std)] #![cfg_attr(stdbuild, no_std)]
#![cfg_attr(stdbuild, staged_api)] #![cfg_attr(stdbuild, staged_api)]
#![cfg_attr(stdbuild, allow(warnings))] #![cfg_attr(stdbuild, allow(warnings))]

View File

@ -23,7 +23,7 @@ macro_rules! cfg_if {
macro_rules! __cfg_if_items { macro_rules! __cfg_if_items {
(($($not:meta,)*) ; ) => {}; (($($not:meta,)*) ; ) => {};
(($($not:meta,)*) ; ( ($($m:meta),*) ($($it:item)*) ), $($rest:tt)*) => { (($($not:meta,)*) ; ( ($($m:meta),*) ($($it:item)*) ), $($rest:tt)*) => {
__cfg_if_apply! { cfg(all($($m,)* not(any($($not),*)))), $($it)* } __cfg_if_apply! { cfg(all(not(any($($not),*)), $($m,)*)), $($it)* }
__cfg_if_items! { ($($not,)* $($m,)*) ; $($rest)* } __cfg_if_items! { ($($not,)* $($m,)*) ; $($rest)* }
} }
} }

View File

@ -227,6 +227,10 @@ extern {
flags: ::c_int) -> ::c_int; flags: ::c_int) -> ::c_int;
pub fn mprotect(addr: *const ::c_void, len: ::size_t, prot: ::c_int) pub fn mprotect(addr: *const ::c_void, len: ::size_t, prot: ::c_int)
-> ::c_int; -> ::c_int;
pub fn pthread_main_np() -> ::c_int;
pub fn pthread_set_name_np(tid: ::pthread_t, name: *const ::c_char);
pub fn pthread_stackseg_np(thread: ::pthread_t,
sinfo: *mut ::stack_t) -> ::c_int;
pub fn sysctl(name: *mut ::c_int, pub fn sysctl(name: *mut ::c_int,
namelen: ::c_uint, namelen: ::c_uint,
oldp: *mut ::c_void, oldp: *mut ::c_void,

View File

@ -384,10 +384,6 @@ extern {
pub fn __errno() -> *mut ::c_int; pub fn __errno() -> *mut ::c_int;
pub fn shm_open(name: *const ::c_char, oflag: ::c_int, mode: ::mode_t) pub fn shm_open(name: *const ::c_char, oflag: ::c_int, mode: ::mode_t)
-> ::c_int; -> ::c_int;
pub fn pthread_main_np() -> ::c_int;
pub fn pthread_set_name_np(tid: ::pthread_t, name: *const ::c_char);
pub fn pthread_stackseg_np(thread: ::pthread_t,
sinfo: *mut ::stack_t) -> ::c_int;
pub fn memrchr(cx: *const ::c_void, c: ::c_int, n: ::size_t) -> *mut ::c_void; pub fn memrchr(cx: *const ::c_void, c: ::c_int, n: ::size_t) -> *mut ::c_void;
pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int; pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int;
pub fn mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int; pub fn mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int;

View File

@ -232,6 +232,10 @@ extern {
flags: ::c_int) -> ::c_int; flags: ::c_int) -> ::c_int;
pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int)
-> ::c_int; -> ::c_int;
pub fn pthread_main_np() -> ::c_int;
pub fn pthread_set_name_np(tid: ::pthread_t, name: *const ::c_char);
pub fn pthread_stackseg_np(thread: ::pthread_t,
sinfo: *mut ::stack_t) -> ::c_int;
pub fn sysctl(name: *const ::c_int, pub fn sysctl(name: *const ::c_int,
namelen: ::c_uint, namelen: ::c_uint,
oldp: *mut ::c_void, oldp: *mut ::c_void,

View File

@ -143,6 +143,12 @@ cfg_if! {
} else if #[cfg(target_os = "emscripten")] { } else if #[cfg(target_os = "emscripten")] {
#[link(name = "c")] #[link(name = "c")]
extern {} extern {}
} else if #[cfg(all(target_vendor = "rumprun", target_os = "netbsd"))] {
// Since we don't use -nodefaultlibs on Rumprun, libc is always pulled in
// automatically by the linker. We avoid passing it explicitly, as it
// causes some versions of binutils to crash with an assertion failure.
#[link(name = "m")]
extern {}
} else if #[cfg(any(target_os = "macos", } else if #[cfg(any(target_os = "macos",
target_os = "ios", target_os = "ios",
target_os = "android", target_os = "android",