GNOME Bugzilla – Bug 770875
Add support for bitcode embedding on iOS/tvOS
Last modified: 2018-05-06 09:01:18 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.
Normal instead of enhancement as this is already a requirement for tvOS and will most likely be one soon for iOS
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)
See for some details https://stackoverflow.com/questions/31088618/impact-of-xcode-build-options-enable-bitcode-yes-no
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.
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.
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.
Do you want me to remove these patches? https://cgit.freedesktop.org/gstreamer/cerbero/commit/?id=d197b6c313a3051e87f611df9a9057baa6bf662a and yours https://cgit.freedesktop.org/gstreamer/cerbero/commit/?id=529f2a78d9e477d6138c20fc5d5c9f08ff747bb0
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.
And again, it is just delayed last linking phase and not need to be checked as it is checked by clang team.
Also build size should make good impression.
And build time.
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.
(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.
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).
(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? :)
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..
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.
Review of attachment 371619 [details] [review]: Pushed to master, let's see what happens with the CI!
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!