# iOS+Rust integration

**URL:** <https://users.rust-lang.org/t/ios-rust-integration/6928>\
**Category:** tutorials\
**Created:** [August 18, 2016, 12:18am UTC](https://users.rust-lang.org/t/ios-rust-integration/6928 "2016-08-18T00:18:39Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![brson](https://sea1.discourse-cdn.com/flex019/user_avatar/users.rust-lang.org/brson/32/10193_2.png) [@brson](https://users.rust-lang.org/u/brson)\
**Post date:** [August 24, 2016, 12:10am UTC](https://users.rust-lang.org/t/ios-rust-integration/6928/4 "2016-08-24T00:10:58Z")

</div>

I'd love to make progress on the bitcode problem. It's pretty crucial for our cross-platform story. But it's also a nightmare.

It's probably impossible for Rust to get its LLVM fork onto the same merge-base as Apple's clang's - it's just not practical for us to be shackled to their whims.

I see a few paths to emitting Apple's bitcode from rustc:

- We ship an entirely separate toolchain for targetting Apple bitcode. This is quite ugly.
- We change rustc to dynamically load LLVM, create a rust-llvm package and an optional rust-llvm-apple package, and have rustc load the apple LLVM to deal with their bitcode.
- We create a rustc\_llvm\_apple crate and just link two entire LLVMs into rustc at all times. This probably would not fly
- We create a build of rustc called rustc-apple and ship it in an optional rustc-apple package. It is exactly like rustc except instead of linking to rustc\_llvm it links to rustc\_llvm\_apple. When rustc gets a request to emit bitcode _it just defers completely to the rustc-apple binary_. I actually fancy this solution quite a bit.

---

_[View the full topic](https://users.rust-lang.org/t/ios-rust-integration/6928)._
