Commit Graph

22 Commits

Author SHA1 Message Date
Hugo Beauzée-Luyssen
642f8cd9c2 libunwind: Use libunwind when targeting UWP
libgcc's support is using forbidden functions
2019-07-25 21:30:08 +02:00
Petr Hosek
1dcee4cc63 Re-add bootstrap attribute to libunwind for llvm-libunwind feature
This was removed in 8a7dded, but since #62286 hasn't yet made it into
beta, this is breaking the build with llvm-libunwind feature enabled.

Furthemore, restrict the link attribute to Fuchsia and Linux, matching
the logic in build.rs since llvm-libunwind feature isn't yet supported
on other systems.
2019-07-07 15:45:04 -07:00
Mark Rousskov
8a7dded1a2 Switch master to 1.38 2019-07-04 11:26:57 -04:00
Petr Hosek
8d2f80bab3 Use link attributes on extern "C" blocks with llvm-libuwind
When llvm-libunwind feature is enabled, we need to use link attribute on
extern "C" blocks to make sure that symbols provided by LLVM's libunwind
that's built as part of Rust's libunwind crate are re-exported.

This addresses issue #62088.
2019-07-02 16:18:06 -07:00
Petr Hosek
d8f764bbbf Set -funwind-tables and -fno-exceptions unconditionally for LLVM's libunwind
These are required otherwise libunwind will end up with undefined
references to __gxx_personality_v0 which is provided by C++ ABI
library and that's undesirable.
2019-05-20 12:29:58 -07:00
Marcel Hellwig
cc314b066a Remove bitrig support from rust 2019-05-13 11:09:06 +02:00
Petr Hosek
86d1678403 Support using LLVM's libunwind as the unwinder implementation
This avoids the dependency on host libraries such as libgcc_s which
may be undesirable in some deployment environments where these aren't
available.
2019-04-03 11:21:40 -07:00
Mark Rousskov
2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
Marco A L Barbosa
68db72d8cd Do not assume dynamic linking for musl/mips[el] targets
All musl targets except mips[el] assume static linking by default. This
can be confusing
https://users.rust-lang.org/t/static-cross-compiled-binaries-arent-really-static/6084

When the musl/mips[el] targets was
[added](https://github.com/rust-lang/rust/pull/31298), dynamic linking
was chosen because of binary size concerns, and probably also because
libunwind
[didn't](https://users.rust-lang.org/t/static-cross-compiled-binaries-arent-really-static/6084/8)
supported mips.

Now that we have `crt-static` target-feature (the user can choose
dynamic link for musl targets), and libunwind
[6.0](https://github.com/llvm-mirror/libunwind/commits/release_60) add
support to mips, we do not need to assume dynamic linking.
2018-01-22 16:14:51 -02:00
Ed Schouten
304a7b7985 Link against -lunwind on CloudABI.
CloudABI makes use of LLVM's libunwind to do stack unwinding. It is
installed under the name libunwind.a.
2017-12-26 23:32:42 +01:00
Sébastien Marie
3ef39d3cb6 make OpenBSD to use libc++ instead of (e)stdc++ 2017-11-26 10:08:25 +01:00
Samuel Holland
c9645678e8 Update libunwind dependencies for musl
Use libgcc_s when linking dynamically. Convert the static libunwind to
static-nobundle, as libunwind.a is copied from musl_root and available
in the library search path.
2017-08-22 16:24:29 -05:00
Ian Douglas Scott
2fd4663fee
Make backtraces work on Redox, copying Unix implementation 2017-08-03 21:13:44 -07:00
Jessica Hamilton
e1afddc29c Haiku: fix initial platform support 2017-04-22 13:47:36 +12:00
Vadim Chugunov
7c2fc62a47 libgcc_eh may depend on libpthread.
Make sure we link to the static libpthread, so that compiled Rust binaries do not depend on winpthread1.dll.
2017-03-30 16:31:46 -07:00
Vadim Petrochenkov
f2187093f8 Add/remove rerun-if-changed when necessary 2017-03-04 21:38:26 +03:00
Shawn Walker-Salas
ee54be3c9a Add Solaris as recognized ostype
Add cputype recognition for Solaris

Fixes #39729
2017-02-11 20:28:44 -08:00
Alex Crichton
77c3bfa742 std: Remove cfg(cargobuild) annotations
These are all now no longer needed that we've only got rustbuild in tree.
2017-02-06 08:42:54 -08:00
Raph Levien
76bac5d33e Add Fuchsia support
Adds support for the x86_64-unknown-fuchsia target, which covers the
Fuchsia operating system.
2016-10-22 07:08:06 -07:00
Jake Goulding
cc8727e675 Report which required build-time environment variable is not set 2016-09-25 12:18:09 -04:00
Jorge Aparicio
f0ec906d18 arm-musl: statically link to libunwind 2016-07-30 15:39:13 -05:00
Alex Crichton
0ec321f7b5 rustc: Implement custom panic runtimes
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-05-09 08:22:36 -07:00