Reland "Add Linux ARM and Linux RISCV64 cross compilation gen_snapshot binaries."

This is a reland of commit d257c52309

Removes the dependency on gen_snapshot_linux_arm when building the
SDK for Windows.

TEST=ci (including pkg and sdk Windows trybots)

Original change's description:
> Add Linux ARM and Linux RISCV64 cross compilation gen_snapshot binaries.
>
> TEST=ci
>
> Issue: https://github.com/dart-lang/sdk/issues/28617
> Change-Id: Ia458f167c0e75fe9c7e31684bfaf9967499e9cda
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/437720
> Commit-Queue: Tess Strickland <sstrickl@google.com>
> Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com>

Change-Id: I19987ce794452340ee1cb7e49e14f6dac5532b42
Cq-Include-Trybots: luci.dart.try:pkg-win-release-arm64-try,pkg-win-release-try,dart-sdk-win-arm64-try,dart-sdk-win-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/438120
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com>
This commit is contained in:
Tess Strickland
2025-07-01 06:56:33 -07:00
committed by Commit Queue
parent 814c61d88d
commit 856e0ba732
4 changed files with 107 additions and 0 deletions
+20
View File
@@ -149,6 +149,26 @@ config("dart_linux_x64_config") {
]
}
# We need to build gen_snapshot targeting Linux ARM during a build
# of the SDK. This configuration is used to unconditionally target
# Linux ARM. It should not be combined with dart_os_config and dart_arch_config.
config("dart_linux_arm_config") {
defines = [
"DART_TARGET_OS_LINUX",
"TARGET_ARCH_ARM",
]
}
# We need to build gen_snapshot targeting Linux RISCV64 during a build
# of the SDK. This configuration is used to unconditionally target
# Linux RISCV64. It should not be combined with dart_os_config and dart_arch_config.
config("dart_linux_riscv64_config") {
defines = [
"DART_TARGET_OS_LINUX",
"TARGET_ARCH_RISCV64",
]
}
config("dart_arch_config") {
defines = []
+55
View File
@@ -109,6 +109,20 @@ build_libdart_builtin("libdart_builtin_product_linux_arm64") {
]
}
build_libdart_builtin("libdart_builtin_product_linux_arm") {
extra_configs = [
"..:dart_product_config",
"..:dart_linux_arm_config",
]
}
build_libdart_builtin("libdart_builtin_product_linux_riscv64") {
extra_configs = [
"..:dart_product_config",
"..:dart_linux_riscv64_config",
]
}
template("build_native_assets_api") {
extra_configs = []
if (defined(invoker.extra_configs)) {
@@ -366,6 +380,33 @@ build_gen_snapshot("gen_snapshot_product_linux_arm64") {
"../platform:libdart_platform_precompiler_product_linux_arm64",
]
}
build_gen_snapshot("gen_snapshot_product_linux_arm") {
extra_configs = [
"..:dart_product_config",
"..:dart_linux_arm_config",
]
extra_deps = [
":gen_snapshot_dart_io_product_linux_arm",
":libdart_builtin_product_linux_arm",
"..:libdart_precompiler_product_linux_arm",
"../platform:libdart_platform_precompiler_product_linux_arm",
]
}
build_gen_snapshot("gen_snapshot_product_linux_riscv64") {
extra_configs = [
"..:dart_product_config",
"..:dart_linux_riscv64_config",
]
extra_deps = [
":gen_snapshot_dart_io_product_linux_riscv64",
":libdart_builtin_product_linux_riscv64",
"..:libdart_precompiler_product_linux_riscv64",
"../platform:libdart_platform_precompiler_product_linux_riscv64",
]
}
build_gen_snapshot("gen_snapshot_host_targeting_host") {
extra_configs = [ "..:dart_maybe_product_config" ]
extra_deps = [
@@ -468,6 +509,20 @@ build_gen_snapshot_dart_io("gen_snapshot_dart_io_product_linux_arm64") {
]
}
build_gen_snapshot_dart_io("gen_snapshot_dart_io_product_linux_arm") {
extra_configs = [
"..:dart_product_config",
"..:dart_linux_arm_config",
]
}
build_gen_snapshot_dart_io("gen_snapshot_dart_io_product_linux_riscv64") {
extra_configs = [
"..:dart_product_config",
"..:dart_linux_riscv64_config",
]
}
# A source set for the implementation of 'dart:io' library.
template("dart_io") {
extra_configs = []
+26
View File
@@ -63,6 +63,18 @@ _precompiler_product_linux_arm64_config =
"$_dart_runtime:dart_linux_arm64_config",
] + _product + _precompiler_base
_precompiler_product_linux_arm_config =
[
"$_dart_runtime:dart_config",
"$_dart_runtime:dart_linux_arm_config",
] + _product + _precompiler_base
_precompiler_product_linux_riscv64_config =
[
"$_dart_runtime:dart_config",
"$_dart_runtime:dart_linux_riscv64_config",
] + _product + _precompiler_base
_all_configs = [
{
suffix = "_jit"
@@ -148,6 +160,20 @@ _all_configs = [
compiler = true
is_product = true
},
{
suffix = "_precompiler_product_linux_arm"
configs = _precompiler_product_linux_arm_config
snapshot = false
compiler = true
is_product = true
},
{
suffix = "_precompiler_product_linux_riscv64"
configs = _precompiler_product_linux_riscv64_config
snapshot = false
compiler = true
is_product = true
},
]
# This template creates a target for each of the configurations listed above.
+6
View File
@@ -880,8 +880,14 @@ group("create_full_sdk") {
# 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_riscv64",
"../runtime/bin:gen_snapshot_product_linux_x64",
]
# assembler_arm.cc disallows ARM cross-compilation on Windows.
if (!is_win) {
public_deps += [ "../runtime/bin:gen_snapshot_product_linux_arm" ]
}
}
}