diff --git a/runtime/BUILD.gn b/runtime/BUILD.gn index 730c50613f5..08643bea10a 100644 --- a/runtime/BUILD.gn +++ b/runtime/BUILD.gn @@ -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 = [] diff --git a/runtime/bin/BUILD.gn b/runtime/bin/BUILD.gn index 32121faaca1..63a919c8130 100644 --- a/runtime/bin/BUILD.gn +++ b/runtime/bin/BUILD.gn @@ -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 = [] diff --git a/runtime/configs.gni b/runtime/configs.gni index e55a8764811..6233cf8d622 100644 --- a/runtime/configs.gni +++ b/runtime/configs.gni @@ -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. diff --git a/sdk/BUILD.gn b/sdk/BUILD.gn index a67a7574d5c..17b62222bd3 100644 --- a/sdk/BUILD.gn +++ b/sdk/BUILD.gn @@ -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" ] + } } }