4
4
5
5
import (" //build/toolchain/clang.gni" )
6
6
import (" //build/toolchain/goma.gni" )
7
+ import (" //build/toolchain/rbe.gni" )
7
8
import (" //build/toolchain/toolchain.gni" )
8
9
9
10
if (use_goma ) {
10
- goma_prefix = " $goma_dir /gomacc "
11
+ assert (! use_rbe , " Goma and RBE can't be used together." )
12
+ compiler_prefix = " $goma_dir /gomacc "
13
+ link_prefix = " $goma_dir /gomacc "
14
+ } else if (use_rbe ) {
15
+ compiler_args =
16
+ rewrapper_command + [ " --labels=type=compile,compiler=clang,lang=cpp " ]
17
+ compiler_prefix = string_join (" " , compiler_args )
18
+ link_prefix = " "
11
19
} else {
12
- goma_prefix = " "
20
+ compiler_prefix = " "
21
+ link_prefix = " "
13
22
}
14
23
15
24
toolchain (" fuchsia" ) {
@@ -49,7 +58,7 @@ toolchain("fuchsia") {
49
58
50
59
tool (" cc" ) {
51
60
depfile = " {{output}}.d"
52
- command = " $goma_prefix $cc -MD -MF $depfile $target_triple_flags $sysroot_flags $lto_flags {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} -c {{source}} -o {{output}}"
61
+ command = " $compiler_prefix $cc -MD -MF $depfile $target_triple_flags $sysroot_flags $lto_flags {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} -c {{source}} -o {{output}}"
53
62
depsformat = " gcc"
54
63
description = " CC {{output}}"
55
64
outputs =
@@ -58,7 +67,7 @@ toolchain("fuchsia") {
58
67
59
68
tool (" cxx" ) {
60
69
depfile = " {{output}}.d"
61
- command = " $goma_prefix $cxx -MD -MF $depfile $target_triple_flags $sysroot_flags $lto_flags {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} -c {{source}} -o {{output}}"
70
+ command = " $compiler_prefix $cxx -MD -MF $depfile $target_triple_flags $sysroot_flags $lto_flags {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} -c {{source}} -o {{output}}"
62
71
depsformat = " gcc"
63
72
description = " CXX {{output}}"
64
73
outputs =
@@ -67,7 +76,7 @@ toolchain("fuchsia") {
67
76
68
77
tool (" asm" ) {
69
78
depfile = " {{output}}.d"
70
- command = " $goma_prefix $ cc -MD -MF $depfile $target_triple_flags $sysroot_flags $lto_flags {{defines}} {{include_dirs}} {{asmflags}} {{cflags}} {{cflags_c}} -c {{source}} -o {{output}}"
79
+ command = " $cc -MD -MF $depfile $target_triple_flags $sysroot_flags $lto_flags {{defines}} {{include_dirs}} {{asmflags}} {{cflags}} {{cflags_c}} -c {{source}} -o {{output}}"
71
80
depsformat = " gcc"
72
81
description = " ASM {{output}}"
73
82
outputs =
@@ -99,7 +108,7 @@ toolchain("fuchsia") {
99
108
# existing .TOC file, overwrite it, otherwise, don't change it.
100
109
tocfile = sofile + " .TOC"
101
110
temporary_tocname = sofile + " .tmp"
102
- link_command = " $goma_prefix $ld $target_triple_flags $sysroot_flags $lto_flags -shared {{ldflags}} -o $unstripped_sofile -Wl,--build-id=sha1 -Wl,-soname=$soname @$rspfile "
111
+ link_command = " $link_prefix $ld $target_triple_flags $sysroot_flags $lto_flags -shared {{ldflags}} -o $unstripped_sofile -Wl,--build-id=sha1 -Wl,-soname=$soname @$rspfile "
103
112
toc_command = " { $readelf -d $unstripped_sofile | grep SONAME ; $nm -gD -f p $unstripped_sofile | cut -f1-2 -d' '; } > $temporary_tocname "
104
113
replace_command = " if ! cmp -s $temporary_tocname $tocfile ; then mv $temporary_tocname $tocfile ; fi"
105
114
strip_command = " $strip -o $sofile $unstripped_sofile "
@@ -136,7 +145,7 @@ toolchain("fuchsia") {
136
145
outfile = " {{root_out_dir}}/$exename "
137
146
rspfile = " $outfile .rsp"
138
147
unstripped_outfile = " {{root_out_dir}}/exe.unstripped/$exename "
139
- command = " $goma_prefix $ld $target_triple_flags $sysroot_flags $lto_flags {{ldflags}} -o $unstripped_outfile -Wl,--build-id=sha1 -Wl,--start-group @$rspfile {{solibs}} -Wl,--end-group {{libs}} && ${ strip } -o $outfile $unstripped_outfile "
148
+ command = " $link_prefix $ld $target_triple_flags $sysroot_flags $lto_flags {{ldflags}} -o $unstripped_outfile -Wl,--build-id=sha1 -Wl,--start-group @$rspfile {{solibs}} -Wl,--end-group {{libs}} && ${ strip } -o $outfile $unstripped_outfile "
140
149
description = " LINK $outfile "
141
150
rspfile_content = " {{inputs}}"
142
151
outputs = [
0 commit comments