From 83d7914985bb163408187c1489bce7210f5ff43f Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Mon, 8 Jul 2019 16:16:28 -0700 Subject: [PATCH 1/6] GN changes for simarm_x64 --- tools/gn | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/gn b/tools/gn index 10f8b73f1b701..1fea0e4a3084d 100755 --- a/tools/gn +++ b/tools/gn @@ -185,10 +185,14 @@ def to_gn_args(args): gn_args['dart_custom_version_for_pub'] = 'flutter' - # Make sure host_cpu matches the bit width of target_cpu. + # Make sure host_cpu matches the bit width of target_cpu. The only exception + # is that 32-bit Mac binaries are deprecated, so we switch to simarm_x64. target_is_32_bit = gn_args['target_cpu'] == 'arm' or gn_args['target_cpu'] == 'x86' if target_is_32_bit: - gn_args["host_cpu"] = "x86" + if sys.platform != 'darwin': + gn_args['host_cpu'] = 'x86' + else: + gn_args['dart_target_arch'] = 'arm' gn_args['flutter_runtime_mode'] = runtime_mode From 1d7d918fce1307444498b809f815725fbe9e6e22 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Mon, 8 Jul 2019 16:16:28 -0700 Subject: [PATCH 2/6] GN changes for simarm_x64 --- tools/gn | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/gn b/tools/gn index 40febb651b319..f705f1696c43e 100755 --- a/tools/gn +++ b/tools/gn @@ -196,10 +196,14 @@ def to_gn_args(args): gn_args['dart_custom_version_for_pub'] = 'flutter' - # Make sure host_cpu matches the bit width of target_cpu. + # Make sure host_cpu matches the bit width of target_cpu. The only exception + # is that 32-bit Mac binaries are deprecated, so we switch to simarm_x64. target_is_32_bit = gn_args['target_cpu'] == 'arm' or gn_args['target_cpu'] == 'x86' if target_is_32_bit: - gn_args["host_cpu"] = "x86" + if sys.platform != 'darwin': + gn_args['host_cpu'] = 'x86' + else: + gn_args['dart_target_arch'] = 'arm' gn_args['flutter_runtime_mode'] = runtime_mode From eb3a0e59d763a8b68074929a86063330e451d524 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Thu, 18 Jul 2019 09:30:58 -0700 Subject: [PATCH 3/6] Cleanup a bit --- tools/gn | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/gn b/tools/gn index f705f1696c43e..44745e048f418 100755 --- a/tools/gn +++ b/tools/gn @@ -200,10 +200,10 @@ def to_gn_args(args): # is that 32-bit Mac binaries are deprecated, so we switch to simarm_x64. target_is_32_bit = gn_args['target_cpu'] == 'arm' or gn_args['target_cpu'] == 'x86' if target_is_32_bit: - if sys.platform != 'darwin': - gn_args['host_cpu'] = 'x86' - else: + if sys.platform == 'darwin' and gn_args['target_cpu'] == 'arm': gn_args['dart_target_arch'] = 'arm' + else: + gn_args['host_cpu'] = 'x86' gn_args['flutter_runtime_mode'] = runtime_mode From 45920fcf06e58c4e206d925e2646a1da853024ac Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Mon, 22 Jul 2019 10:25:35 -0700 Subject: [PATCH 4/6] Guard simarm_x64 behind a flag --- tools/gn | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/gn b/tools/gn index 44745e048f418..c0d25d7155b44 100755 --- a/tools/gn +++ b/tools/gn @@ -200,7 +200,7 @@ def to_gn_args(args): # is that 32-bit Mac binaries are deprecated, so we switch to simarm_x64. target_is_32_bit = gn_args['target_cpu'] == 'arm' or gn_args['target_cpu'] == 'x86' if target_is_32_bit: - if sys.platform == 'darwin' and gn_args['target_cpu'] == 'arm': + if args.enable_arm_on_x64 and sys.platform == 'darwin' and gn_args['target_cpu'] == 'arm': gn_args['dart_target_arch'] = 'arm' else: gn_args['host_cpu'] = 'x86' @@ -319,6 +319,7 @@ def parse_args(args): parser.add_argument('--enable-fontconfig', action='store_true', default=False) parser.add_argument('--enable-skshaper', action='store_true', default=False) + parser.add_argument('--enable-arm-on-x64', action='store_true', default=False) parser.add_argument('--embedder-for-target', dest='embedder_for_target', action='store_true', default=False) From 30de189864a10b7daaf55783d3417c4d07bce6fc Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Mon, 22 Jul 2019 11:05:52 -0700 Subject: [PATCH 5/6] Remove flag --- tools/gn | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/gn b/tools/gn index c0d25d7155b44..44745e048f418 100755 --- a/tools/gn +++ b/tools/gn @@ -200,7 +200,7 @@ def to_gn_args(args): # is that 32-bit Mac binaries are deprecated, so we switch to simarm_x64. target_is_32_bit = gn_args['target_cpu'] == 'arm' or gn_args['target_cpu'] == 'x86' if target_is_32_bit: - if args.enable_arm_on_x64 and sys.platform == 'darwin' and gn_args['target_cpu'] == 'arm': + if sys.platform == 'darwin' and gn_args['target_cpu'] == 'arm': gn_args['dart_target_arch'] = 'arm' else: gn_args['host_cpu'] = 'x86' @@ -319,7 +319,6 @@ def parse_args(args): parser.add_argument('--enable-fontconfig', action='store_true', default=False) parser.add_argument('--enable-skshaper', action='store_true', default=False) - parser.add_argument('--enable-arm-on-x64', action='store_true', default=False) parser.add_argument('--embedder-for-target', dest='embedder_for_target', action='store_true', default=False) From 2eb254d7bdbec4b84023f72eaa84e6e3fe3fa9b4 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Mon, 22 Jul 2019 16:11:56 -0700 Subject: [PATCH 6/6] Remove Mac specificity --- tools/gn | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/tools/gn b/tools/gn index 44745e048f418..14e606572d3f0 100755 --- a/tools/gn +++ b/tools/gn @@ -196,14 +196,9 @@ def to_gn_args(args): gn_args['dart_custom_version_for_pub'] = 'flutter' - # Make sure host_cpu matches the bit width of target_cpu. The only exception - # is that 32-bit Mac binaries are deprecated, so we switch to simarm_x64. - target_is_32_bit = gn_args['target_cpu'] == 'arm' or gn_args['target_cpu'] == 'x86' - if target_is_32_bit: - if sys.platform == 'darwin' and gn_args['target_cpu'] == 'arm': - gn_args['dart_target_arch'] = 'arm' - else: - gn_args['host_cpu'] = 'x86' + # Make sure host_cpu matches the bit width of target_cpu on x86. + if gn_args['target_cpu'] == 'x86': + gn_args['host_cpu'] = 'x86' gn_args['flutter_runtime_mode'] = runtime_mode