Skip to content

Commit cbde43f

Browse files
committed
---
yaml --- r: 152537 b: refs/heads/try2 c: ebc6474 h: refs/heads/master i: 152535: a270127 v: v3
1 parent da70d25 commit cbde43f

File tree

5 files changed

+20
-12
lines changed

5 files changed

+20
-12
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 70a79a9e0527fab74d8c2d2b49886b41bdd878f5
8+
refs/heads/try2: ebc6474668ec60cc793af0f48143bf33d984deb4
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/librustrt/libunwind.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,14 @@ extern {}
9797
extern "C" {
9898
// iOS on armv7 uses SjLj exceptions and requires to link
9999
// agains corresponding routine (..._SjLj_...)
100-
// So here we just skip linking for iOS
101100
#[cfg(not(target_os = "ios", target_arch = "arm"))]
102101
pub fn _Unwind_RaiseException(exception: *_Unwind_Exception)
103-
-> _Unwind_Reason_Code;
102+
-> _Unwind_Reason_Code;
103+
104+
#[cfg(target_os = "ios", target_arch = "arm")]
105+
fn _Unwind_SjLj_RaiseException(e: *_Unwind_Exception)
106+
-> _Unwind_Reason_Code;
107+
104108
pub fn _Unwind_DeleteException(exception: *_Unwind_Exception);
105109
}
106110

@@ -111,9 +115,5 @@ extern "C" {
111115
#[inline(always)]
112116
pub unsafe fn _Unwind_RaiseException(exc: *_Unwind_Exception)
113117
-> _Unwind_Reason_Code {
114-
extern "C" {
115-
fn _Unwind_SjLj_RaiseException(e: *_Unwind_Exception)
116-
-> _Unwind_Reason_Code; }
117-
118118
_Unwind_SjLj_RaiseException(exc)
119119
}

branches/try2/src/librustrt/unwind.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,6 @@ pub mod eabi {
303303
use libc::c_int;
304304

305305
extern "C" {
306-
#[cfg(target_os = "ios", target_arch = "arm")]
307306
fn __gcc_personality_sj0(version: c_int,
308307
actions: uw::_Unwind_Action,
309308
exception_class: uw::_Unwind_Exception_Class,

branches/try2/src/libstd/rt/backtrace.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,11 @@ mod imp {
248248
/// _Unwind_Backtrace is even not available there. Still,
249249
/// backtraces could be extracted using a backtrace function,
250250
/// which thanks god is public
251+
///
252+
/// As mentioned in a huge comment block above, backtrace doesn't
253+
/// play well with green threads, so while it is extremely nice
254+
/// and simple to use it should be used only on iOS devices as the
255+
/// only viable option.
251256
#[cfg(target_os = "ios", target_arch = "arm")]
252257
#[inline(never)]
253258
pub fn write(w: &mut Writer) -> IoResult<()> {
@@ -267,9 +272,9 @@ mod imp {
267272

268273
try!(writeln!(w, "stack backtrace:"));
269274
// 100 lines should be enough
270-
static size: libc::c_int = 100;
271-
let mut buf: [*libc::c_void, ..size] = unsafe {mem::zeroed()};
272-
let cnt = unsafe { backtrace(buf.as_mut_ptr(), size) as uint};
275+
static SIZE: libc::c_int = 100;
276+
let mut buf: [*libc::c_void, ..SIZE] = unsafe {mem::zeroed()};
277+
let cnt = unsafe { backtrace(buf.as_mut_ptr(), SIZE) as uint};
273278

274279
// skipping the first one as it is write itself
275280
result::fold_(range(1, cnt).map(|i| {

branches/try2/src/rt/arch/arm/record_sp.S

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
// Do not compile anything here for iOS
1+
// Do not compile anything here for iOS because split stacks
2+
// are disabled at all and do not need any runtime support.
3+
//
4+
// See also comments in librustrt/stack.rs about why it was
5+
// disabled and how it could be implemented in case of need.
26
#if !defined(__APPLE__)
37
// Mark stack as non-executable
48
#if defined(__linux__) && defined(__ELF__)

0 commit comments

Comments
 (0)