After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 770875 - Add support for bitcode embedding on iOS/tvOS
Add support for bitcode embedding on iOS/tvOS
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: cerbero
git master
Other Linux
: Normal normal
: 1.15.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks: 770876
 
 
Reported: 2016-09-05 09:31 UTC by Sebastian Dröge (slomo)
Modified: 2018-05-06 09:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ios: Build with -fembed-bitcode (19.19 KB, patch)
2018-05-02 13:03 UTC, Olivier Crête
none Details | Review
ios: Build with -fembed-bitcode (19.94 KB, patch)
2018-05-02 17:04 UTC, Olivier Crête
committed Details | Review
gst-examples: Update iOS project for newer XCode and embed-bitcode (6.77 KB, patch)
2018-05-02 17:44 UTC, Olivier Crête
committed Details | Review

Description Sebastian Dröge (slomo) 2016-09-05 09:31:13 UTC
This will need some research how to handle this in combination with assembly optimizations (or if we have to disable them all), and also what is required other than -fembed-bitcode for other C/C++ code, if anything.
Comment 1 Sebastian Dröge (slomo) 2016-09-05 09:31:36 UTC
Normal instead of enhancement as this is already a requirement for tvOS and will most likely be one soon for iOS
Comment 2 skryv 2017-10-24 11:31:11 UTC
Please, enable it for iOS build in order to make possible to use it in iOS projects that have bitcode enabled.
Note that most of iOS projects use bitcode option for compatibility reasons nowadays.
If iOS project has bitcode option enabled than it causes linking problem:
ld: '/Users/skryv/Library/Developer/GStreamer/iPhone.sdk/GStreamer.framework/GStreamer(libgstapplemedia_a_armv7_-libgstapplemedia_la-avfassetsrc.o)' 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. file '/Users/skryv/Library/Developer/GStreamer/iPhone.sdk/GStreamer.framework/GStreamer' for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Comment 4 Sebastian Dröge (slomo) 2017-10-24 11:44:23 UTC
It's not just a simple matter of "enabling" it. Someone will have to test everything and find ways to make this work with the custom assembly in various packages.
Comment 5 skryv 2017-10-24 12:05:17 UTC
 According to this https://stackoverflow.com/questions/31088618/impact-of-xcode-build-options-enable-bitcode-yes-no enabling bitcode only says if to delay last linking phase. This means there is no difference. This is also mentioned there.
 But anyway as I luckily need this, I would take the role of beta tester if you kindly provide the build.
Comment 6 Sebastian Dröge (slomo) 2017-10-24 12:08:45 UTC
If you want to work on a patch for that, that would be great! It's the cerbero tool that would have to be improved, which is what is used to building the GStreamer binaries for Windows/macOS/iOS/Android.
Comment 8 skryv 2017-10-24 12:43:14 UTC
It seems interesting, but I need my manager approval for this. It might be much easier if someone could make the build so I could check it.
Comment 9 skryv 2017-10-24 12:45:02 UTC
And again, it is just delayed last linking phase and not need to be checked as it is checked by clang team.
Comment 10 skryv 2017-10-24 12:50:47 UTC
Also build size should make good impression.
Comment 11 skryv 2017-10-24 12:51:10 UTC
And build time.
Comment 12 Sebastian Dröge (slomo) 2017-10-24 12:52:49 UTC
Those two patches are not enough, the build generally needs to be changed so that bitcode is embedded. In config/ios.config at least, and then probably in all .recipe files where the build system doesn't honour the general settings.
Comment 13 Sebastian Dröge (slomo) 2017-10-24 12:55:25 UTC
(In reply to skryv from comment #11)
> And build time.

We still need to build for all archs because of the assembly and then merge the build results later like we do now, and also need to do adjustments to all the build systems.
Comment 14 Olivier Crête 2018-05-02 13:03:18 UTC
Created attachment 371613 [details] [review]
ios: Build with -fembed-bitcode

Here is a Cerbero patch that enables -fembed-bitcode for iOS.. Everything seems to work except libav (which doesn't build right now).
Comment 15 Sebastian Dröge (slomo) 2018-05-02 13:13:49 UTC
(In reply to Olivier Crête from comment #14)
> Everything seems to work except libav (which doesn't build right now).

That was fixed last night. Can you check if gst-libav still builds with your patch? :)
Comment 16 Olivier Crête 2018-05-02 17:04:15 UTC
Created attachment 371619 [details] [review]
ios: Build with -fembed-bitcode

This updated patch seems to also build gst-libav.. I guess before we push it into master, it would be good if someone else can do a build and try it. When we push it, we need to do a total wipe of existing build on the CI too..
Comment 17 Olivier Crête 2018-05-02 17:44:37 UTC
Created attachment 371620 [details] [review]
gst-examples: Update iOS project for newer XCode and embed-bitcode

I also updated the iOS project in gst-examples to do bitcode embedded and also toi use the gcc libstdc++ instead of the llvm libc++ as this is what we build with.
Comment 18 Olivier Crête 2018-05-05 11:08:57 UTC
Review of attachment 371619 [details] [review]:

Pushed to master, let's see what happens with the CI!
Comment 19 Olivier Crête 2018-05-06 09:00:27 UTC
Both patches merged! CI passed, we have a -fembed-bitcode build, I repeat, we have embedded the bitcode! Now let's make this tvOS apps!