When building a library that is to be used in bitcode-enabled apps, does each arch in the fat binary need to be built with -fembed-bitcode
or only one of them?
One of them because the bitcode is architecture-independent and will just be duplicated?
All of them because pre-processor commands may alter the code based on architecture (e.g. NSInteger width)?
Excluding x86 slices otherwise duplicate symbol _llvm.cmdline
happens?
- rdar://21884601
By embedding bitcode (setting the flag to YES), we give Apple an opportunity to rebuild our application on their side and optimize it further, without being required to upload a new build. It can happen, if some bugs in the compiler are fixed, or a new device type with a new architecture type is introduced.
Including Bitcode is optional for iOS apps, but mandatory for watchOS or tvOS apps.
Bitcode is an Apple technology that enables you to recompile your app to reduce its size. The recompilation happens when you upload your app to App Store Connect or export it for Ad Hoc, Development, or Enterprise distribution. To learn more about bitcode, see Distribution Options.
Bitcode is just another form of LLVM IR, which is architecture-dependent.
Which means that each slice in your fat binary should contain it's own bitcode section.
UPD. I wrote a blog-post about Bitcode, you may find there some useful details: Bitcode Demystified
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