3

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
4ntoine
  • 19,816
  • 21
  • 96
  • 220

1 Answers1

1

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.

Abhinav
  • 37,684
  • 43
  • 191
  • 309
  • i'm not sure i understand why it's 3 times larger. 230 Mb is pretty close to fat lib which contains of arm64 + armv7 + armv8. so will this lib with bitcode support work for armv7 devices? is "bitcode support" equal to fat lib ? – 4ntoine Nov 04 '15 at 10:58