Skip to content

Commit

Permalink
Don't use intel clang on arm64 macs (#54291)
Browse files Browse the repository at this point in the history
Since gen_snapshot is lipo'd everywhere now, it should be safe to both
build with either arm64 or intel macs, and to use the arm64 native clang
toolchain on arm64 macs instead of the intel toolchain under Rosetta.

Related to flutter/flutter#103386
zanderso authored Aug 3, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 9805779 commit 16012e2
Showing 4 changed files with 2 additions and 27 deletions.
8 changes: 0 additions & 8 deletions ci/builders/mac_clang_tidy.json
Original file line number Diff line number Diff line change
@@ -15,7 +15,6 @@
"debug",
"--prebuilt-dart-sdk",
"--no-lto",
"--force-mac-arm64",
"--target-dir",
"ci/host_debug_clang_tidy",
"--rbe",
@@ -44,7 +43,6 @@
"debug",
"--simulator",
"--no-lto",
"--force-mac-arm64",
"--target-dir",
"ci/ios_debug_sim_clang_tidy",
"--rbe",
@@ -87,7 +85,6 @@
"debug",
"--prebuilt-dart-sdk",
"--no-lto",
"--force-mac-arm64",
"--target-dir",
"ci/host_debug_clang_tidy",
"--rbe",
@@ -137,7 +134,6 @@
"debug",
"--prebuilt-dart-sdk",
"--no-lto",
"--force-mac-arm64",
"--target-dir",
"ci/host_debug_clang_tidy",
"--rbe",
@@ -187,7 +183,6 @@
"debug",
"--prebuilt-dart-sdk",
"--no-lto",
"--force-mac-arm64",
"--target-dir",
"ci/host_debug_clang_tidy",
"--rbe",
@@ -237,7 +232,6 @@
"debug",
"--prebuilt-dart-sdk",
"--no-lto",
"--force-mac-arm64",
"--target-dir",
"ci/host_debug_clang_tidy",
"--rbe",
@@ -288,7 +282,6 @@
"debug",
"--prebuilt-dart-sdk",
"--no-lto",
"--force-mac-arm64",
"--target-dir",
"ci/host_debug_clang_tidy",
"--rbe",
@@ -306,7 +299,6 @@
"debug",
"--simulator",
"--no-lto",
"--force-mac-arm64",
"--target-dir",
"ci/ios_debug_sim_clang_tidy",
"--rbe",
6 changes: 2 additions & 4 deletions ci/builders/mac_ios_engine.json
Original file line number Diff line number Diff line change
@@ -3,8 +3,7 @@
{
"drone_dimensions": [
"device_type=none",
"os=Mac-13|Mac-14",
"cpu=x86"
"os=Mac-13|Mac-14"
],
"gclient_variables": {
"download_android_deps": false,
@@ -231,8 +230,7 @@
{
"drone_dimensions": [
"device_type=none",
"os=Mac-13|Mac-14",
"cpu=x86"
"os=Mac-13|Mac-14"
],
"gclient_variables": {
"download_android_deps": false,
3 changes: 0 additions & 3 deletions ci/builders/mac_unopt.json
Original file line number Diff line number Diff line change
@@ -354,7 +354,6 @@
"--unoptimized",
"--no-lto",
"--prebuilt-dart-sdk",
"--force-mac-arm64",
"--mac-cpu",
"arm64",
"--rbe",
@@ -415,7 +414,6 @@
"debug",
"--simulator",
"--no-lto",
"--force-mac-arm64",
"--simulator-cpu",
"arm64",
"--rbe",
@@ -483,7 +481,6 @@
"debug",
"--simulator",
"--no-lto",
"--force-mac-arm64",
"--simulator-cpu",
"arm64",
"--darwin-extension-safe",
12 changes: 0 additions & 12 deletions tools/gn
Original file line number Diff line number Diff line change
@@ -502,11 +502,6 @@ def to_gn_args(args):
gn_args['host_cpu'] = 'x86'
gn_args['current_cpu'] = 'x86'

# TODO(cbracken):
# https://github.com/flutter/flutter/issues/103386
if gn_args['target_os'] == 'ios' and not args.force_mac_arm64:
gn_args['host_cpu'] = 'x64'

if gn_args['target_os'] == 'ios' or get_host_os() == 'mac':
if gn_args['target_os'] == 'ios':
gn_args['use_ios_simulator'] = args.simulator
@@ -917,13 +912,6 @@ def parse_args(args):
parser.add_argument('--ios', dest='target_os', action='store_const', const='ios')
parser.add_argument('--mac', dest='target_os', action='store_const', const='mac')
parser.add_argument('--mac-cpu', type=str, choices=['x64', 'arm64'], default='x64')
parser.add_argument(
'--force-mac-arm64',
action='store_true',
default=False,
help='Force use of the clang_arm64 toolchain on an arm64 mac host when '
'building host binaries.'
)
parser.add_argument('--simulator', action='store_true', default=False)
parser.add_argument('--linux', dest='target_os', action='store_const', const='linux')
parser.add_argument('--fuchsia', dest='target_os', action='store_const', const='fuchsia')

0 comments on commit 16012e2

Please sign in to comment.