Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is exact connection between BITCODE_ENABLE and dylib framework?

I have seen many reference Link for find out connection between the BITCODE_ENABLE and .dylib framework, But i can not get positive result. Please anyone help me what is the exact connection between both and also mention use of BITCODE_ENABLE Clearly.

like image 599
Hitesh Surani Avatar asked Jun 21 '16 06:06

Hitesh Surani


1 Answers

I think you're confusing what Bitcode actually is. Bitcode can be used with both static frameworks and dynamic libraries.

From the Apple docs:

Bitcode is an intermediate representation of a compiled program. Apps you upload to iTunes Connect that contain bitcode will be compiled and linked on the App Store. Including bitcode will allow Apple to re-optimize your app binary in the future without the need to submit a new version of your app to the store.

Most libraries and frameworks are "fat," meaning they contain extra binaries to support all architectures. This means that an iOS framework might support armv7, armv7s, and i386 (all device architectures and the simulator).

Building a library with bitcode allows it to support App Thinning. Meaning only the binaries appropriate for the architecture the app will run on are downloaded from the App Store. Additionally as Crazyrems mentions in the comments, this will optimize the app installation and download size, as the device will only download the assets necessary for the application to run on that specific architecture/device.

I won't go into details about LLVM IR, but I would recommend reading these articles for reference:

  • Bitcode Demystified

  • Why I’m not enabling Bitcode - Thoughts on application binaries packaging and software distribution

  • Static Libraries, Frameworks, and Bitcode

like image 52
JAL Avatar answered Nov 07 '22 08:11

JAL