IOS-3409 - Adds Bitcode Support Back to XCode >=8.3 #201
+24
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
JIRA: https://layerhq.atlassian.net/browse/IOS-3409
XCode changed the default behavior when you build projects using
xcodebuild
which changes the arguments that get passed to the compiler and linker in the build process, specifically the ones related to the bitcode. The behavior changed in XCode v8.3.It used to be that XCode v8.2 would implicitly compile and link with
-fembed-bitcode
for releases, whereas XCode versions greater than v8.2 compile and link everything with-fembed-bitcode-marker
(which zeroes all the bitcode symbol maps causing the binary to include an empty Bitcode section, probably because Bitcode part of the binary is relevant only to the AppStore upload process).But if you manually run the Build & Archive from the IDE, the code is then compiled and linked with the correct (
-fembed-bitcode
) argument.We needed to get the same behavior using the
xcodebuild
tool. It turns out that theBITCODE_GENERATION_MODE=bitcode
build setting does just that. It's normally set tomarker
for anything but distributable releases, which just puts and empty section (a marker) in the blob, but we need the frameworks to be distributable.