about summary refs log tree commit diff
path: root/src/libstd/rt
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd/rt')
-rw-r--r--src/libstd/rt/context.rs4
-rw-r--r--src/libstd/rt/crate_map.rs7
-rw-r--r--src/libstd/rt/thread.rs2
3 files changed, 9 insertions, 4 deletions
diff --git a/src/libstd/rt/context.rs b/src/libstd/rt/context.rs
index e59704a6435..8998064990a 100644
--- a/src/libstd/rt/context.rs
+++ b/src/libstd/rt/context.rs
@@ -311,8 +311,8 @@ pub unsafe fn record_stack_bounds(stack_lo: uint, stack_hi: uint) {
         //   https://github.com/mozilla/rust/issues/3445#issuecomment-26114839
         //
         // stack range is at TIB: %gs:0x08 (top) and %gs:0x10 (bottom)
-        asm!("mov $0, %gs:0x08" :: "r"(stack_lo) :: "volatile");
-        asm!("mov $0, %gs:0x10" :: "r"(stack_hi) :: "volatile");
+        asm!("mov $0, %gs:0x08" :: "r"(stack_hi) :: "volatile");
+        asm!("mov $0, %gs:0x10" :: "r"(stack_lo) :: "volatile");
     }
 }
 
diff --git a/src/libstd/rt/crate_map.rs b/src/libstd/rt/crate_map.rs
index 987b32c0846..76ccacb331f 100644
--- a/src/libstd/rt/crate_map.rs
+++ b/src/libstd/rt/crate_map.rs
@@ -56,7 +56,12 @@ pub fn get_crate_map() -> Option<&'static CrateMap<'static>> {
 
     let sym = unsafe {
         let module = dl::open_internal();
-        let sym = do "__rust_crate_map_toplevel".with_c_str |buf| {
+        let rust_crate_map_toplevel = if cfg!(target_arch = "x86") {
+            "__rust_crate_map_toplevel"
+        } else {
+            "_rust_crate_map_toplevel"
+        };
+        let sym = do rust_crate_map_toplevel.with_c_str |buf| {
             dl::symbol(module, buf)
         };
         dl::close(module);
diff --git a/src/libstd/rt/thread.rs b/src/libstd/rt/thread.rs
index e364e5a6603..a0e66d2fd4e 100644
--- a/src/libstd/rt/thread.rs
+++ b/src/libstd/rt/thread.rs
@@ -48,7 +48,7 @@ impl Thread {
                 let f: ~proc() = cast::transmute(trampoline);
                 (*f)();
             }
-            unsafe { cast::transmute(0) }
+            unsafe { cast::transmute(0 as rust_thread_return) }
         }
 
         let native = native_thread_create(thread_start, ~main);