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)

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

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.


Create a new report for Bug 55256 on Developer Community or GitHub if you have new information to add and do not yet see a matching report.

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments


Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Related Links: