Skip to content

Commit 34087a6

Browse files
aamcommit-bot@chromium.org
authored andcommitted
[build] Remove dart_host_toolchain.
Consensus seems to be that there should be different mechanism to support host-targeting-host vs host-targeting-target configuration: comparing toolchains names won't work for that. Also, dart_host_toolchain was set up to be used by Fuchsia, but it is no longer being used. Change-Id: Ic2e63d8cef00b18bf6866122199027459eaf32c6 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118910 Reviewed-by: Zach Anderson <[email protected]> Commit-Queue: Alexander Aprelev <[email protected]>
1 parent 4aa10d0 commit 34087a6

File tree

6 files changed

+48
-92
lines changed

6 files changed

+48
-92
lines changed

BUILD.gn

+5-17
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
# BSD-style license that can be found in the LICENSE file.
44

55
import("build/config/gclient_args.gni")
6-
import("build/dart/dart_host_sdk_toolchain.gni")
76

87
targetting_fuchsia = target_os == "fuchsia"
98

@@ -17,9 +16,7 @@ group("default") {
1716
":runtime",
1817
]
1918
if (defined(checkout_llvm) && checkout_llvm) {
20-
deps += [
21-
":llvm_codegen"
22-
]
19+
deps += [ ":llvm_codegen" ]
2320
}
2421
}
2522

@@ -51,13 +48,13 @@ group("runtime") {
5148
}
5249
deps = [
5350
"runtime/bin:dart",
51+
"runtime/bin:entrypoints_verification_test_extension",
52+
"runtime/bin:ffi_test_dynamic_library",
53+
"runtime/bin:ffi_test_functions",
5454
"runtime/bin:process_test",
5555
"runtime/bin:run_vm_tests",
5656
"runtime/bin:sample_extension",
5757
"runtime/bin:test_extension",
58-
"runtime/bin:entrypoints_verification_test_extension",
59-
"runtime/bin:ffi_test_dynamic_library",
60-
"runtime/bin:ffi_test_functions",
6158
"runtime/vm:kernel_platform_files($host_toolchain)",
6259
"utils/kernel-service:kernel-service",
6360
]
@@ -92,15 +89,6 @@ group("create_sdk_nnbd") {
9289
]
9390
}
9491

