Bug 55256 - Add support for automatically remove bitcode from third-party libraries when needed
Summary: Add support for automatically remove bitcode from third-party libraries when ...
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: Tools (show other bugs)
Version: master
Hardware: PC Mac OS
: --- enhancement
Target Milestone: Future Cycle (TBD)
Assignee: Bugzilla
URL:
: 55224 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-04-17 10:01 UTC by Rolf Bjarne Kvinge [MSFT]
Modified: 2017-04-25 16:16 UTC (History)
2 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments

Description Rolf Bjarne Kvinge [MSFT] 2017-04-17 10:01:14 UTC
Reference: bug #55224.

Third-party libraries can be built with bitcode, but we don't support bitcode for iOS, which means the resulting executable might end up with incomplete bitcode when everything is linked together.

The App Store detects (and rejects) such binaries, but there's a workaround (copied from bug #55224 since that bug is private):


## Workaround / fix

Add the following lines to the iOS app project .csproj file immediately before the closing `</Project>` tag:

<Target Name="BeforeCodesign">
  <Exec Command="$(_SdkDevPath)\Toolchains\XcodeDefault.xctoolchain\usr\bin\bitcode_strip -r %(_Frameworks.FullPath) -o %(_Frameworks.FullPath)" />
</Target>

(As a caution, as currently written this isn't optimized for minimizing incremental build times because it doesn't include `Inputs` and `Outputs` attributes.  One decent option might be to add a `Conditional` attribute so it only runs for the AppStore configuration to avoid adding extra time to incremental Debug builds.)

Xcode automatically calls bitcode_strip when bitcode is disabled, maybe we should look into doing something similar.

However as this is something that can be worked around, by both the app developer and the component developer, it's not a high priority.
Comment 1 Rolf Bjarne Kvinge [MSFT] 2017-04-17 10:02:13 UTC
*** Bug 55224 has been marked as a duplicate of this bug. ***
Comment 2 Rolf Bjarne Kvinge [MSFT] 2017-04-25 14:10:10 UTC
master: https://github.com/xamarin/xamarin-macios/pull/2037

Note You need to log in before you can comment on or make changes to this bug.