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 # reclient 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 # reclient 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 # reclient 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 # reclient 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 # reclient does not support gcc. 273 use_remoteexec = false 274 is_clang = false 275 use_goma = false 276 } 277} 278 279gcc_toolchain("mips64el") { 280 toolprefix = "mips64el-linux-gnuabi64-" 281 282 cc = "${toolprefix}gcc" 283 cxx = "${toolprefix}g++" 284 ar = "${toolprefix}ar" 285 ld = cxx 286 readelf = "${toolprefix}readelf" 287 nm = "${toolprefix}nm" 288 289 toolchain_args = { 290 cc_wrapper = "" 291 current_cpu = "mips64el" 292 current_os = "linux" 293 294 # reclient does not support gcc. 295 use_remoteexec = false 296 is_clang = false 297 use_goma = false 298 } 299} 300 301clang_toolchain("clang_riscv64") { 302 enable_linker_map = true 303 toolchain_args = { 304 current_cpu = "riscv64" 305 current_os = "linux" 306 is_clang = true 307 } 308} 309 310gcc_toolchain("riscv64") { 311 toolprefix = "riscv64-linux-gnu" 312 313 cc = "${toolprefix}-gcc" 314 cxx = "${toolprefix}-g++" 315 316 readelf = "${toolprefix}-readelf" 317 nm = "${toolprefix}-nm" 318 ar = "${toolprefix}-ar" 319 ld = cxx 320 321 toolchain_args = { 322 current_cpu = "riscv64" 323 current_os = "linux" 324 is_clang = false 325 } 326} 327 328clang_toolchain("clang_s390x") { 329 toolchain_args = { 330 current_cpu = "s390x" 331 current_os = "linux" 332 is_clang = true 333 } 334} 335 336gcc_toolchain("s390x") { 337 cc = "gcc" 338 cxx = "g++" 339 340 readelf = "readelf" 341 nm = "nm" 342 ar = "ar" 343 ld = cxx 344 345 toolchain_args = { 346 current_cpu = "s390x" 347 current_os = "linux" 348 349 # reclient does not support gcc. 350 use_remoteexec = false 351 is_clang = false 352 } 353} 354 355gcc_toolchain("ppc64") { 356 cc = "gcc" 357 cxx = "g++" 358 359 readelf = "readelf" 360 nm = "nm" 361 ar = "ar" 362 ld = cxx 363 364 toolchain_args = { 365 current_cpu = "ppc64" 366 current_os = "linux" 367 368 # reclient does not support gcc. 369 use_remoteexec = false 370 is_clang = false 371 } 372} 373 374gcc_toolchain("mips") { 375 toolprefix = "mips-linux-gnu-" 376 377 cc = "${toolprefix}gcc" 378 cxx = "${toolprefix}g++" 379 380 readelf = "${toolprefix}readelf" 381 nm = "${toolprefix}nm" 382 ar = "${toolprefix}ar" 383 ld = cxx 384 385 toolchain_args = { 386 current_cpu = "mips" 387 current_os = "linux" 388 389 # reclient does not support gcc. 390 use_remoteexec = false 391 is_clang = false 392 } 393} 394 395gcc_toolchain("mips64") { 396 toolprefix = "mips64-linux-gnuabi64-" 397 398 cc = "${toolprefix}gcc" 399 cxx = "${toolprefix}g++" 400 401 readelf = "${toolprefix}readelf" 402 nm = "${toolprefix}nm" 403 ar = "${toolprefix}ar" 404 ld = cxx 405 406 toolchain_args = { 407 current_cpu = "mips64" 408 current_os = "linux" 409 410 # reclient does not support gcc. 411 use_remoteexec = false 412 is_clang = false 413 } 414} 415 416clang_toolchain("clang_loong64") { 417 toolchain_args = { 418 current_cpu = "loong64" 419 current_os = "linux" 420 } 421} 422 423gcc_toolchain("loong64") { 424 toolprefix = "loongarch64-unknown-linux-gnu" 425 426 cc = "${toolprefix}-gcc" 427 cxx = "${toolprefix}-g++" 428 429 readelf = "${toolprefix}-readelf" 430 nm = "${toolprefix}-nm" 431 ar = "${toolprefix}-ar" 432 ld = cxx 433 434 toolchain_args = { 435 current_cpu = "loong64" 436 current_os = "linux" 437 is_clang = false 438 } 439} 440