Andy Dill e1f297214c Document the madness | %!s(int64=5) %!d(string=hai) anos | |
---|---|---|
librusty | %!s(int64=5) %!d(string=hai) anos | |
unity | %!s(int64=5) %!d(string=hai) anos | |
.gitignore | %!s(int64=5) %!d(string=hai) anos | |
README.md | %!s(int64=5) %!d(string=hai) anos |
This is a quick proof-of-concept for a bitcode-enabled library built from Rust intended for consumption in an iOS app built in Unity (2018.4.11f1)
Unity defaults to embedding bitcode meaning all static dependencies must do likewise. Rust, by default, does not embed bitcode for static library targets. We can use -C lto -Z embed-bitcode
to ask Rust to embed bitcode (afaict -C lto
is required because the shipped iOS rust-std libs also need to embed bitcode.)
Naturally both Rust and Apple have forked LLVM and they are not always in-sync which is the current major problem outlined here. For Xcode 11.1 the latest Rust version we can use is nightly-2019-07-17
.
Until Rust officially decides to support bitcode we have to jump through hoops in order to do so: