From d39d4d0d552bea4a52a07459d1fc91f6c3a33ebc Mon Sep 17 00:00:00 2001 From: George Wright Date: Mon, 15 Jun 2020 23:01:53 +0000 Subject: [PATCH] Revert "Add an --os=fuchsia option to build.py:" This reverts commit 4ce18ab931e336ee96fd2366661e2b84e950772b. Reason for revert: bad merge, caused build breakages in flutter/engine Original change's description: > Add an --os=fuchsia option to build.py: > > tools/build.py --os=fuchsia runtime create_sdk > > This is analogous to --os=android. It cross compiles from Linux x64 to > Fuchsia. > > A lot of the build rules are just slightly different between the existing > Fuchsia build rules used by Flutter, and the ones added by GN SDK. For > example "$fuchsia_sdk_root/pkg:fdio" is now "$fuchsia_sdk_root/pkg/fdio". > So to support this I had to add a new variable, using_fuchsia_gn_sdk, > analogous to using_fuchsia_sdk. Flutter will need to set this to false. > > Change-Id: Ief275d65f30a42a801607de93cf2d27a1fe825dd > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150689 > Reviewed-by: Ryan Macnak > Commit-Queue: Liam Appelbe TBR=rmacnak@google.com,asiva@google.com,liama@google.com,kaushikiska@google.com,matthewcarroll@google.com Change-Id: If01ee34eba906c55f2d56ba650748a86e81e701c No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151321 Auto-Submit: George Wright Commit-Queue: Liam Appelbe Reviewed-by: Liam Appelbe --- DEPS | 11 --- build/config/BUILDCONFIG.gn | 15 --- build/config/compiler/BUILD.gn | 4 +- build/fuchsia/sdk.gni | 10 -- build/toolchain/fuchsia/BUILD.gn | 164 ------------------------------- runtime/BUILD.gn | 12 +-- runtime/bin/BUILD.gn | 30 +----- runtime/bin/process_fuchsia.cc | 10 +- runtime/bin/snapshot_utils.cc | 4 - runtime/platform/BUILD.gn | 4 +- runtime/vm/BUILD.gn | 19 +--- sdk/BUILD.gn | 2 +- sdk_nnbd/BUILD.gn | 2 +- tools/build.py | 26 ++--- tools/gn.py | 26 ++--- tools/utils.py | 2 +- 16 files changed, 32 insertions(+), 309 deletions(-) delete mode 100644 build/fuchsia/sdk.gni delete mode 100644 build/toolchain/fuchsia/BUILD.gn diff --git a/DEPS b/DEPS index a31992f83a9..669bab9c7f9 100644 --- a/DEPS +++ b/DEPS @@ -470,17 +470,6 @@ deps = { "dep_type": "cipd", }, - Var("dart_root") + "/third_party/fuchsia/sdk/linux": { - "packages": [ - { - "package": "fuchsia/sdk/gn/linux-amd64", - "version": "git_revision:8d5242d4f6ff8b7634b492700e60b0fd09abefa3" - } - ], - "condition": 'host_os == "linux" and host_cpu == "x64"', - "dep_type": "cipd", - }, - Var("dart_root") + "/pkg/front_end/test/fasta/types/benchmark_data": { "packages": [ { diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn index e83f6140417..4457f43f07d 100644 --- a/build/config/BUILDCONFIG.gn +++ b/build/config/BUILDCONFIG.gn @@ -196,16 +196,6 @@ if (current_os == "win") { is_nacl = false is_posix = true is_win = false -} else if (current_os == "fuchsia") { - is_android = false - is_chromeos = false - is_fuchsia = true - is_ios = false - is_linux = false - is_mac = false - is_nacl = false - is_posix = true - is_win = false } # ============================================================================= @@ -394,11 +384,6 @@ if (is_win) { } else if (is_mac) { host_toolchain = "//build/toolchain/mac:clang_x64" set_default_toolchain(host_toolchain) -} else if (is_fuchsia) { - assert(host_os == "linux") - assert(host_cpu == "x64") - host_toolchain = "//build/toolchain/linux:clang_$host_cpu" - set_default_toolchain("//build/toolchain/fuchsia") } # ============================================================================== diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn index ee47c357d29..b5a49ba9f1a 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn @@ -243,7 +243,7 @@ config("compiler") { # 3. When using the sanitizers. # Otherwise there is a performance hit, in particular on ia32. if (is_android || is_asan || is_lsan || is_msan || is_tsan || is_ubsan || - (is_linux && current_cpu != "x86") || is_fuchsia) { + (is_linux && current_cpu != "x86")) { cflags += [ "-fPIC" ] ldflags += [ "-fPIC" ] } @@ -276,8 +276,6 @@ config("compiler") { if (is_win) { # Up-to-date toolchain MSVC doesn't support c++11 flag any longer. cc_std = [ "/std:c++14" ] - } else if (is_fuchsia) { - cc_std = [ "-std=c++17" ] } else { cc_std = [ "-std=c++11" ] } diff --git a/build/fuchsia/sdk.gni b/build/fuchsia/sdk.gni deleted file mode 100644 index 00698dcb253..00000000000 --- a/build/fuchsia/sdk.gni +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file -# for details. All rights reserved. Use of this source code is governed by a -# BSD-style license that can be found in the LICENSE file. - -declare_args() { - using_fuchsia_gn_sdk = true - fuchsia_sdk_root = "//third_party/fuchsia/sdk/$host_os" - fuchsia_sdk_path = "//third_party/fuchsia/sdk/$host_os" - fuchsia_toolchain_path = "//third_party/fuchsia/toolchain/$host_os" -} diff --git a/build/toolchain/fuchsia/BUILD.gn b/build/toolchain/fuchsia/BUILD.gn deleted file mode 100644 index 2901377fbf5..00000000000 --- a/build/toolchain/fuchsia/BUILD.gn +++ /dev/null @@ -1,164 +0,0 @@ -# Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file -# for details. All rights reserved. Use of this source code is governed by a -# BSD-style license that can be found in the LICENSE file. - -import("//build/config/sysroot.gni") -import("//build/toolchain/ccache.gni") -import("//build/toolchain/gcc_toolchain.gni") -import("//build/toolchain/goma.gni") - -if (use_goma) { - assert(!use_ccache, "Goma and ccache can't be used together.") - compiler_prefix = "$goma_dir/gomacc " -} else if (use_ccache) { - compiler_prefix = "ccache " -} else { - compiler_prefix = "" -} - -toolchain("fuchsia") { - assert(target_cpu == "x64", "We currently only support 'x64' for fuchsia.") - toolchain_bin = - rebase_path("//buildtools/$host_os-$target_cpu/clang/bin", root_out_dir) - fuchsia_sdk = rebase_path("//third_party/fuchsia/sdk/$host_os", root_out_dir) - - # We can't do string interpolation ($ in strings) on things with dots in - # them. To allow us to use $cc below, for example, we create copies of - # these values in our scope. - cc = "${toolchain_bin}/clang" - cxx = "${toolchain_bin}/clang++" - ar = "${toolchain_bin}/llvm-ar" - ld = "${toolchain_bin}/clang++" - readelf = "${toolchain_bin}/llvm-readelf" - nm = "${toolchain_bin}/llvm-nm" - strip = "${toolchain_bin}/llvm-strip" - - target_triple_flags = "--target=x86_64-fuchsia" - sysroot_flags = "--sysroot ${fuchsia_sdk}/arch/${target_cpu}/sysroot" - lto_flags = "" - - # These library switches can apply to all tools below. - lib_switch = "-l" - lib_dir_switch = "-L" - - tool("cc") { - depfile = "{{output}}.d" - command = "$compiler_prefix $cc -MD -MF $depfile $target_triple_flags $sysroot_flags $lto_flags {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} -c {{source}} -o {{output}}" - depsformat = "gcc" - description = "CC {{output}}" - outputs = - [ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o" ] - } - - tool("cxx") { - depfile = "{{output}}.d" - command = "$compiler_prefix $cxx -MD -MF $depfile $target_triple_flags $sysroot_flags $lto_flags {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} -c {{source}} -o {{output}}" - depsformat = "gcc" - description = "CXX {{output}}" - outputs = - [ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o" ] - } - - tool("asm") { - depfile = "{{output}}.d" - command = "$compiler_prefix $cc -MD -MF $depfile $target_triple_flags $sysroot_flags $lto_flags {{defines}} {{include_dirs}} {{asmflags}} {{cflags}} {{cflags_c}} -c {{source}} -o {{output}}" - depsformat = "gcc" - description = "ASM {{output}}" - outputs = - [ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o" ] - } - - tool("alink") { - rspfile = "{{output}}.rsp" - command = "rm -f {{output}} && $ar rcs {{output}} @$rspfile" - description = "AR {{output}}" - rspfile_content = "{{inputs}}" - outputs = - [ "{{target_out_dir}}/{{target_output_name}}{{output_extension}}" ] - default_output_extension = ".a" - output_prefix = "lib" - } - - tool("solink") { - soname = "{{target_output_name}}{{output_extension}}" # e.g. "libfoo.so". - sofile = "{{root_out_dir}}/$soname" # Possibly including toolchain dir. - unstripped_sofile = - "{{root_out_dir}}/so.unstripped/$soname" # Possibly including toolchain - # dir. - rspfile = sofile + ".rsp" - - # These variables are not built into GN but are helpers that implement - # (1) linking to produce a .so, (2) extracting the symbols from that file - # to a temporary file, (3) if the temporary file has differences from the - # existing .TOC file, overwrite it, otherwise, don't change it. - tocfile = sofile + ".TOC" - temporary_tocname = sofile + ".tmp" - link_command = "$compiler_prefix $ld $target_triple_flags $sysroot_flags $lto_flags -shared {{ldflags}} -o $unstripped_sofile -Wl,--build-id -Wl,-soname=$soname @$rspfile" - toc_command = "{ $readelf -d $unstripped_sofile | grep SONAME ; $nm -gD -f posix $unstripped_sofile | cut -f1-2 -d' '; } > $temporary_tocname" - replace_command = "if ! cmp -s $temporary_tocname $tocfile; then mv $temporary_tocname $tocfile; fi" - strip_command = "$strip -o $sofile $unstripped_sofile" - - command = - "$link_command && $toc_command && $replace_command && $strip_command" - rspfile_content = "-Wl,--whole-archive {{inputs}} {{solibs}} -Wl,--no-whole-archive {{libs}}" - - description = "SOLINK $sofile" - - default_output_extension = ".so" - - output_prefix = "lib" - - # Since the above commands only updates the .TOC file when it changes, ask - # Ninja to check if the timestamp actually changed to know if downstream - # dependencies should be recompiled. - restat = true - - # Tell GN about the output files. It will link to the sofile but use the - # tocfile for dependency management. - outputs = [ - sofile, - unstripped_sofile, - tocfile, - ] - - link_output = sofile - depend_output = tocfile - } - - tool("link") { - exename = "{{target_output_name}}{{output_extension}}" - outfile = "{{root_out_dir}}/$exename" - rspfile = "$outfile.rsp" - unstripped_outfile = "{{root_out_dir}}/exe.stripped/$exename" - command = "$compiler_prefix $ld $target_triple_flags $sysroot_flags $lto_flags {{ldflags}} -o $unstripped_outfile -Wl,--build-id -Wl,--start-group @$rspfile {{solibs}} -Wl,--end-group {{libs}} && ${strip} -o $outfile $unstripped_outfile" - description = "LINK $outfile" - rspfile_content = "{{inputs}}" - outputs = [ - unstripped_outfile, - outfile, - ] - } - - tool("stamp") { - command = "touch {{output}}" - description = "STAMP {{output}}" - } - - tool("copy") { - command = "ln -f {{source}} {{output}} 2>/dev/null || (rm -rf {{output}} && cp -af {{source}} {{output}})" - description = "COPY {{source}} {{output}}" - } - - # When invoking this toolchain not as the default one, these args will be - # passed to the build. They are ignored when this is the default toolchain. - toolchain_args = { - current_cpu = target_cpu - current_os = target_os - - # These values need to be passed through unchanged. - target_os = target_os - target_cpu = target_cpu - - is_clang = true - } -} diff --git a/runtime/BUILD.gn b/runtime/BUILD.gn index da22c445203..bbabc7cd05e 100644 --- a/runtime/BUILD.gn +++ b/runtime/BUILD.gn @@ -136,10 +136,7 @@ config("dart_config") { } if (is_fuchsia) { - if (using_fuchsia_gn_sdk) { - lib_dirs = [ "../out/DebugFuchsiaX64/lib" ] - } - if (using_fuchsia_gn_sdk || using_fuchsia_sdk) { + if (using_fuchsia_sdk) { # TODO(chinmaygarde): Currenty these targets need to be build in the # Fuchsia tree as well as outside it using the SDK. However, not all # Fuchsia features are available in the SDK. As these features are added, @@ -226,12 +223,7 @@ library_for_all_configs("libdart") { defines = [ "DART_ENABLE_WASM" ] } if (is_fuchsia) { - if (using_fuchsia_gn_sdk) { - extra_deps += [ - "$fuchsia_sdk_root/pkg/fdio", - "$fuchsia_sdk_root/pkg/trace-engine", - ] - } else if (using_fuchsia_sdk) { + if (using_fuchsia_sdk) { extra_deps += [ "$fuchsia_sdk_root/pkg:fdio", "$fuchsia_sdk_root/pkg:trace-engine", diff --git a/runtime/bin/BUILD.gn b/runtime/bin/BUILD.gn index ace748d61aa..427fe0bfc31 100644 --- a/runtime/bin/BUILD.gn +++ b/runtime/bin/BUILD.gn @@ -42,9 +42,7 @@ template("build_libdart_builtin") { public_configs = [ ":libdart_builtin_config" ] deps = [] if (is_fuchsia) { - if (using_fuchsia_gn_sdk) { - public_deps = [ "$fuchsia_sdk_root/pkg/fdio" ] - } else if (using_fuchsia_sdk) { + if (using_fuchsia_sdk) { public_deps = [ "$fuchsia_sdk_root/pkg:fdio" ] } else { public_deps = [ "//zircon/public/lib/fdio" ] @@ -320,13 +318,7 @@ template("build_gen_snapshot_dart_io") { deps = [] if (is_fuchsia) { - if (using_fuchsia_gn_sdk) { - deps += [ - "$fuchsia_sdk_root/fidl/fuchsia.netstack", - "$fuchsia_sdk_root/pkg/sys_cpp", - ] - public_deps = [ "$fuchsia_sdk_root/pkg/fdio" ] - } else if (using_fuchsia_sdk) { + if (using_fuchsia_sdk) { deps += [ "$fuchsia_sdk_root/fidl:fuchsia.netstack", "$fuchsia_sdk_root/pkg:sys_cpp", @@ -462,13 +454,7 @@ template("dart_io") { deps += [ "//third_party/boringssl" ] if (is_fuchsia) { - if (using_fuchsia_gn_sdk) { - deps += [ - "$fuchsia_sdk_root/fidl/fuchsia.netstack", - "$fuchsia_sdk_root/pkg/sys_cpp", - ] - public_deps = [ "$fuchsia_sdk_root/pkg/fdio" ] - } else if (using_fuchsia_sdk) { + if (using_fuchsia_sdk) { deps += [ "$fuchsia_sdk_root/fidl:fuchsia.netstack", "$fuchsia_sdk_root/pkg:sys_cpp", @@ -802,9 +788,7 @@ template("dart_executable") { # have them. They are needed for running Fuchsia binaries built for the # host. if (is_linux) { - # TODO(liama): Commenting this line out because it causes problems for - # --os=fuchsia. If no one complains, remove it. - # configs += [ "../../build/config/gcc:executable_ldconfig" ] + configs += [ "../../build/config/gcc:executable_ldconfig" ] } else if (is_mac) { configs += [ "../../build/config/mac:mac_dynamic_flags" ] } @@ -1028,11 +1012,7 @@ executable("run_vm_tests") { } if (is_fuchsia) { - if (using_fuchsia_gn_sdk) { - include_dirs += [ "$fuchsia_sdk_path/pkg/trace-engine/include" ] - libs = [ "zircon" ] - } - if (!using_fuchsia_gn_sdk && !using_fuchsia_sdk) { + if (!using_fuchsia_sdk) { deps += [ "//zircon/system/ulib/trace" ] } } diff --git a/runtime/bin/process_fuchsia.cc b/runtime/bin/process_fuchsia.cc index 495eceb33ac..8805d095eb5 100644 --- a/runtime/bin/process_fuchsia.cc +++ b/runtime/bin/process_fuchsia.cc @@ -744,9 +744,7 @@ class ProcessStarter { } actions[3] = { .action = FDIO_SPAWN_ACTION_SET_NAME, - .name = { - .data = program_arguments_[0], - }, + .name.data = program_arguments_[0], }; // Then fill in the namespace actions. @@ -754,10 +752,8 @@ class ProcessStarter { for (size_t i = 0; i < flat_ns->count; i++) { actions[fixed_actions_cnt + i] = { .action = FDIO_SPAWN_ACTION_ADD_NS_ENTRY, - .ns = { - .prefix = flat_ns->path[i], - .handle = flat_ns->handle[i], - }, + .ns.prefix = flat_ns->path[i], + .ns.handle = flat_ns->handle[i], }; } free(flat_ns); diff --git a/runtime/bin/snapshot_utils.cc b/runtime/bin/snapshot_utils.cc index 5e18ebd46aa..36f629387cf 100644 --- a/runtime/bin/snapshot_utils.cc +++ b/runtime/bin/snapshot_utils.cc @@ -201,9 +201,7 @@ static AppSnapshot* TryReadAppSnapshotElf( *isolate_data_buffer = nullptr, *isolate_instructions_buffer = nullptr; Dart_LoadedElf* handle = nullptr; -#if !defined(HOST_OS_FUCHSIA) if (force_load_elf_from_memory) { -#endif File* const file = File::Open(/*namespc=*/nullptr, script_name, File::kRead); if (file == nullptr) return nullptr; @@ -218,13 +216,11 @@ static AppSnapshot* TryReadAppSnapshotElf( &isolate_data_buffer, &isolate_instructions_buffer); delete memory; file->Release(); -#if !defined(HOST_OS_FUCHSIA) } else { handle = Dart_LoadELF(script_name, file_offset, &error, &vm_data_buffer, &vm_instructions_buffer, &isolate_data_buffer, &isolate_instructions_buffer); } -#endif if (handle == nullptr) { Syslog::PrintErr("Loading failed: %s\n", error); return nullptr; diff --git a/runtime/platform/BUILD.gn b/runtime/platform/BUILD.gn index c727eeac3b4..012421df933 100644 --- a/runtime/platform/BUILD.gn +++ b/runtime/platform/BUILD.gn @@ -17,9 +17,7 @@ library_for_all_configs("libdart_platform") { extra_deps = [] if (is_fuchsia) { - if (using_fuchsia_gn_sdk) { - extra_deps += [ "$fuchsia_sdk_root/pkg/sys_cpp" ] - } else if (using_fuchsia_sdk) { + if (using_fuchsia_sdk) { extra_deps += [ "$fuchsia_sdk_root/pkg:sys_cpp" ] } else { extra_deps += [ "//sdk/lib/sys/cpp" ] diff --git a/runtime/vm/BUILD.gn b/runtime/vm/BUILD.gn index f2c4fbc1bfc..c35366cc7d1 100644 --- a/runtime/vm/BUILD.gn +++ b/runtime/vm/BUILD.gn @@ -72,16 +72,7 @@ library_for_all_configs("libdart_vm") { "//third_party/icu:icuuc", ] if (is_fuchsia) { - if (using_fuchsia_gn_sdk) { - extra_deps += [ - "$fuchsia_sdk_root/fidl/fuchsia.intl", - "$fuchsia_sdk_root/pkg/inspect", - "$fuchsia_sdk_root/pkg/inspect_service_cpp", - "$fuchsia_sdk_root/pkg/sys_cpp", - "$fuchsia_sdk_root/pkg/sys_inspect_cpp", - "$fuchsia_sdk_root/pkg/trace-engine", - ] - } else if (using_fuchsia_sdk) { + if (using_fuchsia_sdk) { extra_deps += [ "$fuchsia_sdk_root/fidl:fuchsia.deprecatedtimezone", "$fuchsia_sdk_root/pkg:inspect", @@ -123,9 +114,7 @@ library_for_all_configs_with_compiler("libdart_compiler") { sources = rebase_path(compiler_sources, ".", "./compiler/") include_dirs = [ ".." ] if (is_fuchsia) { - if (using_fuchsia_gn_sdk) { - extra_deps = [ "$fuchsia_sdk_root/pkg/trace-engine" ] - } else if (using_fuchsia_sdk) { + if (using_fuchsia_sdk) { extra_deps = [ "$fuchsia_sdk_root/pkg:trace-engine" ] } else { extra_deps = [ @@ -139,9 +128,7 @@ library_for_all_configs_with_compiler("libdart_compiler") { library_for_all_configs("libdart_lib") { target_type = "source_set" if (is_fuchsia) { - if (using_fuchsia_gn_sdk) { - extra_deps = [ "$fuchsia_sdk_root/pkg/trace-engine" ] - } else if (using_fuchsia_sdk) { + if (using_fuchsia_sdk) { extra_deps = [ "$fuchsia_sdk_root/pkg:trace-engine" ] } else { extra_deps = [ diff --git a/sdk/BUILD.gn b/sdk/BUILD.gn index c40f31babbb..7a5a283e3e9 100644 --- a/sdk/BUILD.gn +++ b/sdk/BUILD.gn @@ -332,7 +332,7 @@ if (target_cpu == "x64") { ignore_patterns = "{}" }, ] - if (is_linux || is_android || is_fuchsia) { + if (is_linux || is_android) { copy_tree_specs += [ { target = "copy_libtensorflowlite_c" diff --git a/sdk_nnbd/BUILD.gn b/sdk_nnbd/BUILD.gn index 887a1c4074d..368cc9bee25 100644 --- a/sdk_nnbd/BUILD.gn +++ b/sdk_nnbd/BUILD.gn @@ -332,7 +332,7 @@ if (target_cpu == "x64") { ignore_patterns = "{}" }, ] - if (is_linux || is_android || is_fuchsia) { + if (is_linux || is_android) { copy_tree_specs += [ { target = "copy_libtensorflowlite_c" diff --git a/tools/build.py b/tools/build.py index 67d9dba8cf4..895c698c52a 100755 --- a/tools/build.py +++ b/tools/build.py @@ -59,7 +59,7 @@ def BuildOptions(): result.add_option( "--os", help='Target OSs (comma-separated).', - metavar='[all,host,android,fuchsia]', + metavar='[all,host,android]', default='host') result.add_option( "--sanitizer", @@ -96,7 +96,7 @@ def ProcessOptions(options, args): if options.mode == 'all': options.mode = 'debug,release,product' if options.os == 'all': - options.os = 'host,android,fuchsia' + options.os = 'host,android' if options.sanitizer == 'all': options.sanitizer = 'none,asan,lsan,msan,tsan,ubsan' options.mode = options.mode.split(',') @@ -118,12 +118,13 @@ def ProcessOptions(options, args): return False options.os = [ProcessOsOption(os_name) for os_name in options.os] for os_name in options.os: - if not os_name in [ - 'android', 'freebsd', 'linux', 'macos', 'win32', 'fuchsia' - ]: + if not os_name in ['android', 'freebsd', 'linux', 'macos', 'win32']: print("Unknown os %s" % os_name) return False - if os_name == 'android': + if os_name != HOST_OS: + if os_name != 'android': + print("Unsupported target os %s" % os_name) + return False if not HOST_OS in ['linux', 'macos']: print("Cross-compilation to %s is not supported on host os %s." % (os_name, HOST_OS)) @@ -142,19 +143,6 @@ def ProcessOptions(options, args): "For android builds you must specify a target, such as 'runtime'." ) return False - elif os_name == 'fuchsia': - if HOST_OS != 'linux': - print("Cross-compilation to %s is not supported on host os %s." - % (os_name, HOST_OS)) - return False - if arch != 'x64': - print( - "Cross-compilation to %s is not supported for architecture %s." - % (os_name, arch)) - return False - elif os_name != HOST_OS: - print("Unsupported target os %s" % os_name) - return False return True diff --git a/tools/gn.py b/tools/gn.py index 9ba8ef8bae8..59d568de216 100755 --- a/tools/gn.py +++ b/tools/gn.py @@ -288,7 +288,7 @@ def ProcessOptions(args): if args.mode == 'all': args.mode = 'debug,release,product' if args.os == 'all': - args.os = 'host,android,fuchsia' + args.os = 'host,android' if args.sanitizer == 'all': args.sanitizer = 'none,asan,lsan,msan,tsan,ubsan' args.mode = args.mode.split(',') @@ -309,12 +309,13 @@ def ProcessOptions(args): return False oses = [ProcessOsOption(os_name) for os_name in args.os] for os_name in oses: - if not os_name in [ - 'android', 'freebsd', 'linux', 'macos', 'win32', 'fuchsia' - ]: + if not os_name in ['android', 'freebsd', 'linux', 'macos', 'win32']: print("Unknown os %s" % os_name) return False - if os_name == 'android': + if os_name != HOST_OS: + if os_name != 'android': + print("Unsupported target os %s" % os_name) + return False if not HOST_OS in ['linux', 'macos']: print("Cross-compilation to %s is not supported on host os %s." % (os_name, HOST_OS)) @@ -326,19 +327,6 @@ def ProcessOptions(args): "Cross-compilation to %s is not supported for architecture %s." % (os_name, arch)) return False - elif os_name == 'fuchsia': - if HOST_OS != 'linux': - print("Cross-compilation to %s is not supported on host os %s." - % (os_name, HOST_OS)) - return False - if arch != 'x64': - print( - "Cross-compilation to %s is not supported for architecture %s." - % (os_name, arch)) - return False - elif os_name != HOST_OS: - print("Unsupported target os %s" % os_name) - return False if HOST_OS != 'win' and args.use_crashpad: print("Crashpad is only supported on Windows") return False @@ -385,7 +373,7 @@ def parse_args(args): '--os', type=str, help='Target OSs (comma-separated).', - metavar='[all,host,android,fuchsia]', + metavar='[all,host,android]', default='host') common_group.add_argument( '--sanitizer', diff --git a/tools/utils.py b/tools/utils.py index 09d71e348e3..9097006ef96 100644 --- a/tools/utils.py +++ b/tools/utils.py @@ -314,7 +314,7 @@ def IsCrossBuild(target_os, arch): # there is no need to build a legacy version of the SDK for comparison purposes. def GetBuildConf(mode, arch, conf_os=None, sanitizer=None, dont_use_nnbd=False): nnbd = "Legacy" if dont_use_nnbd else "" - if conf_os != GuessOS() and conf_os != "host": + if conf_os == 'android': return '%s%s%s%s' % (GetBuildMode(mode), conf_os.title(), arch.upper(), nnbd) else: