I have "Enable Bitcode" set to YES in my Build Settings.
When I archive my framework in Xcode 9.2 with the default toolchain:
and then run the command to check if bitcode is in the binary otool -arch arm64 -l MyFrameworkBinary | grep __LLVM
, it produces the following output:
segname __LLVM
segname __LLVM
If I change to the Swift 4.1 toolchain (https://swift.org/builds/swift-4.1-release/xcode/swift-4.1-RELEASE/swift-4.1-RELEASE-osx.pkg):
then run otool -arch arm64 -l MyFrameworkBinary | grep __LLVM
, it doesn't produce any output.
Why does changing the Toolchain no longer honor the "Enable Bitcode" Build Setting?
UPDATE:
I noticed the Swift 4.1 toolchain contains an Info.plist with the following override:
but the problem is if I edit the Info.plist, Xcode will no longer use that toolchain as it complains that the plist/signature has changed. I even tried running xcodebuild
from command line and specifying the Swift 4.1 toolchain, but it also just falls back to the default Xcode 9.2 toolchain.
When building with xcodebuild
and NOT editing the Info.plist, I get a few errors like the following:
ld: warning: Auto-Linking supplied
'/Library/Developer/Toolchains/swift-4.1-RELEASE.xctoolchain/usr/lib/swift/iphoneos/libswiftCore.dylib',
'/Library/Developer/Toolchains/swift-4.1-RELEASE.xctoolchain/usr/lib/swift/iphoneos/libswiftCore.dylib'
does not contain bitcode.
You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE),
obtain an updated library from the vendor,
or disable bitcode for this target.
so it appears that maybe the toolchain releases don't ship the Swift libraries with bitcode enabled which means I'm probably just S.O.L.