diff options
| author | bors <bors@rust-lang.org> | 2013-05-10 04:07:50 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-05-10 04:07:50 -0700 |
| commit | fdf601eaf3f6fcc727819f8c0ae2b44b30770a8a (patch) | |
| tree | 7e57b220a06ddc9f50a9683db5805dfb2f24b807 /src/libcore | |
| parent | 6da2c989ba88dc4e6b49ddd086699404bf93916f (diff) | |
| parent | c2bf9bf9fed8de0c399125feba8252ad263a71fc (diff) | |
| download | rust-fdf601eaf3f6fcc727819f8c0ae2b44b30770a8a.tar.gz rust-fdf601eaf3f6fcc727819f8c0ae2b44b30770a8a.zip | |
auto merge of #6358 : crabtw/rust/mips-segstk, r=brson
I changed ```RED_ZONE_SIZE``` to ```RZ_MAC_32``` because of stack canary failure.
Here is a LLVM patch for MIPS segmented stacks.
http://people.cs.nctu.edu.tw/~jyyou/rust/mips-segstk.patch
Current test results
```
failures:
rand::tests::test_rng_seeded_custom_seed2
run::tests::test_forced_destroy_actually_kills
run::tests::test_unforced_destroy_actually_kills
time::tests::run_tests
uv_ll::test::test_uv_ll_struct_size_addrinfo
uv_ll::test::test_uv_ll_struct_size_uv_timer_t
segfaults:
rt::io::option::test::test_option_writer_error
rt::local_services::test::unwind
rt::sched::test_swap_tasks_then
stackwalk::test_simple
stackwalk::test_simple_deep
```
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/libc.rs | 86 | ||||
| -rw-r--r-- | src/libcore/path.rs | 31 |
2 files changed, 115 insertions, 2 deletions
diff --git a/src/libcore/libc.rs b/src/libcore/libc.rs index 6fb4572913d..7ae3f0fd2d4 100644 --- a/src/libcore/libc.rs +++ b/src/libcore/libc.rs @@ -268,7 +268,7 @@ pub mod types { pub type ssize_t = i32; } pub mod posix01 { - use libc::types::os::arch::c95::{c_short, c_long, time_t}; + use libc::types::os::arch::c95::{c_short, c_long, c_ulong, time_t}; use libc::types::os::arch::posix88::{dev_t, gid_t, ino_t}; use libc::types::os::arch::posix88::{mode_t, off_t}; use libc::types::os::arch::posix88::{uid_t}; @@ -276,6 +276,9 @@ pub mod types { pub type nlink_t = u32; pub type blksize_t = i32; pub type blkcnt_t = i32; + + #[cfg(target_arch = "x86")] + #[cfg(target_arch = "arm")] pub struct stat { st_dev: dev_t, __pad1: c_short, @@ -298,6 +301,30 @@ pub mod types { __unused4: c_long, __unused5: c_long, } + + #[cfg(target_arch = "mips")] + pub struct stat { + st_dev: c_ulong, + st_pad1: [c_long, ..3], + st_ino: ino_t, + st_mode: mode_t, + st_nlink: nlink_t, + st_uid: uid_t, + st_gid: gid_t, + st_rdev: c_ulong, + st_pad2: [c_long, ..2], + st_size: off_t, + st_pad3: c_long, + st_atime: time_t, + st_atime_nsec: c_long, + st_mtime: time_t, + st_mtime_nsec: c_long, + st_ctime: time_t, + st_ctime_nsec: c_long, + st_blksize: blksize_t, + st_blocks: blkcnt_t, + st_pad5: [c_long, ..14], + } } pub mod posix08 {} pub mod bsd44 {} @@ -963,6 +990,9 @@ pub mod consts { } pub mod c99 { } + #[cfg(target_arch = "x86")] + #[cfg(target_arch = "x86_64")] + #[cfg(target_arch = "arm")] pub mod posix88 { pub static O_RDONLY : int = 0; pub static O_WRONLY : int = 1; @@ -1007,6 +1037,51 @@ pub mod consts { pub static SIGALRM : int = 14; pub static SIGTERM : int = 15; } + #[cfg(target_arch = "mips")] + pub mod posix88 { + pub static O_RDONLY : int = 0; + pub static O_WRONLY : int = 1; + pub static O_RDWR : int = 2; + pub static O_APPEND : int = 8; + pub static O_CREAT : int = 256; + pub static O_EXCL : int = 1024; + pub static O_TRUNC : int = 512; + pub static S_IFIFO : int = 4096; + pub static S_IFCHR : int = 8192; + pub static S_IFBLK : int = 24576; + pub static S_IFDIR : int = 16384; + pub static S_IFREG : int = 32768; + pub static S_IFMT : int = 61440; + pub static S_IEXEC : int = 64; + pub static S_IWRITE : int = 128; + pub static S_IREAD : int = 256; + pub static S_IRWXU : int = 448; + pub static S_IXUSR : int = 64; + pub static S_IWUSR : int = 128; + pub static S_IRUSR : int = 256; + pub static F_OK : int = 0; + pub static R_OK : int = 4; + pub static W_OK : int = 2; + pub static X_OK : int = 1; + pub static STDIN_FILENO : int = 0; + pub static STDOUT_FILENO : int = 1; + pub static STDERR_FILENO : int = 2; + pub static F_LOCK : int = 1; + pub static F_TEST : int = 3; + pub static F_TLOCK : int = 2; + pub static F_ULOCK : int = 0; + pub static SIGHUP : int = 1; + pub static SIGINT : int = 2; + pub static SIGQUIT : int = 3; + pub static SIGILL : int = 4; + pub static SIGABRT : int = 6; + pub static SIGFPE : int = 8; + pub static SIGKILL : int = 9; + pub static SIGSEGV : int = 11; + pub static SIGPIPE : int = 13; + pub static SIGALRM : int = 14; + pub static SIGTERM : int = 15; + } pub mod posix01 { pub static SIGTRAP : int = 5; @@ -1026,11 +1101,20 @@ pub mod consts { } pub mod bsd44 { } + #[cfg(target_arch = "x86")] + #[cfg(target_arch = "x86_64")] + #[cfg(target_arch = "arm")] pub mod extra { pub static O_RSYNC : int = 1052672; pub static O_DSYNC : int = 4096; pub static O_SYNC : int = 1052672; } + #[cfg(target_arch = "mips")] + pub mod extra { + pub static O_RSYNC : int = 16400; + pub static O_DSYNC : int = 16; + pub static O_SYNC : int = 16400; + } } #[cfg(target_os = "freebsd")] diff --git a/src/libcore/path.rs b/src/libcore/path.rs index a87fd90f4e2..d3010aff3e8 100644 --- a/src/libcore/path.rs +++ b/src/libcore/path.rs @@ -122,7 +122,6 @@ pub trait GenericPath { mod stat { #[cfg(target_arch = "x86")] #[cfg(target_arch = "arm")] - #[cfg(target_arch = "mips")] pub mod arch { use libc; @@ -152,6 +151,36 @@ mod stat { } } + #[cfg(target_arch = "mips")] + pub mod arch { + use libc; + + pub fn default_stat() -> libc::stat { + libc::stat { + st_dev: 0, + st_pad1: [0, ..3], + st_ino: 0, + st_mode: 0, + st_nlink: 0, + st_uid: 0, + st_gid: 0, + st_rdev: 0, + st_pad2: [0, ..2], + st_size: 0, + st_pad3: 0, + st_atime: 0, + st_atime_nsec: 0, + st_mtime: 0, + st_mtime_nsec: 0, + st_ctime: 0, + st_ctime_nsec: 0, + st_blksize: 0, + st_blocks: 0, + st_pad5: [0, ..14], + } + } + } + #[cfg(target_arch = "x86_64")] pub mod arch { use libc; |