95-
if (defined(dart_host_sdk_toolchain) &&
96-
dart_host_sdk_toolchain != host_toolchain) {
97-
group("create_host_sdk") {
98-
deps = [
99-
"sdk:create_sdk($dart_host_sdk_toolchain)",
100-
]
101-
}
102-
}
103-
10492
group("dart2js") {
10593
deps = [
10694
"utils/compiler:dart2js",
@@ -142,8 +130,8 @@ group("check_llvm") {
142130
group("llvm_codegen") {
143131
if (defined(checkout_llvm) && checkout_llvm) {
144132
deps = [
145-
"runtime/llvm_codegen/codegen",
146133
"runtime/llvm_codegen/bit",
134+
"runtime/llvm_codegen/codegen",
147135
]
148136
}
149137
}

build/dart/dart_action.gni

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
# BSD-style license that can be found in the LICENSE file.
44

55
import("../executable_suffix.gni")
6-
import("dart_host_sdk_toolchain.gni")
76
import("prebuilt_dart_sdk.gni")
87

98
_is_fuchsia = defined(is_fuchsia_tree) && is_fuchsia_tree
@@ -62,7 +61,7 @@ template("_compiled_action") {
6261
outputs = invoker.outputs
6362

6463
# Construct the host toolchain version of the tool.
65-
host_tool = invoker.tool + "($dart_host_toolchain)"
64+
host_tool = invoker.tool + "($host_toolchain)"
6665

6766
# Get the path to the executable. Currently, this assumes that the tool
6867
# does not specify output_name so that the target name is the name to use.

build/dart/dart_host_sdk_toolchain.gni

-16
This file was deleted.

runtime/BUILD.gn

+36-49
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# for details. All rights reserved. Use of this source code is governed by a
33
# BSD-style license that can be found in the LICENSE file.
44

5-
import("../build/dart/dart_host_sdk_toolchain.gni")
65
import("configs.gni")
76
import("runtime_args.gni")
87

@@ -67,28 +66,22 @@ config("dart_nosnapshot_config") {
6766
config("dart_os_config") {
6867
defines = []
6968

70-
# If dart_host_toolchain is the current toolchain, and it is different from
71-
# host_toolchain, then we are building the SDK for the host, and should not
72-
# hardcode these defines.
73-
if (current_toolchain != dart_host_toolchain ||
74-
host_toolchain == dart_host_toolchain) {
75-
if (target_os == "android") {
76-
defines += [ "TARGET_OS_ANDROID" ]
77-
} else if (target_os == "fuchsia") {
78-
defines += [ "TARGET_OS_FUCHSIA" ]
79-
} else if (target_os == "ios") {
80-
defines += [ "TARGET_OS_MACOS" ]
81-
defines += [ "TARGET_OS_MACOS_IOS" ]
82-
} else if (target_os == "linux") {
83-
defines += [ "TARGET_OS_LINUX" ]
84-
} else if (target_os == "mac") {
85-
defines += [ "TARGET_OS_MACOS" ]
86-
} else if (target_os == "win") {
87-
defines += [ "TARGET_OS_WINDOWS" ]
88-
} else {
89-
print("Unknown target_os: $target_os")
90-
assert(false)
91-
}
69+
if (target_os == "android") {
70+
defines += [ "TARGET_OS_ANDROID" ]
71+
} else if (target_os == "fuchsia") {
72+
defines += [ "TARGET_OS_FUCHSIA" ]
73+
} else if (target_os == "ios") {
74+
defines += [ "TARGET_OS_MACOS" ]
75+
defines += [ "TARGET_OS_MACOS_IOS" ]
76+
} else if (target_os == "linux") {
77+
defines += [ "TARGET_OS_LINUX" ]
78+
} else if (target_os == "mac") {
79+
defines += [ "TARGET_OS_MACOS" ]
80+
} else if (target_os == "win") {
81+
defines += [ "TARGET_OS_WINDOWS" ]
82+
} else {
83+
print("Unknown target_os: $target_os")
84+
assert(false)
9285
}
9386
}
9487

@@ -102,32 +95,26 @@ config("dart_os_fuchsia_config") {
10295
config("dart_arch_config") {
10396
defines = []
10497

105-
# If dart_host_toolchain is the current toolchain, and it is different from
106-
# host_toolchain, then we are building the SDK for the host, and should not
107-
# hardcode these defines.
108-
if (current_toolchain != dart_host_toolchain ||
109-
host_toolchain == dart_host_toolchain) {
110-
if (dart_target_arch == "arm") {
111-
defines += [ "TARGET_ARCH_ARM" ]
112-
} else if (dart_target_arch == "armv6") {
113-
defines += [ "TARGET_ARCH_ARM" ]
114-
defines += [ "TARGET_ARCH_ARM_6" ]
115-
} else if (dart_target_arch == "armv5te") {
116-
defines += [ "TARGET_ARCH_ARM" ]
117-
defines += [ "TARGET_ARCH_ARM_5TE" ]
118-
} else if (dart_target_arch == "arm64") {
119-
defines += [ "TARGET_ARCH_ARM64" ]
120-
} else if (dart_target_arch == "x64") {
121-
defines += [ "TARGET_ARCH_X64" ]
122-
} else if (dart_target_arch == "ia32" || dart_target_arch == "x86") {
123-
defines += [ "TARGET_ARCH_IA32" ]
124-
} else if (dart_target_arch == "dbc") {
125-
defines += [ "TARGET_ARCH_DBC" ]
126-
defines += [ "USING_SIMULATOR" ]
127-
} else {
128-
print("Invalid dart_target_arch: $dart_target_arch")
129-
assert(false)
130-
}
98+
if (dart_target_arch == "arm") {
99+
defines += [ "TARGET_ARCH_ARM" ]
100+
} else if (dart_target_arch == "armv6") {
101+
defines += [ "TARGET_ARCH_ARM" ]
102+
defines += [ "TARGET_ARCH_ARM_6" ]
103+
} else if (dart_target_arch == "armv5te") {
104+
defines += [ "TARGET_ARCH_ARM" ]
105+
defines += [ "TARGET_ARCH_ARM_5TE" ]
106+
} else if (dart_target_arch == "arm64") {
107+
defines += [ "TARGET_ARCH_ARM64" ]
108+
} else if (dart_target_arch == "x64") {
109+
defines += [ "TARGET_ARCH_X64" ]
110+
} else if (dart_target_arch == "ia32" || dart_target_arch == "x86") {
111+
defines += [ "TARGET_ARCH_IA32" ]
112+
} else if (dart_target_arch == "dbc") {
113+
defines += [ "TARGET_ARCH_DBC" ]
114+
defines += [ "USING_SIMULATOR" ]
115+
} else {
116+
print("Invalid dart_target_arch: $dart_target_arch")
117+
assert(false)
131118
}
132119
}
133120

utils/application_snapshot.gni

+4-5
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,10 @@ template("_application_snapshot") {
7878
# Build the kernel file using the prebuilt VM to speed up the debug and
7979
# simulator builds.
8080
prebuilt_dart_action(target_name + "_dill") {
81-
deps =
82-
extra_deps + [
83-
"$_dart_root/runtime/vm:kernel_platform_files($dart_host_toolchain)",
84-
"$_dart_root/runtime/vm:vm_platform",
85-
]
81+
deps = extra_deps + [
82+
"$_dart_root/runtime/vm:kernel_platform_files($host_toolchain)",
83+
"$_dart_root/runtime/vm:vm_platform",
84+
]
8685
gen_kernel_script = "$_dart_root/pkg/vm/bin/gen_kernel.dart"
8786
platform_dill = "$root_out_dir/vm_platform_strong.dill"
8887

utils/kernel-service/BUILD.gn

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
# BSD-style license that can be found in the LICENSE file.
44

55
import("../../build/dart/dart_action.gni")
6-
import("../../build/dart/dart_host_sdk_toolchain.gni")
76
import("../../runtime/runtime_args.gni")
87
import("../application_snapshot.gni")
98

@@ -50,7 +49,7 @@ copy("copy_kernel-service_snapshot") {
5049
application_snapshot("frontend_server") {
5150
main_dart = "../../pkg/vm/bin/frontend_server_starter.dart"
5251
deps = [
53-
"../../runtime/vm:kernel_platform_files($dart_host_toolchain)",
52+
"../../runtime/vm:kernel_platform_files($host_toolchain)",
5453
]
5554
sdk_root = rebase_path("$root_out_dir")
5655
training_args = [
@@ -65,7 +64,7 @@ application_snapshot("frontend_server") {
6564
template("kernel_service_dill") {
6665
prebuilt_dart_action("kernel_service" + target_name + "_dill") {
6766
deps = [
68-
"../../runtime/vm:kernel_platform_files($dart_host_toolchain)",
67+
"../../runtime/vm:kernel_platform_files($host_toolchain)",
6968
"../../runtime/vm:vm_platform",
7069
]
7170
kernel_service_script = "../../pkg/vm/bin/kernel_service.dart"

0 commit comments

Comments
 (0)