Skip to content

Commit 04ac2b0

Browse files
committed
auto merge of #15403 : vhbit/rust/ios-llvm-fixme, r=pcwalton
It was required to get iOS compilable but since that time a couple of changes were introduced which cause the same bug to re-appear and broke build anyway. Fixing all of them doesn’t look a viable alternative to me as it will pollute the code too much. So it should be fixed from LLVM side and I hope LLVM will upstream corresponding changes in a month. Meanwhile, who wants to play with Rust on iOS is better to use a fork which uses patched LLVM: https://github.com/vhbit/rust/tree/ios . It may lag behind master a bit, but it is Travis-checked to compile successfully.
2 parents c0b76ab + b86440f commit 04ac2b0

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

src/libnative/io/timer_unix.rs

+2-15
Original file line numberDiff line numberDiff line change
@@ -93,20 +93,7 @@ pub fn now() -> u64 {
9393
}
9494
}
9595

96-
97-
// Note: although the last parameter isn't used there is no way now to
98-
// convert it to unit type, because LLVM dies in SjLj preparation
99-
// step (unfortunately iOS uses SjLJ exceptions)
100-
//
101-
// It's definitely a temporary workaround just to get it working.
102-
// So far it looks like an LLVM issue and it was reported:
103-
// http://llvm.org/bugs/show_bug.cgi?id=19855
104-
// Actually this issue is pretty common while compiling for armv7 iOS
105-
// and in most cases it is simply solved by using --opt-level=2 (or -O)
106-
//
107-
// For this specific case unfortunately turning optimizations wasn't
108-
// enough.
109-
fn helper(input: libc::c_int, messages: Receiver<Req>, _: int) {
96+
fn helper(input: libc::c_int, messages: Receiver<Req>, _: ()) {
11097
let mut set: c::fd_set = unsafe { mem::zeroed() };
11198

11299
let mut fd = FileDesc::new(input, true);
@@ -218,7 +205,7 @@ impl Timer {
218205
pub fn new() -> IoResult<Timer> {
219206
// See notes above regarding using int return value
220207
// instead of ()
221-
unsafe { HELPER.boot(|| {0}, helper); }
208+
unsafe { HELPER.boot(|| {}, helper); }
222209

223210
static mut ID: atomics::AtomicUint = atomics::INIT_ATOMIC_UINT;
224211
let id = unsafe { ID.fetch_add(1, atomics::Relaxed) };

0 commit comments

Comments
 (0)