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 182# In a LaCrOS build, this toolchain is intended to be used as an alternate 183# toolchain to build Ash-Chrome in a subdirectory. 184# This is a test-only toolchain. 185clang_toolchain("ash_clang_x64") { 186 toolchain_args = { 187 # This turns the toolchain into the "Linux ChromeOS" build 188 current_os = "chromeos" 189 target_os = "chromeos" 190 current_cpu = current_cpu 191 192 # This turns off all of the LaCrOS-specific flags. 193 also_build_ash_chrome = false 194 chromeos_is_browser_only = false 195 use_clang_coverage = false 196 197 # Never build ash with asan. It is too slow for builders and cause 198 # tests being flaky. 199 is_asan = false 200 is_lsan = false 201 } 202} 203 204# In an ash build, this toolchain is intended to be used as an alternate 205# toolchain to build lacros-Chrome in a subdirectory. 206# This is a test-only toolchain. 207clang_toolchain("lacros_clang_x64") { 208 toolchain_args = { 209 # This turns the toolchain into the "Lacros" build 210 current_os = "chromeos" 211 target_os = "chromeos" 212 current_cpu = current_cpu 213 214 # This turns on the LaCrOS-specific flag. 215 also_build_lacros_chrome = false 216 chromeos_is_browser_only = true 217 use_clang_coverage = false 218 } 219} 220 221gcc_toolchain("x64") { 222 cc = "gcc" 223 cxx = "g++" 224 225 readelf = "readelf" 226 nm = "nm" 227 ar = "ar" 228 ld = cxx 229 230 # Output linker map files for binary size analysis. 231 enable_linker_map = true 232 233 toolchain_args = { 234 current_cpu = "x64" 235 current_os = "linux" 236 237 # remote execution does not support gcc. 238 use_remoteexec = false 239 is_clang = false 240 } 241} 242 243clang_toolchain("clang_mipsel") { 244 toolchain_args = { 245 current_cpu = "mipsel" 246 current_os = "linux" 247 } 248} 249 250clang_toolchain("clang_mips64el") { 251 toolchain_args = { 252 current_cpu = "mips64el" 253 current_os = "linux" 254 } 255} 256 257gcc_toolchain("mipsel") { 258 toolprefix = "mipsel-linux-gnu-" 259 260 cc = "${toolprefix}gcc" 261 cxx = " ${toolprefix}g++" 262 ar = "${toolprefix}ar" 263 ld = cxx 264 readelf = "${toolprefix}readelf" 265 nm = "${toolprefix}nm" 266 267 toolchain_args = { 268 cc_wrapper = "" 269 current_cpu = "mipsel" 270 current_os = "linux" 271 272 # remote execution does not support gcc. 273 use_remoteexec = false 274 is_clang = false 275 } 276} 277 278gcc_toolchain("mips64el") { 279 toolprefix = "mips64el-linux-gnuabi64-" 280 281 cc = "${toolprefix}gcc" 282 cxx = "${toolprefix}g++" 283 ar = "${toolprefix}ar" 284 ld = cxx 285 readelf = "${toolprefix}readelf" 286 nm = "${toolprefix}nm" 287 288 toolchain_args = { 289 cc_wrapper = "" 290 current_cpu = "mips64el" 291 current_os = "linux" 292 293 # remote execution does not support gcc. 294 use_remoteexec = false 295 is_clang = false 296 } 297} 298 299clang_toolchain("clang_riscv64") { 300 enable_linker_map = true 301 toolchain_args = { 302 current_cpu = "riscv64" 303 current_os = "linux" 304 is_clang = true 305 } 306} 307 308gcc_toolchain("riscv64") { 309 toolprefix = "riscv64-linux-gnu" 310 311 cc = "${toolprefix}-gcc" 312 cxx = "${toolprefix}-g++" 313 314 readelf = "${toolprefix}-readelf" 315 nm = "${toolprefix}-nm" 316 ar = "${toolprefix}-ar" 317 ld = cxx 318 319 toolchain_args = { 320 current_cpu = "riscv64" 321 current_os = "linux" 322 is_clang = false 323 } 324} 325 326clang_toolchain("clang_s390x") { 327 toolchain_args = { 328 current_cpu = "s390x" 329 current_os = "linux" 330 is_clang = true 331 } 332} 333 334gcc_toolchain("s390x") { 335 cc = "gcc" 336 cxx = "g++" 337 338 readelf = "readelf" 339 nm = "nm" 340 ar = "ar" 341 ld = cxx 342 343 toolchain_args = { 344 current_cpu = "s390x" 345 current_os = "linux" 346 347 # remote execution does not support gcc. 348 use_remoteexec = false 349 is_clang = false 350 } 351} 352 353gcc_toolchain("ppc64") { 354 cc = "gcc" 355 cxx = "g++" 356 357 readelf = "readelf" 358 nm = "nm" 359 ar = "ar" 360 ld = cxx 361 362 toolchain_args = { 363 current_cpu = "ppc64" 364 current_os = "linux" 365 366 # remote execution does not support gcc. 367 use_remoteexec = false 368 is_clang = false 369 } 370} 371 372gcc_toolchain("mips") { 373 toolprefix = "mips-linux-gnu-" 374 375 cc = "${toolprefix}gcc" 376 cxx = "${toolprefix}g++" 377 378 readelf = "${toolprefix}readelf" 379 nm = "${toolprefix}nm" 380 ar = "${toolprefix}ar" 381 ld = cxx 382 383 toolchain_args = { 384 current_cpu = "mips" 385 current_os = "linux" 386 387 # remote execution does not support gcc. 388 use_remoteexec = false 389 is_clang = false 390 } 391} 392 393gcc_toolchain("mips64") { 394 toolprefix = "mips64-linux-gnuabi64-" 395 396 cc = "${toolprefix}gcc" 397 cxx = "${toolprefix}g++" 398 399 readelf = "${toolprefix}readelf" 400 nm = "${toolprefix}nm" 401 ar = "${toolprefix}ar" 402 ld = cxx 403 404 toolchain_args = { 405 current_cpu = "mips64" 406 current_os = "linux" 407 408 # remote execution does not support gcc. 409 use_remoteexec = false 410 is_clang = false 411 } 412} 413 414clang_toolchain("clang_loong64") { 415 toolchain_args = { 416 current_cpu = "loong64" 417 current_os = "linux" 418 } 419} 420 421gcc_toolchain("loong64") { 422 toolprefix = "loongarch64-unknown-linux-gnu" 423 424 cc = "${toolprefix}-gcc" 425 cxx = "${toolprefix}-g++" 426 427 readelf = "${toolprefix}-readelf" 428 nm = "${toolprefix}-nm" 429 ar = "${toolprefix}-ar" 430 ld = cxx 431 432 toolchain_args = { 433 current_cpu = "loong64" 434 current_os = "linux" 435 is_clang = false 436 } 437} 438