| OLD | NEW |
| 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import("//build/config/clang/clang.gni") | 5 import("//build/config/clang/clang.gni") |
| 6 import("//build/config/nacl/config.gni") | 6 import("//build/config/nacl/config.gni") |
| 7 import("//build/config/sanitizers/sanitizers.gni") | 7 import("//build/config/sanitizers/sanitizers.gni") |
| 8 import("//build/config/v8_target_cpu.gni") |
| 8 import("//build/toolchain/cc_wrapper.gni") | 9 import("//build/toolchain/cc_wrapper.gni") |
| 9 import("//build/toolchain/goma.gni") | 10 import("//build/toolchain/goma.gni") |
| 10 import("//build/toolchain/toolchain.gni") | 11 import("//build/toolchain/toolchain.gni") |
| 11 import("//build/toolchain/concurrent_links.gni") | 12 import("//build/toolchain/concurrent_links.gni") |
| 12 | 13 |
| 13 # This template defines a toolchain for something that works like gcc | 14 # This template defines a toolchain for something that works like gcc |
| 14 # (including clang). | 15 # (including clang). |
| 15 # | 16 # |
| 16 # It requires the following variables specifying the executables to run: | 17 # It requires the following variables specifying the executables to run: |
| 17 # - ar | 18 # - ar |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 # cc_wrapper = "" in it. | 93 # cc_wrapper = "" in it. |
| 93 # - use_debug_fission | 94 # - use_debug_fission |
| 94 # Override the global use_debug_fission setting, useful if the particular | 95 # Override the global use_debug_fission setting, useful if the particular |
| 95 # toolchain should not be generating split-dwarf code. | 96 # toolchain should not be generating split-dwarf code. |
| 96 # - use_goma | 97 # - use_goma |
| 97 # Override the global use_goma setting, useful to opt-out of goma in a | 98 # Override the global use_goma setting, useful to opt-out of goma in a |
| 98 # particular toolchain by setting use_gome = false in it. | 99 # particular toolchain by setting use_gome = false in it. |
| 99 # - use_gold | 100 # - use_gold |
| 100 # Override the global use_gold setting, useful if the particular | 101 # Override the global use_gold setting, useful if the particular |
| 101 # toolchain has a custom link step that is not actually using Gold. | 102 # toolchain has a custom link step that is not actually using Gold. |
| 103 # - v8_toolchain_cpu |
| 104 # If defined, set v8_current_cpu to this, else set v8_current_cpu |
| 105 # to current_cpu. |
| 102 template("gcc_toolchain") { | 106 template("gcc_toolchain") { |
| 103 toolchain(target_name) { | 107 toolchain(target_name) { |
| 104 assert(defined(invoker.ar), "gcc_toolchain() must specify a \"ar\" value") | 108 assert(defined(invoker.ar), "gcc_toolchain() must specify a \"ar\" value") |
| 105 assert(defined(invoker.cc), "gcc_toolchain() must specify a \"cc\" value") | 109 assert(defined(invoker.cc), "gcc_toolchain() must specify a \"cc\" value") |
| 106 assert(defined(invoker.cxx), "gcc_toolchain() must specify a \"cxx\" value") | 110 assert(defined(invoker.cxx), "gcc_toolchain() must specify a \"cxx\" value") |
| 107 assert(defined(invoker.ld), "gcc_toolchain() must specify a \"ld\" value") | 111 assert(defined(invoker.ld), "gcc_toolchain() must specify a \"ld\" value") |
| 108 assert(defined(invoker.toolchain_cpu), | 112 assert(defined(invoker.toolchain_cpu), |
| 109 "gcc_toolchain() must specify a \"toolchain_cpu\"") | 113 "gcc_toolchain() must specify a \"toolchain_cpu\"") |
| 110 assert(defined(invoker.toolchain_os), | 114 assert(defined(invoker.toolchain_os), |
| 111 "gcc_toolchain() must specify a \"toolchain_os\"") | 115 "gcc_toolchain() must specify a \"toolchain_os\"") |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 } | 462 } |
| 459 if (defined(invoker.use_debug_fission)) { | 463 if (defined(invoker.use_debug_fission)) { |
| 460 use_debug_fission = invoker.use_debug_fission | 464 use_debug_fission = invoker.use_debug_fission |
| 461 } | 465 } |
| 462 if (defined(invoker.use_gold)) { | 466 if (defined(invoker.use_gold)) { |
| 463 use_gold = invoker.use_gold | 467 use_gold = invoker.use_gold |
| 464 } | 468 } |
| 465 if (defined(invoker.use_sysroot)) { | 469 if (defined(invoker.use_sysroot)) { |
| 466 use_sysroot = invoker.use_sysroot | 470 use_sysroot = invoker.use_sysroot |
| 467 } | 471 } |
| 472 if (defined(invoker.v8_toolchain_cpu)) { |
| 473 v8_current_cpu = invoker.v8_toolchain_cpu |
| 474 } else { |
| 475 v8_current_cpu = current_cpu |
| 476 } |
| 477 |
| 478 # TODO(crbug.com/625353) - Delete after v8 has been updated |
| 479 # to only refer to v8_current_cpu. Until then, we need to make |
| 480 # sure that v8_current_cpu always has the same value as v8_target_cpu, |
| 481 # so that //build defines evaluate the way v8 is expecting them to. |
| 482 v8_current_cpu = v8_target_cpu |
| 468 | 483 |
| 469 # Disable sanitizers for non-default toolchains. | 484 # Disable sanitizers for non-default toolchains. |
| 470 is_asan = false | 485 is_asan = false |
| 471 is_cfi = false | 486 is_cfi = false |
| 472 is_lsan = false | 487 is_lsan = false |
| 473 is_msan = false | 488 is_msan = false |
| 474 is_syzyasan = false | 489 is_syzyasan = false |
| 475 is_tsan = false | 490 is_tsan = false |
| 476 is_ubsan = false | 491 is_ubsan = false |
| 477 is_ubsan_null = false | 492 is_ubsan_null = false |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 cxx = "$prefix/clang++" | 531 cxx = "$prefix/clang++" |
| 517 ld = cxx | 532 ld = cxx |
| 518 is_clang = true | 533 is_clang = true |
| 519 | 534 |
| 520 readelf = "${toolprefix}readelf" | 535 readelf = "${toolprefix}readelf" |
| 521 ar = "${toolprefix}ar" | 536 ar = "${toolprefix}ar" |
| 522 nm = "${toolprefix}nm" | 537 nm = "${toolprefix}nm" |
| 523 | 538 |
| 524 forward_variables_from(invoker, | 539 forward_variables_from(invoker, |
| 525 [ | 540 [ |
| 541 "strip", |
| 526 "toolchain_cpu", | 542 "toolchain_cpu", |
| 527 "toolchain_os", | 543 "toolchain_os", |
| 528 "use_gold", | 544 "use_gold", |
| 529 "strip", | 545 "v8_toolchain_cpu", |
| 530 ]) | 546 ]) |
| 531 | 547 |
| 532 if (defined(invoker.use_debug_fission)) { | 548 if (defined(invoker.use_debug_fission)) { |
| 533 use_debug_fission = invoker.use_debug_fission | 549 use_debug_fission = invoker.use_debug_fission |
| 534 } | 550 } |
| 535 } | 551 } |
| 536 } | 552 } |
| OLD | NEW |