This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
Support building the engine on Apple Silicon Macs #33244
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f9b1530
to
cd350f2
Compare
cbracken
commented
May 11, 2022
gn_args['target_cpu'] = get_target_cpu(args) | ||
gn_args['dart_target_arch'] = gn_args['target_cpu'] | ||
gn_args['target_cpu'] = get_target_cpu(args) | ||
gn_args['dart_target_arch'] = gn_args['target_cpu'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting target_cpu and dart_target_arch here could be extracted out and made unconditional, but I'm not sure it makes the code any simpler to reason about. Maybe worth it with dart_target_arch...
cbracken
commented
May 11, 2022
# Rosetta on Apple Silicon Macs. | ||
# TODO(cbracken): https://github.com/flutter/flutter/issues/103386 | ||
if 'target_os' in gn_args and gn_args['target_os'] == 'mac': | ||
gn_args['host_cpu'] = 'x64' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These three blocks (Windows, macOS host builds, macOS target builds) are broken out separately since they're likely to have separate fixes.
This adds support for the following builds: * macOS host builds on both x86_64 and arm64 Macs. * macOS target builds on both x86_64 and arm64 Macs. Previously, macOS target builds for any architecture were possible only on x86_64 Macs. Similarly, macOS host builds were only supported on x86_64 Macs, and only for the x86_64 architecture. arm64 host builds were not possible on Intel Macs. When building on arm64 macs, builds are performed under Rosetta for two reasons: * The Fuchsia clang toolchain for arm64 macOS is not yet available. * Swiftshader (used by our engine tests) doesn't support building as an arm64 binary. See: flutter/flutter#103386 Issue: flutter/flutter#96745 Issue: flutter/flutter#79403
cd350f2
to
500d30a
Compare
zanderso
approved these changes
May 11, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
May 11, 2022
cbracken
pushed a commit
to flutter/flutter
that referenced
this pull request
May 11, 2022
sourcegraph-bot
pushed a commit
to sgtest/megarepo
that referenced
this pull request
May 11, 2022
…lutter/engine#33244) (#103514) Commit: f4fb4e74b30c7c9a179d46f3541f29532c237103
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
May 11, 2022
8 tasks
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
May 12, 2022
This was referenced May 12, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Aug 30, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Aug 30, 2022
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds support for the following builds:
Previously, macOS target builds for any architecture were possible only
on x86_64 Macs.
Similarly, macOS host builds were only supported on x86_64 Macs, and
only for the x86_64 architecture. arm64 host builds were not possible on
Intel Macs.
When building on arm64 macs, builds are performed under Rosetta for two
reasons:
support as an arm64 binary.
See: flutter/flutter#103386
Followup patches will move our use of Swiftshader to a "Swangle"
(Swiftshader + ANGLE) configuration, eliminating the Swiftshader issue
above.
Issue: flutter/flutter#96745
Issue: flutter/flutter#79403
Pre-launch Checklist
writing and running engine tests.
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.