Xcode 8.3 produces binaries 3x larger than Xcode 8.2 due to a 4x increase in bitcode

Number:rdar://31316134 Date Originated:29-Mar-2017 08:29 AM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode 8.3 (8E162)
Classification:Other Bug Reproducible:Always
The Realm Objective-C iOS framework compiled with Xcode 8.2 weighs in at 55MB with all architecture slices and bitcode included.

The same codebase compiled with Xcode 8.3 produces a binary about three times larger at 158MB, including 70MB for bitcode alone.

Steps to Reproduce:

With Xcode 8.2.1 and 8.3 installed:

1. git clone https://github.com/realm/realm-cocoa.git
2. cd realm-cocoa
3. git checkout v2.4.4
4. git submodule update --init --recursive
5. REALM_XCODE_VERSION=8.2.1 ./build.sh ios-dynamic
6. mv build/ios/Realm.framework Realm_Xcode821.framework
7. REALM_XCODE_VERSION=8.3 ./build.sh ios-dynamic
8. mv build/ios/Realm.framework Realm_Xcode83.framework

Compare Realm_Xcode821.framework with Realm_Xcode83.framework. For example:

1. size Realm_Xcode821.framework/Realm
55M Realm_Xcode821.framework/Realm
2. size Realm_Xcode83.framework/Realm
158M  Realm_Xcode83.framework/Realm


1. otool -l -arch arm64 Realm_Xcode821.framework/Realm > Realm_Xcode821_otool_arm64.txt
2. otool -l -arch arm64 Realm_Xcode83.framework/Realm > Realm_Xcode83_otool_arm64.txt
3. git diff --no-index Realm_Xcode821_otool_arm64.txt Realm_Xcode83_otool_arm64.txt

which indicates that the __LLVM (bitcode) slice grew from 15MB to 67MB.


1. otool -l Realm_Xcode821.framework/Realm > Realm_Xcode821_otool.txt
2. otool -l Realm_Xcode83.framework/Realm > Realm_Xcode83_otool.txt
3. git diff --no-index Realm_Xcode821_otool.txt Realm_Xcode83_otool.txt

Although there's not much difference in the outputs for that one.

Expected Results:
Compiling with Xcode 8.3 should produce binaries of similar size as with Xcode 8.2.

Actual Results:
Compiling with Xcode 8.3 produces binaries approximately three times as large as with Xcode 8.2.

Describe circumstances where the problem occurs or does not occur, such as software versions and/or hardware configurations.

See https://github.com/realm/realm-cocoa/issues/4785

This is a duplicate of rdar://31302382.  Can confirm that we see similar increases in PSPDFKit. Our binary framework download is huge now.


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!