Skip to content

Commit 856e0ba

Browse files
sstricklCommit Queue
authored andcommitted
Reland "Add Linux ARM and Linux RISCV64 cross compilation gen_snapshot binaries."
This is a reland of commit d257c52 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: #28617 > Change-Id: Ia458f167c0e75fe9c7e31684bfaf9967499e9cda > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/437720 > Commit-Queue: Tess Strickland <[email protected]> > Reviewed-by: Ivan Inozemtsev <[email protected]> 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 <[email protected]> Commit-Queue: Tess Strickland <[email protected]> Reviewed-by: Ivan Inozemtsev <[email protected]>
1 parent 814c61d commit 856e0ba

File tree

4 files changed

+107
-0
lines changed

4 files changed

+107
-0
lines changed

runtime/BUILD.gn

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,26 @@ config("dart_linux_x64_config") {
149149
]
150150
}
151151

152+
# We need to build gen_snapshot targeting Linux ARM during a build
153+
# of the SDK. This configuration is used to unconditionally target
154+
# Linux ARM. It should not be combined with dart_os_config and dart_arch_config.
155+
config("dart_linux_arm_config") {
156+
defines = [
157+
"DART_TARGET_OS_LINUX",
158+
"TARGET_ARCH_ARM",
159+
]
160+
}
161+
162+
# We need to build gen_snapshot targeting Linux RISCV64 during a build
163+
# of the SDK. This configuration is used to unconditionally target
164+
# Linux RISCV64. It should not be combined with dart_os_config and dart_arch_config.
165+
config("dart_linux_riscv64_config") {
166+
defines = [
167+
"DART_TARGET_OS_LINUX",
168+
"TARGET_ARCH_RISCV64",
169+
]
170+
}
171+
152172
config("dart_arch_config") {
153173
defines = []
154174

runtime/bin/BUILD.gn

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,20 @@ build_libdart_builtin("libdart_builtin_product_linux_arm64") {
109109
]
110110
}
111111

112+
build_libdart_builtin("libdart_builtin_product_linux_arm") {
113+
extra_configs = [
114+
"..:dart_product_config",
115+
"..:dart_linux_arm_config",
116+
]
117+
}
118+
119+
build_libdart_builtin("libdart_builtin_product_linux_riscv64") {
120+
extra_configs = [
121+
"..:dart_product_config",
122+
"..:dart_linux_riscv64_config",
123+
]
124+
}
125+
112126
template("build_native_assets_api") {
113127
extra_configs = []
114128
if (defined(invoker.extra_configs)) {
@@ -366,6 +380,33 @@ build_gen_snapshot("gen_snapshot_product_linux_arm64") {
366380
"../platform:libdart_platform_precompiler_product_linux_arm64",
367381
]
368382
}
383+
384+
build_gen_snapshot("gen_snapshot_product_linux_arm") {
385+
extra_configs = [
386+
"..:dart_product_config",
387+
"..:dart_linux_arm_config",
388+
]
389+
extra_deps = [
390+
":gen_snapshot_dart_io_product_linux_arm",
391+
":libdart_builtin_product_linux_arm",
392+
"..:libdart_precompiler_product_linux_arm",
393+
"../platform:libdart_platform_precompiler_product_linux_arm",
394+
]
395+
}
396+
397+
build_gen_snapshot("gen_snapshot_product_linux_riscv64") {
398+
extra_configs = [
399+
"..:dart_product_config",
400+
"..:dart_linux_riscv64_config",
401+
]
402+
extra_deps = [
403+
":gen_snapshot_dart_io_product_linux_riscv64",
404+
":libdart_builtin_product_linux_riscv64",
405+
"..:libdart_precompiler_product_linux_riscv64",
406+
"../platform:libdart_platform_precompiler_product_linux_riscv64",
407+
]
408+
}
409+
369410
build_gen_snapshot("gen_snapshot_host_targeting_host") {
370411
extra_configs = [ "..:dart_maybe_product_config" ]
371412
extra_deps = [
@@ -468,6 +509,20 @@ build_gen_snapshot_dart_io("gen_snapshot_dart_io_product_linux_arm64") {
468509
]
469510
}
470511

512+
build_gen_snapshot_dart_io("gen_snapshot_dart_io_product_linux_arm") {
513+
extra_configs = [
514+
"..:dart_product_config",
515+
"..:dart_linux_arm_config",
516+
]
517+
}
518+
519+
build_gen_snapshot_dart_io("gen_snapshot_dart_io_product_linux_riscv64") {
520+
extra_configs = [
521+
"..:dart_product_config",
522+
"..:dart_linux_riscv64_config",
523+
]
524+
}
525+
471526
# A source set for the implementation of 'dart:io' library.
472527
template("dart_io") {
473528
extra_configs = []

runtime/configs.gni

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,18 @@ _precompiler_product_linux_arm64_config =
6363
"$_dart_runtime:dart_linux_arm64_config",
6464
] + _product + _precompiler_base
6565

66+
_precompiler_product_linux_arm_config =
67+
[
68+
"$_dart_runtime:dart_config",
69+
"$_dart_runtime:dart_linux_arm_config",
70+
] + _product + _precompiler_base
71+
72+
_precompiler_product_linux_riscv64_config =
73+
[
74+
"$_dart_runtime:dart_config",
75+
"$_dart_runtime:dart_linux_riscv64_config",
76+
] + _product + _precompiler_base
77+
6678
_all_configs = [
6779
{
6880
suffix = "_jit"
@@ -148,6 +160,20 @@ _all_configs = [
148160
compiler = true
149161
is_product = true
150162
},
163+
{
164+
suffix = "_precompiler_product_linux_arm"
165+
configs = _precompiler_product_linux_arm_config
166+
snapshot = false
167+
compiler = true
168+
is_product = true
169+
},
170+
{
171+
suffix = "_precompiler_product_linux_riscv64"
172+
configs = _precompiler_product_linux_riscv64_config
173+
snapshot = false
174+
compiler = true
175+
is_product = true
176+
},
151177
]
152178

153179
# This template creates a target for each of the configurations listed above.

sdk/BUILD.gn

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -880,8 +880,14 @@ group("create_full_sdk") {
880880
# SDK, but add them as a dependency, so that they are built.
881881
public_deps += [
882882
"../runtime/bin:gen_snapshot_product_linux_arm64",
883+
"../runtime/bin:gen_snapshot_product_linux_riscv64",
883884
"../runtime/bin:gen_snapshot_product_linux_x64",
884885
]
886+
887+
# assembler_arm.cc disallows ARM cross-compilation on Windows.
888+
if (!is_win) {
889+
public_deps += [ "../runtime/bin:gen_snapshot_product_linux_arm" ]
890+
}
885891
}
886892
}
887893

0 commit comments

Comments
 (0)