Skip to content

Commit

Permalink
Auto merge of rust-lang#47571 - FenrirWolf:libunwind, r=alexcrichton
Browse files Browse the repository at this point in the history
Match libunwind's EABI selection with libpanic_unwind

Currently, the `libunwind` crate will only select the ARM EABI if it is compiling for ARM/Linux or Android targets. `libpanic_unwind`, however, will choose the ARM EABI if the target arch is ARM and the OS is not iOS. This means that if one tries to enable unwinding for a non-standard ARM target (such as implementing a custom stdlib via Xargo, for example), then the two crates can potentially disagree about which EABI is being targeted.

This PR makes `libunwind` use the [same logic](https://github.com/rust-lang/rust/blob/master/src/libpanic_unwind/gcc.rs#L139-L146) as `libpanic_unwind` when choosing the EABI.

I noticed there are a few comments about certain functions only differing on Android or ARM/Linux, but I *think* that those differences apply to the ARM EABI in general. Let me know if I'm wrong about that.
  • Loading branch information
bors committed Jan 27, 2018
2 parents bacb5c5 + 01059b9 commit 5c41fce
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/libunwind/libunwind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ extern "C" {
}

cfg_if! {
if #[cfg(not(any(all(target_os = "android", target_arch = "arm"),
all(target_os = "linux", target_arch = "arm"))))] {
if #[cfg(all(any(target_os = "ios", not(target_arch = "arm"))))] {
// Not ARM EHABI
#[repr(C)]
#[derive(Copy, Clone, PartialEq)]
Expand Down

0 comments on commit 5c41fce

Please sign in to comment.