@@ -77,7 +77,7 @@ mod libunwind {
77
77
78
78
use libc:: { uintptr_t, uint64_t} ;
79
79
80
- #[ cfg( not( target_os = "android " ) ) ]
80
+ #[ cfg( not( target_arch = "arm " ) ) ]
81
81
#[ repr( C ) ]
82
82
pub enum _Unwind_Action
83
83
{
@@ -88,7 +88,7 @@ mod libunwind {
88
88
_UA_END_OF_STACK = 16 ,
89
89
}
90
90
91
- #[ cfg( target_os = "android " ) ]
91
+ #[ cfg( target_arch = "arm " ) ]
92
92
#[ repr( C ) ]
93
93
pub enum _Unwind_State
94
94
{
@@ -118,10 +118,16 @@ mod libunwind {
118
118
119
119
pub type _Unwind_Word = uintptr_t ;
120
120
121
+ #[ cfg( not( target_arch = "arm" ) ) ]
122
+ pub static unwinder_private_data_size: int = 2 ;
123
+
124
+ #[ cfg( target_arch = "arm" ) ]
125
+ pub static unwinder_private_data_size: int = 20 ;
126
+
121
127
pub struct _Unwind_Exception {
122
128
exception_class : _Unwind_Exception_Class ,
123
129
exception_cleanup : _Unwind_Exception_Cleanup_Fn ,
124
- private : [ _Unwind_Word , ..20 ] ,
130
+ private : [ _Unwind_Word , ..unwinder_private_data_size ] ,
125
131
}
126
132
127
133
pub enum _Unwind_Context { }
@@ -202,7 +208,7 @@ impl Unwinder {
202
208
let exception = ~uw:: _Unwind_Exception {
203
209
exception_class : rust_exception_class ( ) ,
204
210
exception_cleanup : exception_cleanup,
205
- private : [ 0 , ..20 ] ,
211
+ private : [ 0 , ..uw :: unwinder_private_data_size ] ,
206
212
} ;
207
213
let error = uw:: _Unwind_RaiseException ( cast:: transmute ( exception) ) ;
208
214
rtabort ! ( "Could not unwind stack, error = {}" , error as int)
@@ -253,7 +259,7 @@ fn rust_exception_class() -> uw::_Unwind_Exception_Class {
253
259
// This is achieved by overriding the return value in search phase to always
254
260
// say "catch!".
255
261
256
- #[ cfg( not( target_os = "android " ) ) ]
262
+ #[ cfg( not( target_arch = "arm " ) ) ]
257
263
pub mod eabi {
258
264
use uw = super :: libunwind;
259
265
use libc:: c_int;
@@ -310,7 +316,7 @@ pub mod eabi {
310
316
311
317
// ARM EHABI uses a slightly different personality routine signature,
312
318
// but otherwise works the same.
313
- #[ cfg( target_os = "android " ) ]
319
+ #[ cfg( target_arch = "arm " ) ]
314
320
pub mod eabi {
315
321
use uw = super :: libunwind;
316
322
use libc:: c_int;
0 commit comments