Skip to content
This repository has been archived by the owner on Oct 9, 2018. It is now read-only.

Latest commit

 

History

History
48 lines (34 loc) · 914 Bytes

Doc-building-for-ios.md

File metadata and controls

48 lines (34 loc) · 914 Bytes

Rust on iOS

You need XCode 5.

Build Rust cross-compiler:

mkdir build_ios; cd build_ios
../configure --target=armv7-apple-ios,armv7s-apple-ios,i386-apple-ios,aarch64-apple-ios,x86_64-apple-ios
make

Once compilation complete you can use it.

To target device (depending on dest architecture):

rustc --target=armv7-apple-ios foo.rs
rustc --target=armv7s-apple-ios foo.rs
rustc --target=aarch64-apple-ios foo.rs

To target simulator:

rustc --target=i386-apple-ios foo.rs
rustc --target=x86_64-apple-ios foo.rs

What you get

  • all Rust superpowers
  • exception handling
  • LLDB debugging

Known limitations

  • segmented stack is disabled that means no stack protection available

Resources

  • Sample of using Rust from Objective C + Makefile for simultaneous compiling for both device and simulator (all architectures)