The rust toolchain currently does not allow you to create a dynamic library crate type (cdylib or dylib) for the target aarch64-apple-ios.
The reasoning I've seen on the Internet is that Apple doesn't allow dynamic libraries when uploading apps to the App Store
.
However, my reading of TN2425 is that dynamic libraries are allowed, as long as they are embedded in the application as a framework. The technical note describes how to create a framework from a dynamic library.
My use case is that I am building a Rust library that makes numerous calls to the Objc system libraries provided by Apple. If I create a static library, Cargo/Rust will link in all the SDK and give me a very large static library that is tied to a specific SDK release.
Is there a way I can manually create a dynamic library from the intermediate files generated from the Rust toolchain? I could then sign it and embed it in my iOS app.
otool
andsize
. The extra size is because of the Rust runtime, which I think is needed. – Thomas O'Dell