I've rebuild some static library for arm64 arch that is required for my iOS app with bitcode support (-fembed-bitcode flag) from command-line. Previously without bitcode support generated .a file was about 88 Mb, now it's about 230 Mb. I know building with bitcode support adds __bitcode section to .o files, but why is it 3 times larger? Do i need to build for armv7and create fat library with both arm64 and armv7 or i may use new one with bitcode only?
Previously:
MBA-Anton:lib asmirnov$ lipo -info ./libclang-llvm-3.7-arm64-release.a
input file ./libclang-llvm-3.7-arm64-release.a is not a fat file
Non-fat file: ./libclang-llvm-3.7-arm64-release.a is architecture: arm64
MBA-Anton:lib asmirnov$ ls -l ./libclang-llvm-3.7-arm64-release.a
-rwxrwxrwx 1 asmirnov staff 88123960 27 окт 13:06 ./libclang-llvm-3.7-arm64-release.a
Now:
MBA-Anton:lib asmirnov$ lipo -info ./libclang_llvm_3.7_arm64_release_bitcode.a
input file ./libclang_llvm_3.7_arm64_release_bitcode.a is not a fat file
Non-fat file: ./libclang_llvm_3.7_arm64_release_bitcode.a is architecture: arm64
MBA-Anton:lib asmirnov$ ls -l ./libclang_llvm_3.7_arm64_release_bitcode.a
-rwxrwxrwx 1 asmirnov staff 230715536 2 ноя 11:27 ./libclang_llvm_3.7_arm64_release_bitcode.a
With bitcode enabled, it is expected that the size of the swift dylibs, and your own code will be significantly larger in the .xcarchive (can go as much as 3 fold).
However, this additional size will not be reflected in what actually gets delivered to your users, so it should not be a problem.
When you submit your app to app store with this static library included in, the store will process it to strip out the bitcode and that processed version of the IPA is what your users will download.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With