Need to figure out fat binary / multi-arch support in GN on iOS, Mac, Android |
||||||
Issue descriptionI thought we had a bug for this at some point, but I don't see one now. GYP has some hacks to support building fat binaries, where we might need to build, for example, 32-bit and 64-bit x86/x64 code for mac executables. I believe roughly the way this works is that we compile the files twice and then use 'lipo' to merge them together somehow. In addition, iOS has the 'target_subarch' concept, which does a similar sort of thing for arm32 and arm64, but I think (?) the implementation is different. It's unclear what we still need to support. Chrome on Mac is now x64-only, but I think there may be some chromoting stuff that still needs fat binaries? We definitely need to support multiple sub-arches for iOS. @sergeyu - do you know (or know who would know) if we need fat binaries on mac for CRD? If we don't, I think we don't need to do anything to support them in Mac (desktop) GN. iOS / other Mac folks - do you know what, if anything, we might need to do to actually implement fat binary support on Mac and/or target_subarch=both on iOS? I think we actually have a similar problem/need on Android as we do on iOS, where we need to build 32-bit and 64-bit system webview APKs and merge them together, but IIUC we implement merging them together completely outside of the ninja builds at the moment. agrieve@, torne@, can you confirm that, maybe? Pointers to prior discussion on bugs would be appreciated. I imagine I can also paw around in the GYP ninja generators, but pointers there that might save time would also be helpful.
,
Mar 19 2016
With GN's toolchain support, it's easy to do a armv7 and arm64 build and glue them together in one GN run.
,
Mar 21 2016
The remoting pref pane loads into System Settings on OS X. This used to be 32-bit, but now that we've dropped support for 10.6-10.8, I _think_ System Settings is 64-bit on all OS X versions that we support...yup, erikchen kindly just confirmed that. So I think we don't currently need fat binaries for OS X builds. (We already landed a patch to no longer let the remoting prefpane build in 32-bit a while ago -- I thought a bit prematurely, but now it's fine to rely on this.)
,
Mar 22 2016
After https://codereview.chromium.org/1547533002 the CRD pref panel is 64-bit only, so we no longer need fat binaries there.
,
Mar 22 2016
Cool, it sounds like we can pretty conclusively skip this on Mac, and hopefully get away with separate merge actions on iOS (and possibly also Android) and thus not need to bake anything into core GN there, either.
,
Mar 22 2016
That said, I'll probably leave this open but lower the priority until we get closer to being done w/ iOS just in case.
,
Mar 22 2016
,
Mar 22 2016
(this removes this bug from the mac/gn blocker list. maybe that can be done for ios too.)
,
Mar 22 2016
For Android WebView what we ideally want is a way to build all the native parts separately for each architecture (not as any kind of "fat" build step, because one thing that would be useful is being able to actually build a *different* binary for 32-bit and 64-bit, since we don't actually need all of the same code in both cases always), but then build all the java code, resources, etc just once, and package them into the APK together without having to merge two fully built APKs later. The current merging approach duplicates building all the non-native parts and requires some fiddling to correctly merge the APKs together.
,
Mar 26 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/3bdd5635f4dba38c3035fe992039a833988e147b commit 3bdd5635f4dba38c3035fe992039a833988e147b Author: sdefresne <sdefresne@chromium.org> Date: Sat Mar 26 00:06:26 2016 [iOS/GN] Fix compilation of ios_chrome_unittests with gn. Get GN in sync with gyp by adding missing dependencies, removing the obsoletes dependencies and adding missing files and targets. Change the toolchain when targetting iOS devices to not build fat binaries as this break the "gn gen"-time selection of the level of optimisation to use from skia and libwebp. Instead, building for devices on iOS is now similar to other platforms (i.e. the arch is selected via "target_cpu" with "arm" an alias for "armv7"). Fixes the following errors: Undefined symbols for architecture arm64: "_VP8DspInitNEON", referenced from: _VP8DspInit in dec.o ... BUG= 459705 , 596237 Review URL: https://codereview.chromium.org/1810423002 Cr-Commit-Position: refs/heads/master@{#383416} [modify] https://crrev.com/3bdd5635f4dba38c3035fe992039a833988e147b/BUILD.gn [modify] https://crrev.com/3bdd5635f4dba38c3035fe992039a833988e147b/build/config/arm.gni [modify] https://crrev.com/3bdd5635f4dba38c3035fe992039a833988e147b/build/config/mac/BUILD.gn [modify] https://crrev.com/3bdd5635f4dba38c3035fe992039a833988e147b/build/toolchain/mac/BUILD.gn [modify] https://crrev.com/3bdd5635f4dba38c3035fe992039a833988e147b/components/autofill/ios/browser/BUILD.gn [modify] https://crrev.com/3bdd5635f4dba38c3035fe992039a833988e147b/components/dom_distiller/ios/BUILD.gn [modify] https://crrev.com/3bdd5635f4dba38c3035fe992039a833988e147b/components/policy/core/browser/BUILD.gn [modify] https://crrev.com/3bdd5635f4dba38c3035fe992039a833988e147b/ios/chrome/browser/BUILD.gn [modify] https://crrev.com/3bdd5635f4dba38c3035fe992039a833988e147b/ios/chrome/test/BUILD.gn [modify] https://crrev.com/3bdd5635f4dba38c3035fe992039a833988e147b/ios/net/BUILD.gn [modify] https://crrev.com/3bdd5635f4dba38c3035fe992039a833988e147b/ios/public/provider/chrome/browser/BUILD.gn
,
Apr 20 2016
I think we've figured out what to do here; we need to file separate tracking bugs for getting the Android and iOS builds updated for this, I think, and then can call it a day.
,
Jun 8 2016
The iOS bug is bug 603180 . Android is done. So, I think we can close this. |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by sdefresne@chromium.org
, Mar 19 2016