Reapply "[fuchsia] Prepare for setting the Dart target architecture appropriately in the host binaries."

Add missing config to run_vm_tests.

R=zra@google.com

Review-Url: https://codereview.chromium.org/2937503003 .
This commit is contained in:
Ryan Macnak 2017-06-13 08:48:53 -07:00
parent 61e746c025
commit 9ab39ae099
8 changed files with 194 additions and 95 deletions

View file

@ -72,27 +72,11 @@ config("dart_no_snapshot_config") {
defines += [ "DART_NO_SNAPSHOT" ]
}
config("dart_config") {
# TODO(rmacnak): If Fuchsia adds a checked-in SDK, this should be folded back
# into dart_config
config("dart_use_target_arch_config") {
defines = []
if (target_os == "android") {
defines += [ "TARGET_OS_ANDROID" ]
} else if (target_os == "fuchsia") {
defines += [ "TARGET_OS_FUCHSIA" ]
} else if (target_os == "ios") {
defines += [ "TARGET_OS_MACOS" ]
defines += [ "TARGET_OS_MACOS_IOS" ]
} else if (target_os == "linux") {
defines += [ "TARGET_OS_LINUX" ]
} else if (target_os == "mac") {
defines += [ "TARGET_OS_MACOS" ]
} else if (target_os == "win") {
defines += [ "TARGET_OS_WINDOWS" ]
} else {
print("Unknown target_os: $target_os")
assert(false)
}
if (dart_target_arch != "") {
if (dart_target_arch == "arm" || dart_target_arch == "simarm") {
defines += [ "TARGET_ARCH_ARM" ]
@ -122,6 +106,28 @@ config("dart_config") {
assert(false)
}
}
}
config("dart_config") {
defines = []
if (target_os == "android") {
defines += [ "TARGET_OS_ANDROID" ]
} else if (target_os == "fuchsia") {
defines += [ "TARGET_OS_FUCHSIA" ]
} else if (target_os == "ios") {
defines += [ "TARGET_OS_MACOS" ]
defines += [ "TARGET_OS_MACOS_IOS" ]
} else if (target_os == "linux") {
defines += [ "TARGET_OS_LINUX" ]
} else if (target_os == "mac") {
defines += [ "TARGET_OS_MACOS" ]
} else if (target_os == "win") {
defines += [ "TARGET_OS_WINDOWS" ]
} else {
print("Unknown target_os: $target_os")
assert(false)
}
if (dart_debug) {
defines += [ "DEBUG" ]
@ -223,6 +229,7 @@ template("libdart_library") {
}
libdart_library("libdart_jit") {
extra_configs = [ ":dart_use_target_arch_config" ]
extra_deps = [
"vm:libdart_lib_jit",
"vm:libdart_vm_jit",
@ -230,7 +237,10 @@ libdart_library("libdart_jit") {
}
libdart_library("libdart_precompiled_runtime") {
extra_configs = [ ":dart_precompiled_runtime_config" ]
extra_configs = [
":dart_precompiled_runtime_config",
":dart_use_target_arch_config",
]
extra_deps = [
"vm:libdart_lib_precompiled_runtime",
"vm:libdart_vm_precompiled_runtime",
@ -241,6 +251,7 @@ libdart_library("libdart_nosnapshot_with_precompiler") {
extra_configs = [
":dart_no_snapshot_config",
":dart_precompiler_config",
":dart_use_target_arch_config",
]
extra_deps = [
"vm:libdart_lib_nosnapshot_with_precompiler",
@ -248,8 +259,23 @@ libdart_library("libdart_nosnapshot_with_precompiler") {
]
}
# TODO(rmacnak): Remove if Fuchsia adds a checked-in SDK.
libdart_library("libdart_nosnapshot_with_precompiler_host_arch") {
extra_configs = [
":dart_no_snapshot_config",
":dart_precompiler_config",
]
extra_deps = [
"vm:libdart_lib_nosnapshot_with_precompiler_host_arch",
"vm:libdart_vm_nosnapshot_with_precompiler_host_arch",
]
}
libdart_library("libdart_with_precompiler") {
extra_configs = [ ":dart_precompiler_config" ]
extra_configs = [
":dart_precompiler_config",
":dart_use_target_arch_config",
]
extra_deps = [
"vm:libdart_lib_with_precompiler",
"vm:libdart_vm_with_precompiler",

View file

@ -274,6 +274,7 @@ executable("gen_snapshot") {
"..:dart_config",
"..:dart_maybe_product_config",
"..:dart_precompiler_config",
"..:dart_use_target_arch_config",
]
deps = [
":gen_resources_cc",
@ -668,6 +669,7 @@ template("dart_executable") {
}
dart_executable("dart") {
extra_configs = [ "..:dart_use_target_arch_config" ]
extra_deps = [
"..:libdart_jit",
":dart_snapshot_cc",
@ -696,57 +698,72 @@ dart_executable("dart_precompiled_runtime") {
]
}
dart_executable("dart_bootstrap") {
extra_configs = [
"..:dart_precompiler_config",
"..:dart_no_snapshot_config",
]
extra_deps = [
":generate_builtin_cc_file",
":generate_io_cc_file",
":generate_io_patch_cc_file",
":generate_html_cc_file",
":generate_html_common_cc_file",
":generate_js_cc_file",
":generate_js_util_cc_file",
":generate_blink_cc_file",
":generate_indexed_db_cc_file",
":generate_cached_patches_cc_file",
":generate_web_gl_cc_file",
":generate_metadata_cc_file",
":generate_web_sql_cc_file",
":generate_svg_cc_file",
":generate_web_audio_cc_file",
"..:libdart_nosnapshot_with_precompiler",
]
extra_defines = [ "NO_OBSERVATORY" ]
extra_sources = [
"builtin.cc",
"builtin.h",
"dfe.cc",
"dfe.h",
"loader.cc",
"loader.h",
"observatory_assets_empty.cc",
"snapshot_empty.cc",
template("dart_bootstrap_template") {
invoker_extra_configs = []
if (defined(invoker.extra_configs)) {
invoker_extra_configs += invoker.extra_configs
}
dart_executable(target_name) {
extra_configs = [
"..:dart_precompiler_config",
"..:dart_no_snapshot_config",
] + invoker_extra_configs
extra_deps = [
":generate_builtin_cc_file",
":generate_io_cc_file",
":generate_io_patch_cc_file",
":generate_html_cc_file",
":generate_html_common_cc_file",
":generate_js_cc_file",
":generate_js_util_cc_file",
":generate_blink_cc_file",
":generate_indexed_db_cc_file",
":generate_cached_patches_cc_file",
":generate_web_gl_cc_file",
":generate_metadata_cc_file",
":generate_web_sql_cc_file",
":generate_svg_cc_file",
":generate_web_audio_cc_file",
"..:libdart_nosnapshot_with_precompiler",
]
extra_defines = [ "NO_OBSERVATORY" ]
extra_sources = [
"builtin.cc",
"builtin.h",
"dfe.cc",
"dfe.h",
"loader.cc",
"loader.h",
"observatory_assets_empty.cc",
"snapshot_empty.cc",
# Include generated source files.
"$target_gen_dir/builtin_gen.cc",
"$target_gen_dir/io_gen.cc",
"$target_gen_dir/io_patch_gen.cc",
"$target_gen_dir/html_gen.cc",
"$target_gen_dir/html_common_gen.cc",
"$target_gen_dir/js_gen.cc",
"$target_gen_dir/js_util_gen.cc",
"$target_gen_dir/blink_gen.cc",
"$target_gen_dir/indexed_db_gen.cc",
"$target_gen_dir/cached_patches_gen.cc",
"$target_gen_dir/web_gl_gen.cc",
"$target_gen_dir/metadata_gen.cc",
"$target_gen_dir/web_sql_gen.cc",
"$target_gen_dir/svg_gen.cc",
"$target_gen_dir/web_audio_gen.cc",
]
# Include generated source files.
"$target_gen_dir/builtin_gen.cc",
"$target_gen_dir/io_gen.cc",
"$target_gen_dir/io_patch_gen.cc",
"$target_gen_dir/html_gen.cc",
"$target_gen_dir/html_common_gen.cc",
"$target_gen_dir/js_gen.cc",
"$target_gen_dir/js_util_gen.cc",
"$target_gen_dir/blink_gen.cc",
"$target_gen_dir/indexed_db_gen.cc",
"$target_gen_dir/cached_patches_gen.cc",
"$target_gen_dir/web_gl_gen.cc",
"$target_gen_dir/metadata_gen.cc",
"$target_gen_dir/web_sql_gen.cc",
"$target_gen_dir/svg_gen.cc",
"$target_gen_dir/web_audio_gen.cc",
]
}
}
dart_bootstrap_template("dart_bootstrap") {
extra_configs = [ "..:dart_use_target_arch_config" ]
}
# TODO(rmacnak): Remove if Fuchsia adds a checked-in SDK.
dart_bootstrap_template("dart_bootstrap_host_arch") {
extra_configs = []
}
if (is_fuchsia) {
@ -835,6 +852,7 @@ executable("run_vm_tests") {
configs += [
"..:dart_config",
"..:dart_maybe_product_config",
"..:dart_use_target_arch_config",
]
deps = [

View file

@ -266,7 +266,6 @@ class IsolateLoaderState extends IsolateEmbedderData {
RawReceivePort _packagesPort;
void _requestPackagesMap([Uri packageConfig]) {
assert(_rootScript != null);
if (_packagesPort != null) {
// Already scheduled.
return;

View file

@ -40,11 +40,13 @@ 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_host_arch($host_toolchain)" ]
dart_out_dir =
get_label_info("../bin:dart_bootstrap($host_toolchain)", "root_out_dir")
dart_bootstrap = rebase_path("$dart_out_dir/dart_bootstrap$executable_suffix")
get_label_info("../bin:dart_bootstrap_host_arch($host_toolchain)",
"root_out_dir")
dart_bootstrap =
rebase_path("$dart_out_dir/dart_bootstrap_host_arch$executable_suffix")
pub_build_args = [
"--sdk=True",

View file

@ -46,6 +46,7 @@ static_library("libdart_vm_jit") {
configs += [
"..:dart_config",
"..:dart_maybe_product_config",
"..:dart_use_target_arch_config",
]
public_configs = [ ":libdart_vm_config" ]
set_sources_assignment_filter([
@ -61,6 +62,7 @@ static_library("libdart_vm_precompiled_runtime") {
"..:dart_config",
"..:dart_maybe_product_config",
"..:dart_precompiled_runtime_config",
"..:dart_use_target_arch_config",
]
public_configs = [ ":libdart_vm_config" ]
set_sources_assignment_filter([
@ -76,6 +78,7 @@ static_library("libdart_vm_nosnapshot") {
"..:dart_config",
"..:dart_maybe_product_config",
"..:dart_no_snapshot_config",
"..:dart_use_target_arch_config",
]
public_configs = [ ":libdart_vm_config" ]
set_sources_assignment_filter([
@ -87,6 +90,23 @@ static_library("libdart_vm_nosnapshot") {
}
static_library("libdart_vm_nosnapshot_with_precompiler") {
configs += [
"..:dart_config",
"..:dart_maybe_product_config",
"..:dart_precompiler_config",
"..:dart_no_snapshot_config",
"..:dart_use_target_arch_config",
]
public_configs = [ ":libdart_vm_config" ]
set_sources_assignment_filter([
"*_test.cc",
"*_test.h",
])
sources = vm_sources_list
include_dirs = [ ".." ]
}
static_library("libdart_vm_nosnapshot_with_precompiler_host_arch") {
configs += [
"..:dart_config",
"..:dart_maybe_product_config",
@ -107,6 +127,7 @@ static_library("libdart_vm_with_precompiler") {
"..:dart_config",
"..:dart_maybe_product_config",
"..:dart_precompiler_config",
"..:dart_use_target_arch_config",
]
public_configs = [ ":libdart_vm_config" ]
set_sources_assignment_filter([
@ -213,6 +234,18 @@ template("generate_core_libraries") {
all_libsources = rebase_path(invoker.allsources, ".", "../lib")
static_library("libdart_lib_nosnapshot_with_precompiler") {
configs += [
"..:dart_config",
"..:dart_maybe_product_config",
"..:dart_precompiler_config",
"..:dart_use_target_arch_config",
]
deps = libdeps
sources = all_libsources + [ "bootstrap.cc" ] + liboutputs
include_dirs = [ ".." ]
}
static_library("libdart_lib_nosnapshot_with_precompiler_host_arch") {
configs += [
"..:dart_config",
"..:dart_maybe_product_config",
@ -228,6 +261,7 @@ template("generate_core_libraries") {
"..:dart_config",
"..:dart_maybe_product_config",
"..:dart_precompiler_config",
"..:dart_use_target_arch_config",
]
deps = libdeps
sources = all_libsources + [ "bootstrap_nocore.cc" ]
@ -238,6 +272,7 @@ template("generate_core_libraries") {
configs += [
"..:dart_config",
"..:dart_maybe_product_config",
"..:dart_use_target_arch_config",
]
sources = all_libsources + [ "bootstrap_nocore.cc" ]
include_dirs = [ ".." ]
@ -248,6 +283,7 @@ template("generate_core_libraries") {
"..:dart_config",
"..:dart_maybe_product_config",
"..:dart_precompiled_runtime_config",
"..:dart_use_target_arch_config",
]
sources = all_libsources + [ "bootstrap_nocore.cc" ]
include_dirs = [ ".." ]

View file

@ -10,6 +10,9 @@ declare_args() {
# Default to building app-jit snapshots. The simulator and cross builds
# override this to script snapshots to cut down on build time.
dart_snapshot_kind = "app-jit"
if (target_cpu != host_cpu) {
dart_snapshot_kind = "script"
}
}
template("application_snapshot") {
@ -25,7 +28,7 @@ template("application_snapshot") {
if (defined(invoker.deps)) {
extra_deps += invoker.deps
}
extra_inputs = [main_dart]
extra_inputs = [ main_dart ]
if (defined(invoker.inputs)) {
extra_inputs += invoker.inputs
}
@ -47,16 +50,22 @@ template("application_snapshot") {
abs_output = rebase_path(output)
main_file = rebase_path(main_dart)
args = [ "--packages=$dot_packages",
"--snapshot=$abs_output" ]
args = [
"--packages=$dot_packages",
"--snapshot=$abs_output",
]
if (dart_snapshot_kind == "script") {
args += ["--snapshot-kind=script",
main_file ]
args += [
"--snapshot-kind=script",
main_file,
]
assert(training_args != "", "Ignoring unused argument")
} else if (dart_snapshot_kind == "app-jit") {
args += ["--snapshot-kind=app-jit",
main_file ] + training_args
args += [
"--snapshot-kind=app-jit",
main_file,
] + training_args
} else {
assert(false, "Bad dart_snapshot_kind: $dart_snapshot_kind")
}

View file

@ -14,7 +14,10 @@ group("dartanalyzer") {
}
analyzer_files = exec_script("../../tools/list_dart_files.py",
[ "absolute", rebase_path("../../pkg/analyzer") ],
[
"absolute",
rebase_path("../../pkg/analyzer"),
],
"list lines")
application_snapshot("generate_dartanalyzer_snapshot") {
@ -25,13 +28,19 @@ application_snapshot("generate_dartanalyzer_snapshot") {
]
name = "dartanalyzer"
cli_files = exec_script("../../tools/list_dart_files.py",
[ "absolute", rebase_path("../../pkg/analyzer_cli") ],
[
"absolute",
rebase_path("../../pkg/analyzer_cli"),
],
"list lines")
inputs = cli_files + analyzer_files
}
sdk_lib_files = exec_script("../../tools/list_dart_files.py",
[ "absolute", rebase_path("../../sdk/lib") ],
[
"absolute",
rebase_path("../../sdk/lib"),
],
"list lines")
template("generate_summary") {
@ -39,7 +48,9 @@ template("generate_summary") {
type = invoker.type
assert(type == "spec" || type == "strong")
compiled_action(target_name) {
tool = "../../runtime/bin:dart"
# TODO(rmacnak): If Fuchsia adds a checked-in SDK, revert this to use
# the 'dart' binary.
tool = "../../runtime/bin:dart_bootstrap_host_arch"
inputs = sdk_lib_files + analyzer_files
output = "$root_gen_dir/$type.sum"

View file

@ -16,12 +16,11 @@ _dart_root = get_path_info("..", "abspath")
# - deps: extra dependencies that must be built ahead of time.
template("generate_patched_sdk") {
assert(defined(invoker.input_patches_dir),
"Need input_patches_dir in $target_name")
"Need input_patches_dir in $target_name")
assert(defined(invoker.patched_sdk_dir),
"Need patched_sdk_dir in $target_name")
"Need patched_sdk_dir in $target_name")
assert(defined(invoker.mode), "Need mode in $target_name")
action(target_name) {
if (defined(invoker.deps)) {
deps = invoker.deps
} else {
@ -29,7 +28,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($host_toolchain)" ]
}
script = "$_dart_root/tools/patch_sdk.py"
@ -50,10 +49,10 @@ 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)",
"root_out_dir")
dart_bootstrap =
rebase_path("$dart_out_dir/dart_bootstrap$executable_suffix")
"$_dart_root/runtime/bin:dart_bootstrap_host_arch($host_toolchain)",
"root_out_dir")
dart_bootstrap = rebase_path(
"$dart_out_dir/dart_bootstrap_host_arch$executable_suffix")
args += [
"--dart-executable",
dart_bootstrap,
@ -68,4 +67,3 @@ template("generate_patched_sdk") {
]
}
}