1# Copyright 2013 The Chromium Authors 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5import("//build/config/dcheck_always_on.gni") 6import("//build/config/ozone.gni") 7import("//build/config/sysroot.gni") 8import("//build/config/ui.gni") 9import("//build/toolchain/gcc_toolchain.gni") 10 11clang_toolchain("clang_ppc64") { 12 enable_linker_map = true 13 toolchain_args = { 14 current_cpu = "ppc64" 15 current_os = "linux" 16 } 17} 18 19clang_toolchain("clang_arm") { 20 toolchain_args = { 21 current_cpu = "arm" 22 current_os = "linux" 23 } 24} 25 26clang_toolchain("clang_arm64") { 27 toolchain_args = { 28 current_cpu = "arm64" 29 current_os = "linux" 30 } 31} 32 33gcc_toolchain("arm64") { 34 toolprefix = "aarch64-linux-gnu-" 35 36 cc = "${toolprefix}gcc" 37 cxx = "${toolprefix}g++" 38 39 ar = "${toolprefix}ar" 40 ld = cxx 41 readelf = "${toolprefix}readelf" 42 nm = "${toolprefix}nm" 43 44 toolchain_args = { 45 current_cpu = "arm64" 46 current_os = "linux" 47 48 # remote execution does not support gcc. 49 use_remoteexec = false 50 is_clang = false 51 } 52} 53 54gcc_toolchain("arm") { 55 toolprefix = "arm-linux-gnueabihf-" 56 57 cc = "${toolprefix}gcc" 58 cxx = "${toolprefix}g++" 59 60 ar = "${toolprefix}ar" 61 ld = cxx 62 readelf = "${toolprefix}readelf" 63 nm = "${toolprefix}nm" 64 65 toolchain_args = { 66 current_cpu = "arm" 67 current_os = "linux" 68 69 # remote execution does not support gcc. 70 use_remoteexec = false 71 is_clang = false 72 } 73} 74 75clang_toolchain("clang_x86") { 76 # Output linker map files for binary size analysis. 77 enable_linker_map = true 78 79 toolchain_args = { 80 current_cpu = "x86" 81 current_os = "linux" 82 } 83} 84 85gcc_toolchain("x86") { 86 cc = "gcc" 87 cxx = "g++" 88 89 readelf = "readelf" 90 nm = "nm" 91 ar = "ar" 92 ld = cxx 93 94 # Output linker map files for binary size analysis. 95 enable_linker_map = true 96 97 toolchain_args = { 98 current_cpu = "x86" 99 current_os = "linux" 100 101 # remote execution does not support gcc. 102 use_remoteexec = false 103 is_clang = false 104 } 105} 106 107clang_toolchain("clang_x64") { 108 # Output linker map files for binary size analysis. 109 enable_linker_map = true 110 111 toolchain_args = { 112 current_cpu = "x64" 113 current_os = "linux" 114 } 115} 116 117template("clang_v8_toolchain") { 118 clang_toolchain(target_name) { 119 toolchain_args = { 120 current_os = "linux" 121 forward_variables_from(invoker.toolchain_args, "*") 122 } 123 } 124} 125 126clang_v8_toolchain("clang_x86_v8_arm") { 127 toolchain_args = { 128 current_cpu = "x86" 129 v8_current_cpu = "arm" 130 } 131} 132 133clang_v8_toolchain("clang_x86_v8_mipsel") { 134 toolchain_args = { 135 current_cpu = "x86" 136 v8_current_cpu = "mipsel" 137 } 138} 139 140clang_v8_toolchain("clang_x86_v8_mips") { 141 toolchain_args = { 142 current_cpu = "x86" 143 v8_current_cpu = "mips" 144 } 145} 146 147clang_v8_toolchain("clang_x64_v8_arm64") { 148 toolchain_args = { 149 current_cpu = "x64" 150 v8_current_cpu = "arm64" 151 } 152} 153 154clang_v8_toolchain("clang_x64_v8_mips64el") { 155 toolchain_args = { 156 current_cpu = "x64" 157 v8_current_cpu = "mips64el" 158 } 159} 160 161clang_v8_toolchain("clang_x64_v8_mips64") { 162 toolchain_args = { 163 current_cpu = "x64" 164 v8_current_cpu = "mips64" 165 } 166} 167 168clang_v8_toolchain("clang_x64_v8_riscv64") { 169 toolchain_args = { 170 current_cpu = "x64" 171 v8_current_cpu = "riscv64" 172 } 173} 174 175clang_v8_toolchain("clang_x64_v8_loong64") { 176 toolchain_args = { 177 current_cpu = "x64" 178 v8_current_cpu = "loong64" 179 } 180} 181 182gcc_toolchain("x64") { 183 cc = "gcc" 184 cxx = "g++" 185 186 readelf = "readelf" 187 nm = "nm" 188 ar = "ar" 189 ld = cxx 190 191 # Output linker map files for binary size analysis. 192 enable_linker_map = true 193 194 toolchain_args = { 195 current_cpu = "x64" 196 current_os = "linux" 197 198 # remote execution does not support gcc. 199 use_remoteexec = false 200 is_clang = false 201 } 202} 203 204clang_toolchain("clang_mipsel") { 205 toolchain_args = { 206 current_cpu = "mipsel" 207 current_os = "linux" 208 } 209} 210 211clang_toolchain("clang_mips64el") { 212 toolchain_args = { 213 current_cpu = "mips64el" 214 current_os = "linux" 215 } 216} 217 218gcc_toolchain("mipsel") { 219 toolprefix = "mipsel-linux-gnu-" 220 221 cc = "${toolprefix}gcc" 222 cxx = " ${toolprefix}g++" 223 ar = "${toolprefix}ar" 224 ld = cxx 225 readelf = "${toolprefix}readelf" 226 nm = "${toolprefix}nm" 227 228 toolchain_args = { 229 cc_wrapper = "" 230 current_cpu = "mipsel" 231 current_os = "linux" 232 233 # remote execution does not support gcc. 234 use_remoteexec = false 235 is_clang = false 236 } 237} 238 239gcc_toolchain("mips64el") { 240 toolprefix = "mips64el-linux-gnuabi64-" 241 242 cc = "${toolprefix}gcc" 243 cxx = "${toolprefix}g++" 244 ar = "${toolprefix}ar" 245 ld = cxx 246 readelf = "${toolprefix}readelf" 247 nm = "${toolprefix}nm" 248 249 toolchain_args = { 250 cc_wrapper = "" 251 current_cpu = "mips64el" 252 current_os = "linux" 253 254 # remote execution does not support gcc. 255 use_remoteexec = false 256 is_clang = false 257 } 258} 259 260clang_toolchain("clang_riscv64") { 261 enable_linker_map = true 262 toolchain_args = { 263 current_cpu = "riscv64" 264 current_os = "linux" 265 is_clang = true 266 } 267} 268 269gcc_toolchain("riscv64") { 270 toolprefix = "riscv64-linux-gnu" 271 272 cc = "${toolprefix}-gcc" 273 cxx = "${toolprefix}-g++" 274 275 readelf = "${toolprefix}-readelf" 276 nm = "${toolprefix}-nm" 277 ar = "${toolprefix}-ar" 278 ld = cxx 279 280 toolchain_args = { 281 current_cpu = "riscv64" 282 current_os = "linux" 283 is_clang = false 284 } 285} 286 287clang_toolchain("clang_s390x") { 288 toolchain_args = { 289 current_cpu = "s390x" 290 current_os = "linux" 291 is_clang = true 292 } 293} 294 295gcc_toolchain("s390x") { 296 cc = "gcc" 297 cxx = "g++" 298 299 readelf = "readelf" 300 nm = "nm" 301 ar = "ar" 302 ld = cxx 303 304 toolchain_args = { 305 current_cpu = "s390x" 306 current_os = "linux" 307 308 # remote execution does not support gcc. 309 use_remoteexec = false 310 is_clang = false 311 } 312} 313 314gcc_toolchain("ppc64") { 315 cc = "gcc" 316 cxx = "g++" 317 318 readelf = "readelf" 319 nm = "nm" 320 ar = "ar" 321 ld = cxx 322 323 toolchain_args = { 324 current_cpu = "ppc64" 325 current_os = "linux" 326 327 # remote execution does not support gcc. 328 use_remoteexec = false 329 is_clang = false 330 } 331} 332 333gcc_toolchain("mips") { 334 toolprefix = "mips-linux-gnu-" 335 336 cc = "${toolprefix}gcc" 337 cxx = "${toolprefix}g++" 338 339 readelf = "${toolprefix}readelf" 340 nm = "${toolprefix}nm" 341 ar = "${toolprefix}ar" 342 ld = cxx 343 344 toolchain_args = { 345 current_cpu = "mips" 346 current_os = "linux" 347 348 # remote execution does not support gcc. 349 use_remoteexec = false 350 is_clang = false 351 } 352} 353 354gcc_toolchain("mips64") { 355 toolprefix = "mips64-linux-gnuabi64-" 356 357 cc = "${toolprefix}gcc" 358 cxx = "${toolprefix}g++" 359 360 readelf = "${toolprefix}readelf" 361 nm = "${toolprefix}nm" 362 ar = "${toolprefix}ar" 363 ld = cxx 364 365 toolchain_args = { 366 current_cpu = "mips64" 367 current_os = "linux" 368 369 # remote execution does not support gcc. 370 use_remoteexec = false 371 is_clang = false 372 } 373} 374 375clang_toolchain("clang_loong64") { 376 toolchain_args = { 377 current_cpu = "loong64" 378 current_os = "linux" 379 } 380} 381 382gcc_toolchain("loong64") { 383 toolprefix = "loongarch64-unknown-linux-gnu" 384 385 cc = "${toolprefix}-gcc" 386 cxx = "${toolprefix}-g++" 387 388 readelf = "${toolprefix}-readelf" 389 nm = "${toolprefix}-nm" 390 ar = "${toolprefix}-ar" 391 ld = cxx 392 393 toolchain_args = { 394 current_cpu = "loong64" 395 current_os = "linux" 396 is_clang = false 397 } 398} 399