about summary refs log tree commit diff
path: root/src/rt
diff options
context:
space:
mode:
Diffstat (limited to 'src/rt')
-rw-r--r--src/rt/arch/x86_64/morestack.S15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/rt/arch/x86_64/morestack.S b/src/rt/arch/x86_64/morestack.S
index 1113194affc..6cac7289fd8 100644
--- a/src/rt/arch/x86_64/morestack.S
+++ b/src/rt/arch/x86_64/morestack.S
@@ -48,6 +48,7 @@
 	.type MORESTACK,@function
 #endif
 
+#if defined(__linux)
 MORESTACK:
 	.cfi_startproc
 
@@ -71,14 +72,14 @@ MORESTACK:
 	addq $16, %rcx   // Add the saved %rbp, and return address
 	addq %r11, %rcx // Add the size of stack arguments
 
-	pushq %r10 // The amount of stack needed
-	pushq %rcx // Address of stack arguments
-	pushq %r11 // Size of stack arguments
 	pushq %rbp // Save the Rust stack pointer
+	pushq %r11 // Size of stack arguments
+	pushq %rcx // Address of stack arguments
+	pushq %r10 // The amount of stack needed
 
 	// FIXME: Don't understand why I have to use the PLT here
 	lea RUST_NEW_STACK2@PLT(%rip), %rsi
-	lea 24(%rsp), %rdi
+	mov %rsp, %rdi
 	call UPCALL_CALL_C@PLT
 	
         mov (%rsp),%rdx        // Grab the return pointer.
@@ -86,4 +87,8 @@ MORESTACK:
         mov %rax,%rsp          // Switch to the new stack.
         call *%rdx             // Enter the new function.
 
-	.cfi_endproc
\ No newline at end of file
+	.cfi_endproc
+#else
+MORESTACK:
+	ret
+#endif
\ No newline at end of file