From 8ea606385edfdc48e3faa8d0eaf34f9a62b7763a Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Thu, 30 Jul 2020 11:26:37 -0700 Subject: [PATCH 1/3] Add preliminary Windows arm64 plmubing - Rolls buildroot to pick up https://github.com/flutter/buildroot/pull/389 - Adds support to the gn wrapper for setting the traget CPU on Windows Attempting to generate Windows arm64 GN files will currently fail, due to lack of arm64 support for an OpenGL test support target, but this sets the foundation, and makes experimentation easier. Part of https://github.com/flutter/flutter/issues/62597 --- DEPS | 2 +- tools/gn | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/DEPS b/DEPS index 672f62f08c894..656fb9f873ae4 100644 --- a/DEPS +++ b/DEPS @@ -107,7 +107,7 @@ allowed_hosts = [ ] deps = { - 'src': 'https://github.com/flutter/buildroot.git' + '@' + 'fe3b46e595e7ce1350e11aa0c90365976051f4a3', + 'src': 'https://github.com/stuartmorgan/buildroot.git' + '@' + 'e5a04629f9e171099b15925749eda68f807e4d0c', # Fuchsia compatibility # diff --git a/tools/gn b/tools/gn index 6ec42f64e934c..a7560dd1c2b01 100755 --- a/tools/gn +++ b/tools/gn @@ -38,6 +38,9 @@ def get_out_dir(args): if args.linux_cpu is not None: target_dir.append(args.linux_cpu) + if args.windows_cpu is not None: + target_dir.append(args.windows_cpu) + if args.target_os == 'fuchsia' and args.fuchsia_cpu is not None: target_dir.append(args.fuchsia_cpu) @@ -163,6 +166,8 @@ def to_gn_args(args): gn_args['target_cpu'] = args.linux_cpu elif args.target_os == 'fuchsia': gn_args['target_cpu'] = args.fuchsia_cpu + elif args.target_os == 'win': + gn_args['target_cpu'] = args.windows_cpu else: # Building host artifacts gn_args['target_cpu'] = 'x64' @@ -172,7 +177,7 @@ def to_gn_args(args): raise Exception('--interpreter is no longer needed on any supported platform.') gn_args['dart_target_arch'] = gn_args['target_cpu'] - if sys.platform.startswith(('cygwin', 'win')): + if sys.platform.startswith(('cygwin', 'win')) and args.target_os != 'win': if 'target_cpu' in gn_args: gn_args['target_cpu'] = cpu_for_target_arch(gn_args['target_cpu']) @@ -297,7 +302,7 @@ def parse_args(args): parser.add_argument('--full-dart-debug', default=False, action='store_true', help='Implies --dart-debug ' + 'and also disables optimizations in the Dart VM making it easier to step through VM code in the debugger.') - parser.add_argument('--target-os', type=str, choices=['android', 'ios', 'linux', 'fuchsia']) + parser.add_argument('--target-os', type=str, choices=['android', 'ios', 'linux', 'fuchsia', 'win']) parser.add_argument('--android', dest='target_os', action='store_const', const='android') parser.add_argument('--android-cpu', type=str, choices=['arm', 'x64', 'x86', 'arm64'], default='arm') parser.add_argument('--ios', dest='target_os', action='store_const', const='ios') @@ -306,6 +311,7 @@ def parse_args(args): parser.add_argument('--fuchsia', dest='target_os', action='store_const', const='fuchsia') parser.add_argument('--linux-cpu', type=str, choices=['x64', 'x86', 'arm64', 'arm']) parser.add_argument('--fuchsia-cpu', type=str, choices=['x64', 'arm64'], default = 'x64') + parser.add_argument('--windows-cpu', type=str, choices=['x64', 'arm64'], default = 'x64') parser.add_argument('--arm-float-abi', type=str, choices=['hard', 'soft', 'softfp']) parser.add_argument('--goma', default=True, action='store_true') From e621a8a6ff8982a5fa17762a8460c6eed50bcd26 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Thu, 30 Jul 2020 13:19:20 -0700 Subject: [PATCH 2/3] Fix directory naming for backwards compat, and to not break all the other platforms --- tools/gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/gn b/tools/gn index a7560dd1c2b01..f3c61e4e0837e 100755 --- a/tools/gn +++ b/tools/gn @@ -38,7 +38,7 @@ def get_out_dir(args): if args.linux_cpu is not None: target_dir.append(args.linux_cpu) - if args.windows_cpu is not None: + if args.windows_cpu != 'x64': target_dir.append(args.windows_cpu) if args.target_os == 'fuchsia' and args.fuchsia_cpu is not None: From 06449347a2a281594ea07408a0fa1aa6e23f6ad0 Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Mon, 3 Aug 2020 09:25:15 -0700 Subject: [PATCH 3/3] Switch to actual buildroot commit --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index 656fb9f873ae4..13859cab36694 100644 --- a/DEPS +++ b/DEPS @@ -107,7 +107,7 @@ allowed_hosts = [ ] deps = { - 'src': 'https://github.com/stuartmorgan/buildroot.git' + '@' + 'e5a04629f9e171099b15925749eda68f807e4d0c', + 'src': 'https://github.com/flutter/buildroot.git' + '@' + '292ac4889262c39710958a9984f9d89b125fbe80', # Fuchsia compatibility #