about summary refs log tree commit diff
path: root/src/libstd/rt
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-11-25 23:02:29 -0800
committerbors <bors@rust-lang.org>2013-11-25 23:02:29 -0800
commitb42c4388927db75f9a38edbeafbfe13775b1773d (patch)
treeb32154d494b0063b2b78902a795fbd0e92686bbd /src/libstd/rt
parentc6a87c27214142b1eac2bf21785fe5b7e885ee5c (diff)
parent472b6182485c2ef8361d4675749efe377f4b6614 (diff)
downloadrust-b42c4388927db75f9a38edbeafbfe13775b1773d.tar.gz
rust-b42c4388927db75f9a38edbeafbfe13775b1773d.zip
auto merge of #10631 : klutzy/rust/win-fixes, r=alexcrichton
This patchset fixes some parts broken on Win64.

This also adds `--disable-pthreads` flags to llvm on mingw-w64 archs (both 32-bit and 64-bit, not mingw) due to bad performance. See #8996 for discussion.
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);