Skip to content

Commit 31c2de7

Browse files
rmacnak-googleCommit Queue
authored andcommitted
[build] Setup RBE for the Fuchsia toolchain.
Change-Id: I4d4860cfb0ac28fb30d44681659505d5dd73f9ea Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/398943 Reviewed-by: Alexander Aprelev <[email protected]> Commit-Queue: Ryan Macnak <[email protected]>
1 parent f34a2ed commit 31c2de7

File tree

1 file changed

+31
-10
lines changed

1 file changed

+31
-10
lines changed

build/toolchain/fuchsia/fuchsia_toolchain.gni

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,39 @@ import("//build/toolchain/ccache.gni")
77
import("//build/toolchain/gcc_toolchain.gni")
88
import("//build/toolchain/rbe.gni")
99

10-
if (use_ccache) {
11-
assembler_prefix = "ccache "
12-
compiler_prefix = "ccache "
13-
link_prefix = "ccache "
14-
} else {
15-
assembler_prefix = ""
16-
compiler_prefix = ""
17-
link_prefix = ""
18-
}
19-
2010
template("fuchsia_toolchain") {
2111
toolchain(target_name) {
12+
if (use_rbe) {
13+
compiler_args =
14+
rewrapper_args + [ "--labels=type=compile,compiler=clang,lang=cpp" ]
15+
if (target_cpu == "x64") {
16+
target_triple = "x86_64-unknown-fuchsia"
17+
} else if (target_cpu == "arm64") {
18+
target_triple = "aarch64-unknown-fuchsia"
19+
} else if (target_cpu == "riscv64") {
20+
target_triple = "riscv64-unknown-fuchsia"
21+
} else {
22+
assert(false, "Unsupported target_cpu: $target_cpu")
23+
}
24+
compiler_args += [ "--inputs=build/rbe,buildtools/$rbe_os-$rbe_cpu/clang/bin/llvm,buildtools/$rbe_os-$rbe_cpu/clang/include/$target_triple/c++/v1/__config_site" ]
25+
26+
# TODO: Unfortunately I see no way to get build_arch reliably.
27+
if (rbe_os != host_os) {
28+
compiler_args += [ "--remote_wrapper=../../build/rbe/llvm.sh" ]
29+
}
30+
assembler_prefix = ""
31+
compiler_prefix = string_join(" ", compiler_args) + " "
32+
link_prefix = ""
33+
} else if (use_ccache) {
34+
assembler_prefix = "ccache "
35+
compiler_prefix = "ccache "
36+
link_prefix = "ccache "
37+
} else {
38+
assembler_prefix = ""
39+
compiler_prefix = ""
40+
link_prefix = ""
41+
}
42+
2243
toolchain_bin =
2344
rebase_path("//buildtools/$host_os-x64/clang/bin", root_out_dir)
2445
fuchsia_sdk =

0 commit comments

Comments
 (0)