about summary refs log tree commit diff
path: root/src/rt/arch
AgeCommit message (Collapse)AuthorLines
2015-08-10Remove morestack supportAlex Crichton-842/+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-07-13Fix section of __morestack for aarch64-unknown-linux-gnuAkos Kiss-1/+5
When building for AArch64/Linux, __morestack ends up in the .note.GNU-stack section, which causes missing references for the linker. By using the func/endfunc macros from macros.S we get __morestack right to .text (and a bit more on the side).
2015-06-15src/rt/arch/i386/morestack.S: call rust_stack_exhausted via pltSteven Walter-3/+2
This prevents a relocation in the text section. Text relocations are incompatible with hardened kernels. https://github.com/rust-lang/rust/issues/5714
2015-02-11bitrig integrationDave Huseby-2/+2
2015-01-15auto merge of #20980 : richo/rust/final-power, r=alexcrichtonbors-0/+22
Originally, this was going to be discussed and revisted, however I've been working on this for months, and a rebase on top of master was about 1 flight's worth of work so I just went ahead and did it. This gets you as far as being able to target powerpc with, eg: LD_LIBRARY_PATH=./x86_64-unknown-linux-gnu/stage2/lib/ x86_64-unknown-linux-gnu/stage2/bin/rustc -C linker=powerpc-linux-gnu-gcc --target powerpc-unknown-linux-gnu hello.rs Would really love to get this out before 1.0. r? @alexcrichton
2015-01-11powerpc: Fix extraneous include in rt supportRicho Healey-2/+0
2015-01-11powerpc: rough platform supportRicho Healey-0/+24
2015-01-11Fix: GNU AArch64 assembler does not like @plt symbol suffixAkos Kiss-2/+2
2015-01-09iOS: preliminary 64-bit archs supportValerii Hiora-5/+21
2015-01-09iOS: makefiles and runtime for new archsValerii Hiora-0/+252
2015-01-03Initial version of AArch64 support.Akos Kiss-0/+36
Adds AArch64 knowledge to: * configure, * make files, * sources, * tests, and * documentation.
2014-12-22Removed unused context-switching assembly code.Maya Nitu-567/+0
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
2014-06-24Added Mipsel architecture supportPawel Olzacki-0/+171
2014-06-13Cosmetic fixes & commentsValerii Hiora-1/+5
2014-06-12Runtime support for arm on iOSValerii Hiora-34/+74
2014-03-14fix MIPS targetJyun-Yan You-25/+8
I ignored AtomicU64 methods on MIPS target because libgcc doesn't implement MIPS32 64-bit atomic operations. Otherwise it would cause link failure.
2014-02-13Remove two allocations from spawning a green taskAlex Crichton-0/+41
Two unfortunate allocations were wrapping a proc() in a proc() with GreenTask::build_start_wrapper, and then boxing this proc in a ~proc() inside of Context::new(). Both of these allocations were a direct result from two conditions: 1. The Context::new() function has a nice api of taking a procedure argument to start up a new context with. This inherently required an allocation by build_start_wrapper because extra code needed to be run around the edges of a user-provided proc() for a new task. 2. The initial bootstrap code only understood how to pass one argument to the next function. By modifying the assembly and entry points to understand more than one argument, more information is passed through in registers instead of allocating a pointer-sized context. This is sadly where I end up throwing mips under a bus because I have no idea what's going on in the mips context switching code and don't know how to modify it. Closes #7767 cc #11389
2013-11-18rt: Namespace all C functions under rust_Brian Anderson-10/+10
2013-11-06Fixes for compilation to iOS:kud1ing-2/+8
- remove /usr/include from the include path since the iOS SDK provides the correct version - `_NSGetEnviron()` is private and not available on iOS - `.align` without an argument is not allowed with the Apple tools. 2^2 should be the default alignment - ignore error messages for XCode < 5 - pass include path to libuv
2013-10-22Fix unwinding on OS X 10.9.Mark Rowe-3/+21
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-1407/+56
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-26Support Win64 context switchingklutzy-9/+75
This patch saves and restores win64's nonvolatile registers. This patch also saves stack information of thread environment block (TEB), which is at %gs:0x08 and %gs:0x10.
2013-08-26rt: Add {get,record}_sp_limit on Win64klutzy-0/+8
Uses ArbitraryUserPointer area at gs:0x28.
2013-08-26rt: Remove leading underscore on Win64klutzy-3/+6
Win64 convention does not use underscore.
2013-08-22Emit unwind info in rustrt assembly files on Windows.Vadim Chugunov-10/+10
2013-08-04Add support for vanilla linux on arm.Luqman Aden-0/+14
2013-06-16Partial fix for #7158: Save EDX in morestack on x86-32Niko Matsakis-0/+2
2013-06-06Deduplicate words in code commentsAlexei Sholik-4/+4
2013-05-22fix arm stack alignmentJyun-Yan You-2/+4
2013-05-21fix mips stack alignmentJyun-Yan You-2/+4
2013-05-17auto merge of #6249 : crabtw/rust/arm, r=brsonbors-0/+8
It uses the private field of TCB head to store stack limit. I tested on my Raspberry PI. A simple hello world program ran without any problem. However, for a more complex program, it segfaulted as #6231.
2013-05-09improve MIPS backend and implement segmented stacksJyun-Yan You-5/+101
2013-05-07preliminary Linux ARM supportJyun-Yan You-0/+8
2013-05-03add gitattributes and fix whitespace issuesDaniel Micay-21/+3
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-04-10add unwind information on morestackILyoan-14/+19
2013-04-10rust morestack assembly for armILyoan-42/+60
Conflicts: src/rt/arch/arm/morestack.S
2013-04-04rt: improve mips backendJyun-Yan You-11/+22
2013-04-01rt/arch/arm: fix syntax used for noexec stackDaniel Micay-4/+4
2013-03-31mark the assembly object stacks as non-executableDaniel Micay-19/+91
Closes #5643 This also removes the need to pass noexecstack to gcc, but that wasn't actually working anymore.
2013-03-25auto merge of #5424 : luqmana/rust/inline-rt, r=brsonbors-112/+200
As per #2521. Inlining seems to improve performance slightly: Inlined Not Inlined x86: 13.5482 14.4112 x86_64: 17.4712 18.0696 (Average of 5 runs timed with `time`) ```Rust fn foo() -> int { int::from_str(~"28098").unwrap() } fn main() { for 1000000.times { foo(); foo(); foo(); foo(); foo(); } } ``` All run on: Linux 3.2.0-0.bpo.4-amd64 #1 SMP Debian 3.2.35-2~bpo60+1 x86_64 GNU/Linux The MIPS and ARM bits I didn't inline since I'm not as familiar with them and I also can't test them. All green on try.
2013-03-19Rewrite arm/ccall.sILyoan-15/+10
2013-03-18rt: Inline get_sp_limit/set_sp_limit/get_sp for x86.Luqman Aden-63/+45
2013-03-17rt: Inline get_sp_limit/set_sp_limit/get_sp for x86_64.Luqman Aden-52/+158
2013-03-17rt: don't save and restore xmm/regs in __morestack.Luqman Aden-19/+3
2013-03-11core: Add rt mod and add the new scheduler codeBrian Anderson-8/+18
2013-03-06Merge remote-tracking branch 'brson/cross7'Brian Anderson-0/+8
Conflicts: configure mk/rt.mk
2013-03-03rt: fix some bugs for MIPS targetJyun-Yan You-2/+23
2013-03-03rt: MIPS32 supportJyun-Yan You-0/+316