diff --git a/src/rt/arch/i386/morestack.S b/src/rt/arch/i386/morestack.S index 23aa36353a19..b30a5af21525 100644 --- a/src/rt/arch/i386/morestack.S +++ b/src/rt/arch/i386/morestack.S @@ -47,17 +47,17 @@ #endif MORESTACK: -#ifdef __linux__ +#if defined(__linux__) || defined(__APPLE__) .cfi_startproc #endif pushl %ebp -#ifdef __linux__ +#if defined(__linux__) || defined(__APPLE__) .cfi_def_cfa_offset 8 .cfi_offset %ebp, -8 #endif movl %esp, %ebp -#ifdef __linux__ +#if defined(__linux__) || defined(__APPLE__) .cfi_def_cfa_register %ebp #endif @@ -69,7 +69,7 @@ MORESTACK: jz .L$bail // During unwinding we want to skip our caller. -#ifdef __linux__ +#if defined(__linux__) || defined(__APPLE__) // Don't understand this line. I think it means that // the next frame's pc is the return address of our caller. .cfi_offset 8, 8 @@ -134,7 +134,7 @@ MORESTACK: addl $16,%esp popl %ebp -#ifdef __linux__ +#if defined(__linux__) || defined(__APPLE__) .cfi_restore %ebp .cfi_def_cfa %esp, 4 #endif @@ -150,7 +150,7 @@ MORESTACK: jmpl *%edx -#ifdef __linux__ +#if defined(__linux__) || defined(__APPLE__) .cfi_endproc #endif diff --git a/src/rt/arch/x86_64/morestack.S b/src/rt/arch/x86_64/morestack.S index fafedb54418d..6686071361b9 100644 --- a/src/rt/arch/x86_64/morestack.S +++ b/src/rt/arch/x86_64/morestack.S @@ -50,30 +50,22 @@ #if defined(__linux__) || defined(__APPLE__) MORESTACK: -#if defined(__ELF__) .cfi_startproc -#endif // Set up a normal backtrace pushq %rbp -#if defined(__ELF__) .cfi_def_cfa_offset 16 .cfi_offset %rbp, -16 -#endif movq %rsp, %rbp -#if defined(__ELF__) .cfi_def_cfa_register %rbp -#endif // During unwinding we want to skip our caller since it's not // a complete frame and will make the unwinder sad -#if defined(__linux__) // Don't understand this line .cfi_offset 16, 0 // Tell the unwinding where to get the stack pointer for // our grandparent frame .cfi_offset %rsp, -24 -#endif // Save the grandparent stack pointer for the unwinder leaq 16(%rbp), %rax @@ -147,15 +139,11 @@ MORESTACK: addq $8, %rsp popq %rbp -#ifdef __linux__ .cfi_restore %rbp .cfi_def_cfa %rsp, 8 -#endif ret -#if defined(__ELF__) .cfi_endproc -#endif #else MORESTACK: diff --git a/src/test/run-fail/morestack2.rs b/src/test/run-fail/morestack2.rs index 02b1adae4816..b47108ba026d 100644 --- a/src/test/run-fail/morestack2.rs +++ b/src/test/run-fail/morestack2.rs @@ -33,7 +33,7 @@ resource and_then_get_big_again(_i: ()) { } fn main() { - rustrt::set_min_stack(256u); + rustrt::set_min_stack(1024u); std::task::spawn((), fn (&&_i: ()) { let r = and_then_get_big_again(()); getbig_call_c_and_fail(10000); diff --git a/src/test/run-fail/morestack3.rs b/src/test/run-fail/morestack3.rs index 9796017a8eb0..93faea60a52a 100644 --- a/src/test/run-fail/morestack3.rs +++ b/src/test/run-fail/morestack3.rs @@ -29,6 +29,6 @@ resource and_then_get_big_again(_i: @int) { } fn main() { - rustrt::set_min_stack(256u); - std::task::spawn(100, getbig_and_fail); + rustrt::set_min_stack(1024u); + std::task::spawn(400, getbig_and_fail); } \ No newline at end of file