@@ -94,11 +94,7 @@ def cpu_for_target_arch(arch):
9494
9595def is_host_build (args ):
9696 # If target_os == None, then this is a host build.
97- # However, for linux arm64 builds, we cross compile from x64 hosts, so the
98- # target_os='linux' and linux-cpu='arm64'
99- return args .target_os is None or (
100- args .target_os == 'linux' and args .linux_cpu == 'arm64'
101- )
97+ return args .target_os is None
10298
10399
104100# Determines whether a prebuilt Dart SDK can be used instead of building one.
@@ -406,7 +402,7 @@ def to_gn_args(args):
406402 gn_args ['skia_enable_api_available_macro' ] = args .runtime_mode != 'release'
407403
408404 if sys .platform == 'darwin' and args .target_os not in ['android' , 'fuchsia' ,
409- 'wasm' ]:
405+ 'linux' , ' wasm' ]:
410406 # OpenGL is deprecated on macOS > 10.11.
411407 # This is not necessarily needed but enabling this until we have a way to
412408 # build a macOS metal only shell and a gl only shell.
@@ -501,8 +497,8 @@ def to_gn_args(args):
501497
502498 # Enable pointer compression on 64-bit mobile targets. iOS is excluded due to
503499 # its inability to allocate address space without allocating memory.
504- if args .target_os in ['android' ] and gn_args [ 'target_cpu' ] in [ 'x64' , 'arm64 '
505- ]:
500+ if args .target_os in ['android' , 'linux '
501+ ] and gn_args [ 'target_cpu' ] in [ 'x64' , 'arm64' ]:
506502 gn_args ['dart_use_compressed_pointers' ] = True
507503
508504 if args .fuchsia_target_api_level is not None :
@@ -513,6 +509,10 @@ def to_gn_args(args):
513509 'fuchsia/target_api_level' )) as file :
514510 gn_args ['fuchsia_target_api_level' ] = int (file .read ().strip ())
515511
512+ # Don't use the default Linux sysroot when buliding for Linux on macOS.
513+ if sys .platform == 'darwin' and args .target_os == 'linux' :
514+ gn_args ['use_default_linux_sysroot' ] = False
515+
516516 # Flags for Dart features:
517517 if args .use_mallinfo2 :
518518 gn_args ['dart_use_mallinfo2' ] = args .use_mallinfo2
@@ -534,7 +534,7 @@ def to_gn_args(args):
534534 # There is a special case for Android on Windows because there we _only_ build
535535 # gen_snapshot, but the build defines otherwise make it look like the build is
536536 # for a host Windows build and make GN think we will be building ANGLE.
537- if is_host_build (args ) or (args .target_os == 'android ' and
537+ if is_host_build (args ) or (args .target_os == 'linux ' and
538538 get_host_os () == 'win' ):
539539 # Do not build unnecessary parts of the ANGLE tree.
540540 gn_args ['angle_build_all' ] = False
0 commit comments