]> git.lizzy.rs Git - rust.git/commit
Remove morestack support
authorAlex Crichton <alex@alexcrichton.com>
Mon, 27 Jul 2015 20:41:35 +0000 (13:41 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Mon, 10 Aug 2015 23:35:44 +0000 (16:35 -0700)
commit7a3fdfbf674a08b7f6fd32c9124e52924a2f9a1c
tree5553605e8d9ac7fc23cfec8f689f6c923e78abdd
parentd03456183e85fe7bd465bbe7c8f67885a2528444
Remove morestack support

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)
74 files changed:
mk/clean.mk
mk/crates.mk
mk/main.mk
mk/platform.mk
mk/rt.mk
mk/target.mk
src/doc/trpl/lang-items.md
src/doc/trpl/no-stdlib.md
src/librustc/middle/lang_items.rs
src/librustc/middle/weak_lang_items.rs
src/librustc_back/target/apple_base.rs
src/librustc_back/target/apple_ios_base.rs
src/librustc_back/target/bitrig_base.rs
src/librustc_back/target/dragonfly_base.rs
src/librustc_back/target/freebsd_base.rs
src/librustc_back/target/i686_unknown_freebsd.rs
src/librustc_back/target/linux_base.rs
src/librustc_back/target/mod.rs
src/librustc_back/target/netbsd_base.rs
src/librustc_back/target/openbsd_base.rs
src/librustc_back/target/windows_base.rs
src/librustc_back/target/windows_msvc_base.rs
src/librustc_trans/back/link.rs
src/librustc_trans/trans/attributes.rs
src/librustc_trans/trans/base.rs
src/librustc_trans/trans/context.rs
src/librustc_trans/trans/declare.rs
src/libstd/rt/mod.rs
src/libstd/rt/unwind/mod.rs
src/libstd/sys/common/mod.rs
src/libstd/sys/common/stack.rs [deleted file]
src/libstd/sys/common/thread.rs
src/libstd/sys/unix/stack_overflow.rs
src/libstd/sys/unix/thread.rs
src/libstd/sys/windows/c.rs
src/libstd/sys/windows/stack_overflow.rs
src/libstd/sys/windows/thread.rs
src/libstd/thread/mod.rs
src/libsyntax/feature_gate.rs
src/rt/arch/aarch64/macros.S [deleted file]
src/rt/arch/aarch64/morestack.S [deleted file]
src/rt/arch/aarch64/record_sp.S [deleted file]
src/rt/arch/arm/morestack.S [deleted file]
src/rt/arch/arm/record_sp.S [deleted file]
src/rt/arch/armv7/morestack.S [deleted file]
src/rt/arch/armv7/record_sp.S [deleted file]
src/rt/arch/armv7s/morestack.S [deleted file]
src/rt/arch/armv7s/record_sp.S [deleted file]
src/rt/arch/i386/morestack.S [deleted file]
src/rt/arch/i386/record_sp.S [deleted file]
src/rt/arch/mips/morestack.S [deleted file]
src/rt/arch/mips/record_sp.S [deleted file]
src/rt/arch/mipsel/morestack.S [deleted file]
src/rt/arch/mipsel/record_sp.S [deleted file]
src/rt/arch/powerpc/morestack.S [deleted file]
src/rt/arch/powerpc/record_sp.S [deleted file]
src/rt/arch/x86_64/morestack.S [deleted file]
src/rt/arch/x86_64/record_sp.S [deleted file]
src/rt/empty.c [new file with mode: 0644]
src/rustllvm/ExecutionEngineWrapper.cpp
src/test/auxiliary/lang-item-public.rs
src/test/compile-fail/no_owned_box_lang_item.rs
src/test/compile-fail/weak-lang-item.rs
src/test/run-make/no-duplicate-libs/bar.rs
src/test/run-make/no-duplicate-libs/foo.rs
src/test/run-make/no-stack-check/Makefile [deleted file]
src/test/run-make/no-stack-check/attr.rs [deleted file]
src/test/run-make/no-stack-check/flag.rs [deleted file]
src/test/run-make/target-specs/Makefile
src/test/run-pass/out-of-stack-new-thread-no-split.rs [deleted file]
src/test/run-pass/out-of-stack-no-split.rs [deleted file]
src/test/run-pass/out-of-stack.rs
src/test/run-pass/segfault-no-out-of-stack.rs
src/test/run-pass/smallest-hello-world.rs