-
Notifications
You must be signed in to change notification settings - Fork 447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mac: Automatically build Universal x86_64 / arm64 binaries #3956
Conversation
…ersions that support building both architectures, x86_64-only binaries on Xcode versions that support only x86_64 and arm64-only binaries on Xcode versions that support only arm64. CAUTION #1: I don't have arm64 macintosh hardware so this has been tested only on an x86_64 system. CAUTION #2: This was developed on MacOS 11.0 beta 3 and Xcode 12.0 beta 2, not final release builds CAUTION #3: At this time OpenSSL does not yet provide a way to build for MacOS with arm64 architecture, so I implemented a temporary workaround, which may or may not work properly on arm64 Macs.
Xcode 12 beta 3 warns that the deployment target is OS 10.7 but the minimum supported by this version of Xcode is OS 10.11, though it builds successfully. This makes me think that BOINC may not work properly under MacOS versions earlier than OS 10.11 7when we build with Xcode 12. |
Codecov Report
@@ Coverage Diff @@
## master #3956 +/- ##
=========================================
Coverage 16.56% 16.56%
Complexity 752 752
=========================================
Files 134 134
Lines 13115 13115
Branches 1631 1631
=========================================
Hits 2172 2172
Misses 10811 10811
Partials 132 132 |
…te PowerPC support. Caution: we need to add code for arm64 CPU to get_cpu_info_mac() in hostinfo_unix.cpp I have not removed is_native_i386_app() in app_start.cpp so it can be modified to identify arm64 apps
This is as complete as possible without having an arm64 Mac to test with. A couple more considerations:
If needed, I expect that the |
Since @AenBleidd feels this PR needs review, and since Macs with arm CPUs will not be released for a few months, there may be a delay in merging this PR. But I expect that MacOS 11, which is well into beta testing, will be released soon. So I have included two of the same files that are in this PR in a new PR #3963 because they are necessary for the BOINC screensaver coordinator to work properly under MacOS 11 and so should be included in the next release of BOINC for the Mac. The two files are clientscr/gfx_switcher.cpp and clientscr/screensaver.cpp. |
…setta 2 emulator will run x86_64 apps
I feel it is important to merge this as soon as possible, and certainly within a very few days. Although more work may be needed for running on Apple Silicon (arm64) Macs, it is safe to release this code now, because none of the changes affecting arm64 will be included in a build with Xcode 11 or earlier. Only Xcode 12 will include the arm64 code in a build. I have tested this code on my Intel Mac under multiple versions of MacOS and found no problems. I have removed the WIP from this PR because have done as much as possible without access to an arm64 Mac, but merging this code into master now will make it much easier to finalize arm64 support quickly when Apple starts selling arm64 Macs before the end of this year. @AenBleidd has marked this as requiring review, but I don't know of anyone qualified to do that. Please do not let this PR sit in limbo if there is no one who can quickly perform a review. |
Closing and reopening to trigger CI Travis build |
@davidpanderson, could you please review and merge this if you're ok with these changes? |
Mac: Automatically build:
CAUTION # 1: I don't have arm64 macintosh hardware so this has been tested only on an x86_64 system.
CAUTION # 2: This was developed on MacOS 11.0 beta 3 and Xcode 12.0 beta 2, not final release builds
CAUTION # 3: At this time OpenSSL does not yet provide a way to build for MacOS with arm64 architecture, so I implemented a temporary workaround, which may or may not work properly on arm64 Macs.
Fixes #3827
Apple has announced that they will be transitioning to all arm64 ("Apple Silicon") Macs over the next two years, with the first ones to be released at the end of 2020. Apple Silicon Macs will initially include an emulator or virtual machine capable of running x86_64 code, but these will run less efficiently than native arm64 binaries and this capability will be phased out over time.
At this time, some (but not all) builds of Xcode 12 support building binaries for both Intel x86_64 Macintoshes and Apple Silicon (arm64) Macs. While these will automatically build Xcode based projects as Universal Binaries containing both architectures, BOINC's third party dependent libraries use configure and make and so require additional effort to produce Universal Binaries. And BOINC code itself required a few modifications to be compatible with arm64 Macs.
This PR does the following:
Updates the build scripts for the dependent libraries c-ares, curl, freestyle, ftgl, openssl and wxWidgets to automatically build for x86-64 architecture, arm64 architecture, or both, depending on the capabilities of the Xcode version being used.
Eliminates obsolete build settings in the Xcode project which were incompatible with building for arm64.
Adds arm64-apple-darwin as a valid BOINC platform in addition to i686-apple-darwin and x86_64-apple-darwin. (Note that the 32-bit i686-apple-darwin platform is only available on versions of MacOS prior to OS 10.15.)
Updates the release script release_boinc.sh to name the directories containing the installer and associated files boinc_x.y.z_macOSX_x86_64boinc_x.y.z_macOSX_arm64 or boinc_x.y.z_macOSX_universal as appropriate. It similarly updates the release_brand.sh script to label its products with the appropriate architecture.
Updates other Macintosh-specific BOINC files for arm64 compatibility.