about summary refs log tree commit diff
path: root/src/libstd/sys/common/libunwind.rs
AgeCommit message (Collapse)AuthorLines
2016-05-09rustc: Implement custom panic runtimesAlex Crichton-158/+0
This commit is an implementation of [RFC 1513] which allows applications to alter the behavior of panics at compile time. A new compiler flag, `-C panic`, is added and accepts the values `unwind` or `panic`, with the default being `unwind`. This model affects how code is generated for the local crate, skipping generation of landing pads with `-C panic=abort`. [RFC 1513]: https://github.com/rust-lang/rfcs/blob/master/text/1513-less-unwinding.md Panic implementations are then provided by crates tagged with `#![panic_runtime]` and lazily required by crates with `#![needs_panic_runtime]`. The panic strategy (`-C panic` value) of the panic runtime must match the final product, and if the panic strategy is not `abort` then the entire DAG must have the same panic strategy. With the `-C panic=abort` strategy, users can expect a stable method to disable generation of landing pads, improving optimization in niche scenarios, decreasing compile time, and decreasing output binary size. With the `-C panic=unwind` strategy users can expect the existing ability to isolate failure in Rust code from the outside world. Organizationally, this commit dismantles the `sys_common::unwind` module in favor of some bits moving part of it to `libpanic_unwind` and the rest into the `panicking` module in libstd. The custom panic runtime support is pretty similar to the custom allocator support with the only major difference being how the panic runtime is injected (takes the `-C panic` flag into account).
2016-03-06rustbuild: fix cross compilation of libstd to i686-unknown-linux-muslJorge Aparicio-2/+8
- make sure we copy the third party objects (crt*.o) to the target stage directory. - apply the x86_64-musl logic also to the i686-musl target.
2016-02-06Add the asmjs-unknown-emscripten triple. Add cfgs to libs.Brian Anderson-0/+4
Backtraces, and the compilation of libbacktrace for asmjs, are disabled. This port doesn't use jemalloc so, like pnacl, it disables jemalloc *for all targets* in the configure file. It disables stack protection.
2016-02-03Auto merge of #31078 - nbaksalyar:illumos, r=alexcrichtonbors-0/+1
This pull request adds support for [Illumos](http://illumos.org/)-based operating systems: SmartOS, OpenIndiana, and others. For now it's x86-64 only, as I'm not sure if 32-bit installations are widespread. This PR is based on #28589 by @potatosalad, and also closes #21000, #25845, and #25846. Required changes in libc are already merged: https://github.com/rust-lang-nursery/libc/pull/138 Here's a snapshot required to build a stage0 compiler: https://s3-eu-west-1.amazonaws.com/nbaksalyar/rustc-sunos-snapshot.tar.gz It passes all checks from `make check`. There are some changes I'm not quite sure about, e.g. macro usage in `src/libstd/num/f64.rs` and `DirEntry` structure in `src/libstd/sys/unix/fs.rs`, so any comments on how to rewrite it better would be greatly appreciated. Also, LLVM configure script might need to be patched to build it successfully, or a pre-built libLLVM should be used. Some details can be found here: https://llvm.org/bugs/show_bug.cgi?id=25409 Thanks! r? @brson
2016-02-02Auto merge of #31312 - alexcrichton:no-le-in-powerpc64le, r=alexcrichtonbors-3/+2
Currently the `mipsel-unknown-linux-gnu` target doesn't actually set the `target_arch` value to `mipsel` but it rather uses `mips`. Alternatively the `powerpc64le` target does indeed set the `target_arch` as `powerpc64le`, causing a bit of inconsistency between theset two. As these are just the same instance of one instruction set, let's use `target_endian` to switch between them and only set the `target_arch` as one value. This should cut down on the number of `#[cfg]` annotations necessary and all around be a little more ergonomic.
2016-02-01Remove "powerpc64le" and "mipsel" target_archAlex Crichton-3/+2
Currently the `mipsel-unknown-linux-gnu` target doesn't actually set the `target_arch` value to `mipsel` but it rather uses `mips`. Alternatively the `powerpc64le` target does indeed set the `target_arch` as `powerpc64le`, causing a bit of inconsistency between theset two. As these are just the same instance of one instruction set, let's use `target_endian` to switch between them and only set the `target_arch` as one value. This should cut down on the number of `#[cfg]` annotations necessary and all around be a little more ergonomic.
2016-01-31Rename sunos to solarisNikita Baksalyar-1/+1
2016-01-31Add Illumos supportNikita Baksalyar-0/+1
2016-01-29add support for mips(el)-unknown-linux-muslJorge Aparicio-2/+3
This target covers MIPS devices that run the trunk version of OpenWRT. The x86_64-unknown-linux-musl target always links statically to C libraries. For the mips(el)-unknown-linux-musl target, we opt for dynamic linking (like most of other targets do) to keep binary size down. As for the C compiler flags used in the build system, we use the same flags used for the mips(el)-unknown-linux-gnu target.
2016-01-13Add powerpc64 and powerpc64le supportAnton Blanchard-1/+2
This adds support for big endian and little endian PowerPC64. make check runs clean apart from one big endian backtrace issue.
2015-12-21Register new snapshotsAlex Crichton-2/+0
Lots of cruft to remove!
2015-10-31Fix stage0 ICE caused by the old _Unwind_Resume override trickery.Vadim Chugunov-0/+2
2015-10-19Use `cfg_attr` for switching `link` attrs in libunwind.Vadim Chugunov-33/+17
2015-10-18Create entry points for unwind frame registry in libstd.Vadim Chugunov-0/+4
2015-10-18Implement `eh_unwind_resume` in libstd.Vadim Chugunov-0/+3
2015-09-26Add support for the rumprun unikernelSebastian Wicki-1/+9
For most parts, rumprun currently looks like NetBSD, as they share the same libc and drivers. However, being a unikernel, rumprun does not support process management, signals or virtual memory, so related functions might fail at runtime. Stack guards are disabled exactly for this reason. Code for rumprun is always cross-compiled, it uses always static linking and needs a custom linker.
2015-09-14Mark all extern functions as nounwindBjörn Steinbrink-0/+2
Unwinding across an FFI boundary is undefined behaviour, so we can mark all external function as nounwind. The obvious exception are those functions that actually perform the unwinding.
2015-09-11std: Internalize almost all of `std::rt`Alex Crichton-0/+145
This commit does some refactoring to make almost all of the `std::rt` private. Specifically, the following items are no longer part of its API: * DEFAULT_ERROR_CODE * backtrace * unwind * args * at_exit * cleanup * heap (this is just alloc::heap) * min_stack * util The module is now tagged as `#[doc(hidden)]` as the only purpose it's serve is an entry point for the `panic!` macro via the `begin_unwind` and `begin_unwind_fmt` reexports.