Add gen_snapshot binaries, producing Linux ARM64/x64 snapshots
Inspired by `//runtime/bin:gen_snapshot_fuchsia`, required for go/dart-cross-compile. TEST=ci, build only Change-Id: Ie521c984a8f44d25f3f78d946af9416582a572dc Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/410402 Reviewed-by: Ryan Macnak <rmacnak@google.com> Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
This commit is contained in:
committed by
Commit Queue
parent
ccb0fedf02
commit
e6d55c6c2f
@@ -128,6 +128,26 @@ config("dart_os_fuchsia_config") {
|
||||
defines = [ "DART_TARGET_OS_FUCHSIA" ]
|
||||
}
|
||||
|
||||
# We need to build gen_snapshot targeting Linux ARM64 during a build
|
||||
# of the SDK. This configuration is used to unconditionally target
|
||||
# Linux ARM64. It should not be combined with dart_os_config and dart_arch_config.
|
||||
config("dart_linux_arm64_config") {
|
||||
defines = [
|
||||
"DART_TARGET_OS_LINUX",
|
||||
"TARGET_ARCH_ARM64",
|
||||
]
|
||||
}
|
||||
|
||||
# We need to build gen_snapshot targeting Linux ARM64 during a build
|
||||
# of the SDK. This configuration is used to unconditionally target
|
||||
# Linux ARM64. It should not be combined with dart_os_config and dart_arch_config.
|
||||
config("dart_linux_x64_config") {
|
||||
defines = [
|
||||
"DART_TARGET_OS_LINUX",
|
||||
"TARGET_ARCH_X64",
|
||||
]
|
||||
}
|
||||
|
||||
config("dart_arch_config") {
|
||||
defines = []
|
||||
|
||||
|
||||
@@ -107,6 +107,20 @@ build_libdart_builtin("libdart_builtin_product_host_targeting_host") {
|
||||
extra_configs = [ "..:dart_product_config" ]
|
||||
}
|
||||
|
||||
build_libdart_builtin("libdart_builtin_product_linux_x64") {
|
||||
extra_configs = [
|
||||
"..:dart_product_config",
|
||||
"..:dart_linux_x64_config",
|
||||
]
|
||||
}
|
||||
|
||||
build_libdart_builtin("libdart_builtin_product_linux_arm64") {
|
||||
extra_configs = [
|
||||
"..:dart_product_config",
|
||||
"..:dart_linux_arm64_config",
|
||||
]
|
||||
}
|
||||
|
||||
template("build_native_assets_api") {
|
||||
extra_configs = []
|
||||
if (defined(invoker.extra_configs)) {
|
||||
@@ -330,6 +344,31 @@ build_gen_snapshot("gen_snapshot_product_fuchsia") {
|
||||
]
|
||||
}
|
||||
|
||||
build_gen_snapshot("gen_snapshot_product_linux_x64") {
|
||||
extra_configs = [
|
||||
"..:dart_product_config",
|
||||
"..:dart_linux_x64_config",
|
||||
]
|
||||
extra_deps = [
|
||||
":gen_snapshot_dart_io_product_linux_x64",
|
||||
":libdart_builtin_product_linux_x64",
|
||||
"..:libdart_precompiler_product_linux_x64",
|
||||
"../platform:libdart_platform_precompiler_product_linux_x64",
|
||||
]
|
||||
}
|
||||
|
||||
build_gen_snapshot("gen_snapshot_product_linux_arm64") {
|
||||
extra_configs = [
|
||||
"..:dart_product_config",
|
||||
"..:dart_linux_arm64_config",
|
||||
]
|
||||
extra_deps = [
|
||||
":gen_snapshot_dart_io_product_linux_arm64",
|
||||
":libdart_builtin_product_linux_arm64",
|
||||
"..:libdart_precompiler_product_linux_arm64",
|
||||
"../platform:libdart_platform_precompiler_product_linux_arm64",
|
||||
]
|
||||
}
|
||||
build_gen_snapshot("gen_snapshot_host_targeting_host") {
|
||||
extra_configs = [ "..:dart_maybe_product_config" ]
|
||||
extra_deps = [
|
||||
@@ -434,6 +473,20 @@ build_gen_snapshot_dart_io("gen_snapshot_dart_io_product_fuchsia") {
|
||||
]
|
||||
}
|
||||
|
||||
build_gen_snapshot_dart_io("gen_snapshot_dart_io_product_linux_x64") {
|
||||
extra_configs = [
|
||||
"..:dart_product_config",
|
||||
"..:dart_linux_x64_config",
|
||||
]
|
||||
}
|
||||
|
||||
build_gen_snapshot_dart_io("gen_snapshot_dart_io_product_linux_arm64") {
|
||||
extra_configs = [
|
||||
"..:dart_product_config",
|
||||
"..:dart_linux_arm64_config",
|
||||
]
|
||||
}
|
||||
|
||||
# A source set for the implementation of 'dart:io' library.
|
||||
template("dart_io") {
|
||||
extra_configs = []
|
||||
|
||||
@@ -63,6 +63,18 @@ _precompiler_host_targeting_host_config =
|
||||
_precompiler_product_host_targeting_host_config =
|
||||
_base_host_targeting_host_config + _precompiler_base + _product
|
||||
|
||||
_precompiler_product_linux_x64_config =
|
||||
[
|
||||
"$_dart_runtime:dart_config",
|
||||
"$_dart_runtime:dart_linux_x64_config",
|
||||
] + _product + _precompiler_base
|
||||
|
||||
_precompiler_product_linux_arm64_config =
|
||||
[
|
||||
"$_dart_runtime:dart_config",
|
||||
"$_dart_runtime:dart_linux_arm64_config",
|
||||
] + _product + _precompiler_base
|
||||
|
||||
_all_configs = [
|
||||
{
|
||||
suffix = "_jit"
|
||||
@@ -148,6 +160,20 @@ _all_configs = [
|
||||
compiler = true
|
||||
is_product = false
|
||||
},
|
||||
{
|
||||
suffix = "_precompiler_product_linux_x64"
|
||||
configs = _precompiler_product_linux_x64_config
|
||||
snapshot = false
|
||||
compiler = true
|
||||
is_product = true
|
||||
},
|
||||
{
|
||||
suffix = "_precompiler_product_linux_arm64"
|
||||
configs = _precompiler_product_linux_arm64_config
|
||||
snapshot = false
|
||||
compiler = true
|
||||
is_product = true
|
||||
},
|
||||
]
|
||||
|
||||
# This template creates a target for each of the configurations listed above.
|
||||
|
||||
@@ -860,6 +860,13 @@ group("create_full_sdk") {
|
||||
if (dart_include_wasm_opt) {
|
||||
public_deps += [ ":copy_wasm_opt" ]
|
||||
}
|
||||
|
||||
# Do not include gen_snapshot binaries for cross-compilation into
|
||||
# SDK, but add them as a dependency, so that they are built.
|
||||
public_deps += [
|
||||
"../runtime/bin:gen_snapshot_product_linux_arm64",
|
||||
"../runtime/bin:gen_snapshot_product_linux_x64",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user