about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-03-14 15:16:31 -0700
committerbors <bors@rust-lang.org>2014-03-14 15:16:31 -0700
commit26fdfa124c065872a0b3c98e7234b05b00840f20 (patch)
treebb2f938e28c8db156563a64fccfd81ac9c4c22de /src/libstd
parent42fc32f293eb7de7139f058fa06f580a503b87b5 (diff)
parent6d7e86d099cf33821398731f750b36df564ca5d2 (diff)
auto merge of #12878 : crabtw/rust/mips, r=alexcrichton
I ignored AtomicU64 methods on MIPS target
because libgcc doesn't implement MIPS32 64-bit atomic operations.
Otherwise it would cause link failure.

By the way, the patched LLVM doesn't have MIPS split stack anymore.
Should I file an issue about that?
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/libc.rs25
-rw-r--r--src/libstd/rt/libunwind.rs3
-rw-r--r--src/libstd/sync/atomics.rs4
-rw-r--r--src/libstd/unstable/mutex.rs4
4 files changed, 23 insertions, 13 deletions
diff --git a/src/libstd/libc.rs b/src/libstd/libc.rs
index cfa4a2deb2f..0fb7a5f8503 100644
--- a/src/libstd/libc.rs
+++ b/src/libstd/libc.rs
@@ -2137,7 +2137,7 @@ pub mod consts {
             pub static MAP_SHARED : c_int = 0x0001;
             pub static MAP_PRIVATE : c_int = 0x0002;
             pub static MAP_FIXED : c_int = 0x0010;
-            pub static MAP_ANON : c_int = 0x0020;
+            pub static MAP_ANON : c_int = 0x0800;
 
             pub static MAP_FAILED : *c_void = -1 as *c_void;
 
@@ -2433,20 +2433,19 @@ pub mod consts {
             pub static O_DSYNC : c_int = 16;
             pub static O_SYNC : c_int = 16400;
 
-            pub static PROT_GROWSDOWN : c_int = 0x010000000;
-            pub static PROT_GROWSUP : c_int = 0x020000000;
+            pub static PROT_GROWSDOWN : c_int = 0x01000000;
+            pub static PROT_GROWSUP : c_int = 0x02000000;
 
             pub static MAP_TYPE : c_int = 0x000f;
-            pub static MAP_ANONONYMOUS : c_int = 0x0020;
-            pub static MAP_32BIT : c_int = 0x0040;
-            pub static MAP_GROWSDOWN : c_int = 0x0100;
-            pub static MAP_DENYWRITE : c_int = 0x0800;
-            pub static MAP_EXECUTABLE : c_int = 0x01000;
-            pub static MAP_LOCKED : c_int = 0x02000;
-            pub static MAP_NONRESERVE : c_int = 0x04000;
-            pub static MAP_POPULATE : c_int = 0x08000;
-            pub static MAP_NONBLOCK : c_int = 0x010000;
-            pub static MAP_STACK : c_int = 0x020000;
+            pub static MAP_ANONONYMOUS : c_int = 0x0800;
+            pub static MAP_GROWSDOWN : c_int = 0x01000;
+            pub static MAP_DENYWRITE : c_int = 0x02000;
+            pub static MAP_EXECUTABLE : c_int = 0x04000;
+            pub static MAP_LOCKED : c_int = 0x08000;
+            pub static MAP_NONRESERVE : c_int = 0x0400;
+            pub static MAP_POPULATE : c_int = 0x010000;
+            pub static MAP_NONBLOCK : c_int = 0x020000;
+            pub static MAP_STACK : c_int = 0x040000;
         }
         #[cfg(target_os = "linux")]
         pub mod sysconf {
diff --git a/src/libstd/rt/libunwind.rs b/src/libstd/rt/libunwind.rs
index bdb049fbb5f..8c14e6c81e9 100644
--- a/src/libstd/rt/libunwind.rs
+++ b/src/libstd/rt/libunwind.rs
@@ -65,6 +65,9 @@ pub static unwinder_private_data_size: int = 2;
 #[cfg(target_arch = "arm")]
 pub static unwinder_private_data_size: int = 20;
 
+#[cfg(target_arch = "mips")]
+pub static unwinder_private_data_size: int = 2;
+
 pub struct _Unwind_Exception {
     exception_class: _Unwind_Exception_Class,
     exception_cleanup: _Unwind_Exception_Cleanup_Fn,
diff --git a/src/libstd/sync/atomics.rs b/src/libstd/sync/atomics.rs
index b4d465c0397..b38a5aed16f 100644
--- a/src/libstd/sync/atomics.rs
+++ b/src/libstd/sync/atomics.rs
@@ -225,6 +225,10 @@ impl AtomicInt {
     }
 }
 
+// temporary workaround
+// it causes link failure on MIPS target
+// libgcc doesn't implement 64-bit atomic operations for MIPS32
+#[cfg(not(target_arch = "mips"))]
 impl AtomicU64 {
     pub fn new(v: u64) -> AtomicU64 {
         AtomicU64 { v:v, nopod: marker::NoPod }
diff --git a/src/libstd/unstable/mutex.rs b/src/libstd/unstable/mutex.rs
index 34ddee46d35..2a3c8963980 100644
--- a/src/libstd/unstable/mutex.rs
+++ b/src/libstd/unstable/mutex.rs
@@ -324,12 +324,16 @@ mod imp {
         static __SIZEOF_PTHREAD_MUTEX_T: uint = 24 - 8;
         #[cfg(target_arch = "arm")]
         static __SIZEOF_PTHREAD_MUTEX_T: uint = 24 - 8;
+        #[cfg(target_arch = "mips")]
+        static __SIZEOF_PTHREAD_MUTEX_T: uint = 24 - 8;
         #[cfg(target_arch = "x86_64")]
         static __SIZEOF_PTHREAD_COND_T: uint = 48 - 8;
         #[cfg(target_arch = "x86")]
         static __SIZEOF_PTHREAD_COND_T: uint = 48 - 8;
         #[cfg(target_arch = "arm")]
         static __SIZEOF_PTHREAD_COND_T: uint = 48 - 8;
+        #[cfg(target_arch = "mips")]
+        static __SIZEOF_PTHREAD_COND_T: uint = 48 - 8;
 
         pub struct pthread_mutex_t {
             __align: libc::c_longlong,