Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit f8f338b

Browse files
committed
Narrow the scope of the Windows Android arm hack
1 parent 2a1be6d commit f8f338b

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

DEPS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ allowed_hosts = [
118118
]
119119

120120
deps = {
121-
'src': 'https://github.com/flutter/buildroot.git' + '@' + 'ad96f00615dc306c22cc09d433eee50392f8033c',
121+
'src': 'https://github.com/zanderso/buildroot.git' + '@' + 'f33db0ff2d2d6b1d174076351a609e83da9918b9',
122122

123123
# Fuchsia compatibility
124124
#

tools/gn

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -329,15 +329,16 @@ def to_gn_args(args):
329329
gn_args['target_cpu'] = get_target_cpu(args)
330330
gn_args['dart_target_arch'] = gn_args['target_cpu']
331331

332-
# No cross-compilation on Windows (for now). Use host toolchain that
333-
# matches the bit-width of the target architecture.
334-
if sys.platform.startswith(('cygwin', 'win')) and args.target_os != 'win':
335-
cpu = cpu_for_target_arch(gn_args['target_cpu'])
336-
# We explicitly allow arm64 native build. 'host_cpu' key may not exist.
337-
if gn_args.get('host_cpu') == 'arm64' and gn_args['target_cpu'] == 'arm64':
338-
cpu = 'arm64'
339-
gn_args['host_cpu'] = cpu
340-
gn_args['target_cpu'] = cpu
332+
# We cannot cross-compile for 32 bit arm on a Windows host. We work around
333+
# this by leaving 'target_cpu' and 'dart_target_arch' set to 'arm' so that
334+
# Dart tools like gen_snapshot that are built for the host will correctly
335+
# target arm, but we hardcode the 'current_cpu' to always be the host arch
336+
# so that the GN build doesn't go looking for a Windows arm toolchain, which
337+
# does not exist. Further, we set the 'host_cpu' so that it shares the
338+
# bitwidth of the 32-bit arm target.
339+
if sys.platform.startswith(('cygwin', 'win')) and args.target_os == 'android' and gn_args['target_cpu'] == 'arm':
340+
gn_args['host_cpu'] = 'x86'
341+
gn_args['current_cpu'] = 'x86'
341342

342343
if is_host_build(args) and gn_args['host_os'] == 'mac':
343344
# macOS host builds (whether x64 or arm64) must currently be built under

0 commit comments

Comments
 (0)