1
0
mirror of https://github.com/dart-lang/sdk synced 2024-07-08 12:06:26 +00:00

Introduce dart_host_toolchain argument for generate_patch_sdk.gni. This allows for Flutter build to make sure that host_toolchain used for patched_sdk generation word size matches target platform.

Flutter Dart in product configuration doesn't allow --checked option. So remove '--checked' from invocation.

R=rmacnak@google.com

BUG:https://github.com/flutter/flutter/issues/10841
Review-Url: https://codereview.chromium.org/2944103003 .
This commit is contained in:
Alexander Aprelev 2017-06-22 12:41:28 -07:00
parent dd0a00f581
commit 8cd713bed3
6 changed files with 27 additions and 10 deletions

View File

@ -66,6 +66,8 @@
# saves unnecessarily compiling your tool for the target platform. But if you
# need a target build of your tool as well, just leave off the if statement.
import("dart_host_toolchain.gni")
if (host_os == "win") {
_host_executable_suffix = ".exe"
} else {
@ -97,7 +99,7 @@ template("compiled_action") {
outputs = invoker.outputs
# Constuct the host toolchain version of the tool.
host_tool = invoker.tool + "($host_toolchain)"
host_tool = invoker.tool + "($dart_host_toolchain)"
# Get the path to the executable. Currently, this assumes that the tool
# does not specify output_name so that the target name is the name to use.
@ -150,7 +152,7 @@ template("compiled_action_foreach") {
outputs = invoker.outputs
# Constuct the host toolchain version of the tool.
host_tool = invoker.tool + "($host_toolchain)"
host_tool = invoker.tool + "($dart_host_toolchain)"
# Get the path to the executable. Currently, this assumes that the tool
# does not specify output_name so that the target name is the name to use.

View File

@ -0,0 +1,13 @@
# Copyright (c) 2017, 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() {
# This argument allows to override host_toolchain used to build dart artifacts.
# This is needed to make sure that word size of the code produced on host
# machine matches word size of target architecture. For example, when
# targeting android arm 32-bit while building on linux 64-bit machine, dart vm
# that is used to produce snapshots for that android arm 32, has to be built
# using linux 32-bit toolchain.
dart_host_toolchain = host_toolchain
}

View File

@ -4,6 +4,7 @@
import("../../build/executable_suffix.gni")
import("../../build/prebuilt_dart_sdk.gni")
import("../../build/dart_host_toolchain.gni")
# Currently paths here are hard coded for convenience in building Mojo/Flutter.
declare_args() {
@ -40,10 +41,10 @@ if (dart_host_pub_exe != "") {
dart_host_pub_exe,
]
} else if (!prebuilt_dart_exe_works) {
pub_build_deps += [ "../bin:dart_bootstrap($host_toolchain)" ]
pub_build_deps += [ "../bin:dart_bootstrap($dart_host_toolchain)" ]
dart_out_dir =
get_label_info("../bin:dart_bootstrap($host_toolchain)", "root_out_dir")
dart_out_dir = get_label_info("../bin:dart_bootstrap($dart_host_toolchain)",
"root_out_dir")
dart_bootstrap = rebase_path("$dart_out_dir/dart_bootstrap$executable_suffix")
pub_build_args = [

View File

@ -48,8 +48,7 @@ def main():
print >> sys.stderr, 'ERROR: cannot locate dart executable'
return -1
dart_file = os.path.join(os.path.dirname(__file__), 'patch_sdk.dart')
subprocess.check_call(
[options.dart_executable, '--checked', dart_file] + args)
subprocess.check_call([options.dart_executable, dart_file] + args)
return 0
if __name__ == '__main__':

View File

@ -3,6 +3,7 @@
# BSD-style license that can be found in the LICENSE file.
import("../build/prebuilt_dart_sdk.gni")
import("../build/dart_host_toolchain.gni")
_dart_root = get_path_info("..", "abspath")
@ -28,7 +29,7 @@ template("generate_patched_sdk") {
}
if (!prebuilt_dart_exe_works) {
deps += [ "$_dart_root/runtime/bin:dart_bootstrap($host_toolchain)" ]
deps += [ "$_dart_root/runtime/bin:dart_bootstrap_host_arch($dart_host_toolchain)" ]
}
script = "$_dart_root/tools/patch_sdk.py"
@ -49,7 +50,7 @@ template("generate_patched_sdk") {
args = [ "--quiet" ]
if (!prebuilt_dart_exe_works) {
dart_out_dir = get_label_info(
"$_dart_root/runtime/bin:dart_bootstrap($host_toolchain)",
"$_dart_root/runtime/bin:dart_bootstrap_host_arch($dart_host_toolchain)",
"root_out_dir")
dart_bootstrap =
rebase_path("$dart_out_dir/dart_bootstrap$executable_suffix")

View File

@ -3,11 +3,12 @@
# BSD-style license that can be found in the LICENSE file.
import("../application_snapshot.gni")
import("../../build/dart_host_toolchain.gni")
application_snapshot("kernel-service") {
dfe_script = "kernel-service.dart"
deps = [
"../../runtime/vm:patched_sdk($host_toolchain)",
"../../runtime/vm:patched_sdk($dart_host_toolchain)",
]
main_dart = dfe_script
training_args = [