about summary refs log tree commit diff
path: root/src/rt/arch/x86_64/morestack.S
AgeCommit message (Collapse)AuthorLines
2015-08-10Remove morestack supportAlex Crichton-69/+0
This commit removes all morestack support from the compiler which entails: * Segmented stacks are no longer emitted in codegen. * We no longer build or distribute libmorestack.a * The `stack_exhausted` lang item is no longer required The only current use of the segmented stack support in LLVM is to detect stack overflow. This is no longer really required, however, because we already have guard pages for all threads and registered signal handlers watching for a segfault on those pages (to print out a stack overflow message). Additionally, major platforms (aka Windows) already don't use morestack. This means that Rust is by default less likely to catch stack overflows because if a function takes up more than one page of stack space it won't hit the guard page. This is what the purpose of morestack was (to catch this case), but it's better served with stack probes which have more cross platform support and no runtime support necessary. Until LLVM supports this for all platform it looks like morestack isn't really buying us much. cc #16012 (still need stack probes) Closes #26458 (a drive-by fix to help diagnostics on stack overflow)
2015-02-11bitrig integrationDave Huseby-2/+2
2014-07-29Port Rust to DragonFlyBSDMichael Neumann-2/+2
Not included are two required patches: * LLVM: segmented stack support for DragonFly [1] * jemalloc: simple configure patches [1]: http://reviews.llvm.org/D4705
2013-10-22Fix unwinding on OS X 10.9.Mark Rowe-0/+9
OS X 10.9's linker has a bug that results in it failing to preserve DWARF unwind information when passed the -no_compact_unwind flag. This flag is passed on OS X because the unwind information for __morestack cannot be represented by the compact unwind format. We can work around this problem by using a more targeted approach to disabling compact unwind information. The OS X linker looks for a particular pattern in the DWARF unwind information and will not attempt to convert the unwind information to the compact format. The pattern in question is the return address register being saved twice to the same location. Fixes #6849.
2013-10-19Use __morestack to detect stack overflowAlex Crichton-84/+14
This commit resumes management of the stack boundaries and limits when switching between tasks. This additionally leverages the __morestack function to run code on "stack overflow". The current behavior is to abort the process, but this is probably not the best behavior in the long term (for deails, see the comment I wrote up in the stack exhaustion routine).
2013-08-26rt: Remove leading underscore on Win64klutzy-1/+1
Win64 convention does not use underscore.
2013-04-18auto merge of #5418 : luqmana/rust/stack-float, r=brsonbors-19/+3
Like I commented in #2043, I can't reproduce the weirdness from #1388 on either mac or linux (x84_64) and pushing to try gives all green. That's 128 less bytes to have to keep in the stack for every call to __morestack.
2013-03-31mark the assembly object stacks as non-executableDaniel Micay-2/+7
Closes #5643 This also removes the need to pass noexecstack to gcc, but that wasn't actually working anymore.
2013-03-17rt: don't save and restore xmm/regs in __morestack.Luqman Aden-19/+3
2012-06-28Remove FIXME questionTim Chevalier-2/+0
brson said the answer to the question is probably no... so I'm going to be bold and remove this. Closes #2685
2012-06-21Try removing code marked with "I don't think this is necessary"Tim Chevalier-6/+1
2012-03-21rt: Shave 16 bytes off the __morestack frameBrian Anderson-2/+2
2012-03-21rt: Shave a few instructions off __morestackBrian Anderson-42/+31
2012-01-01freebsd supportUser Jyyou-2/+8
2011-12-29Save and restore xmm regs across the call to UPCALL_NEW_STACK during ↵Graydon Hoare-1/+27
__morestack, close #1388.
2011-12-29Remove obsolete comments.Graydon Hoare-1/+0
2011-12-19rt: Save and restore %rax/%eax in __morestackBrian Anderson-3/+3
This doesn't matter now since we use an out pointer for return values but it's sure to show up mysteriously someday.
2011-12-19rt: Remove unused saves from __morestackBrian Anderson-4/+1
2011-12-19rt: Give upcall_new_stack the same convention as other upcallsBrian Anderson-17/+7
2011-12-19rt: Give upcall_del_stack the same convention as other upcallsBrian Anderson-4/+2
2011-12-18rt: Add lots of documentation to __morestackBrian Anderson-23/+23
2011-12-17rt: Use a DWARF CFI scheme that works on mac in __morestackBrian Anderson-11/+3
2011-12-16rt: Fix saved address of unwinding %rsp in __morestackBrian Anderson-1/+1
I haven't thought too deeply about this, but I think I was telling the unwinder to use the stack pointer for the wrong frame when unwinding. Not sure how that could have worked at all, but this results in the correct alignment for cleanups.
2011-12-12rt: Remove some duplicated code from 64-bit __morestackBrian Anderson-12/+0
2011-12-12rt: Make unwinding through __morestack work on macBrian Anderson-3/+1
Had to bump the min stack size in some of the tests from 256 bytes to 1024 bytes. Not sure why yet.
2011-12-12rt: Write CFI instructions that (might) work on mac in __morestackBrian Anderson-0/+14
The DW_CFA_val_offset_sf instruction doesn't seem to work on mac, even after implementing it in the llvm-mc assembler, so now I'm looking for a different way to communicate the stack pointer adjustment to the unwinder.
2011-12-11rt: Make unwinding through __morestack work on macBrian Anderson-12/+0
Had to bump the min stack size in some of the tests from 256 bytes to 1024 bytes. Not sure why yet.
2011-12-11rt: Write CFI instructions that (might) work on mac in __morestackBrian Anderson-4/+19
The DW_CFA_val_offset_sf instruction doesn't seem to work on mac, even after implementing it in the llvm-mc assembler, so now I'm looking for a different way to communicate the stack pointer adjustment to the unwinder.
2011-12-10build: Use llvm-mc as our assemblerBrian Anderson-2/+2
LLVM's assembler understands .cfi pseudo-ops on the mac, which we need in order to generate frames that can be DWARF-unwound
2011-12-06rt: Various tweaks to make __morestack unwinding work on linuxBrian Anderson-0/+4
When unwinding through __morestack the stack limit in the TLS is invalidated and must be reset. Instead of actually landing at __morestack we're just going to make all our Rust landing pads call upcall_reset_stack_limit, which will find the stack segment that corresponds to the current stack pointer and put the limit in the TLS. Also massively expand the stack segment red zone to make more room for the dynamic linker. Will fix in the future.
2011-12-05rt: Use an out pointer for rust_new_stackBrian Anderson-1/+5
upcall_call_shim_on_c_stack does not handle return values
2011-12-02rt: Fix __morestack prologue on x86_64 macBrian Anderson-1/+1
2011-12-01rt: Fix 64-bit linux __morestackBrian Anderson-2/+26
2011-12-01rt: Implement __morestack for 64-bit mac. Doesn't unwind yetBrian Anderson-10/+5
2011-11-30rt: Reorganize stack growth codeBrian Anderson-12/+12
2011-11-30rt: Remove redundant defs of RUST_DEL_STACKBrian Anderson-2/+0
2011-11-30rt: Remove the stack pointer field of stk_segBrian Anderson-14/+3
2011-11-29rt: Fix the name of the linux macro in x86_64/morestack.SBrian Anderson-1/+1
2011-11-29rt: Fix calculation of stack args location in x86_64/morestack.SBrian Anderson-3/+4
2011-11-28rt: Make 64-bit __morestack grow and shrink properlyBrian Anderson-6/+46
2011-11-28rt: Remove a FIXME frome x86_64/morestack.SBrian Anderson-1/+0
2011-11-28rt: Get 64-bit Linux __morestack allocating new stacksBrian Anderson-5/+10
2011-11-28rt: Set hidden visibility on __morestackBrian Anderson-0/+9
Each crate will have its own copy of this function, which should not be exported.
2011-11-28rt: Implement part of the 64-bit __morestackBrian Anderson-20/+42
2011-11-17add an extra underscoreNiko Matsakis-1/+1
2011-11-17rt: Make morestack link on x86_64. Still utterly brokenBrian Anderson-4/+10
2011-11-02hastily port so we don't fail to buildNiko Matsakis-0/+52