Skip to content

Condition EH ABI on target_arch, not target_os. #11316

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 5, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions src/libstd/rt/unwind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ mod libunwind {

use libc::{uintptr_t, uint64_t};

#[cfg(not(target_os = "android"))]
#[cfg(not(target_arch = "arm"))]
#[repr(C)]
pub enum _Unwind_Action
{
Expand All @@ -88,7 +88,7 @@ mod libunwind {
_UA_END_OF_STACK = 16,
}

#[cfg(target_os = "android")]
#[cfg(target_arch = "arm")]
#[repr(C)]
pub enum _Unwind_State
{
Expand Down Expand Up @@ -118,10 +118,16 @@ mod libunwind {

pub type _Unwind_Word = uintptr_t;

#[cfg(not(target_arch = "arm"))]
pub static unwinder_private_data_size: int = 2;

#[cfg(target_arch = "arm")]
pub static unwinder_private_data_size: int = 20;

pub struct _Unwind_Exception {
exception_class: _Unwind_Exception_Class,
exception_cleanup: _Unwind_Exception_Cleanup_Fn,
private: [_Unwind_Word, ..20],
private: [_Unwind_Word, ..unwinder_private_data_size],
}

pub enum _Unwind_Context {}
Expand Down Expand Up @@ -202,7 +208,7 @@ impl Unwinder {
let exception = ~uw::_Unwind_Exception {
exception_class: rust_exception_class(),
exception_cleanup: exception_cleanup,
private: [0, ..20],
private: [0, ..uw::unwinder_private_data_size],
};
let error = uw::_Unwind_RaiseException(cast::transmute(exception));
rtabort!("Could not unwind stack, error = {}", error as int)
Expand Down Expand Up @@ -253,7 +259,7 @@ fn rust_exception_class() -> uw::_Unwind_Exception_Class {
// This is achieved by overriding the return value in search phase to always
// say "catch!".

#[cfg(not(target_os = "android"))]
#[cfg(not(target_arch = "arm"))]
pub mod eabi {
use uw = super::libunwind;
use libc::c_int;
Expand Down Expand Up @@ -310,7 +316,7 @@ pub mod eabi {

// ARM EHABI uses a slightly different personality routine signature,
// but otherwise works the same.
#[cfg(target_os = "android")]
#[cfg(target_arch = "arm")]
pub mod eabi {
use uw = super::libunwind;
use libc::c_int;
Expand Down