| 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/nacl/config.gni") | 5 import("//build/config/nacl/config.gni") |
| 6 import("//build/config/sanitizers/sanitizers.gni") | 6 import("//build/config/sanitizers/sanitizers.gni") |
| 7 import("//build/toolchain/cc_wrapper.gni") | 7 import("//build/toolchain/cc_wrapper.gni") |
| 8 import("//build/toolchain/goma.gni") | 8 import("//build/toolchain/goma.gni") |
| 9 import("//build/toolchain/toolchain.gni") | 9 import("//build/toolchain/toolchain.gni") |
| 10 | 10 |
| 11 # "concurrent_links" is a toolchain variable. By computing it here rather than | |
| 12 # inside the toolchain, the exec_script will only get run once rather than | |
| 13 # each time the toolchain template is invoked. | |
| 14 if (allow_posix_link_time_opt || is_cfi) { | |
| 15 concurrent_links_ = | |
| 16 exec_script("get_concurrent_links.py", [ "--lto" ], "value") | |
| 17 } else { | |
| 18 concurrent_links_ = exec_script("get_concurrent_links.py", [], "value") | |
| 19 } | |
| 20 | |
| 21 # This template defines a toolchain for something that works like gcc | 11 # This template defines a toolchain for something that works like gcc |
| 22 # (including clang). | 12 # (including clang). |
| 23 # | 13 # |
| 24 # It requires the following variables specifying the executables to run: | 14 # It requires the following variables specifying the executables to run: |
| 25 # - ar | 15 # - ar |
| 26 # - cc | 16 # - cc |
| 27 # - cxx | 17 # - cxx |
| 28 # - ld | 18 # - ld |
| 29 # and the following which is used in the toolchain_args | 19 # and the following which is used in the toolchain_args |
| 30 # - toolchain_cpu (What "current_cpu" should be set to when invoking a | 20 # - toolchain_cpu (What "current_cpu" should be set to when invoking a |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 toolchain(target_name) { | 101 toolchain(target_name) { |
| 112 assert(defined(invoker.ar), "gcc_toolchain() must specify a \"ar\" value") | 102 assert(defined(invoker.ar), "gcc_toolchain() must specify a \"ar\" value") |
| 113 assert(defined(invoker.cc), "gcc_toolchain() must specify a \"cc\" value") | 103 assert(defined(invoker.cc), "gcc_toolchain() must specify a \"cc\" value") |
| 114 assert(defined(invoker.cxx), "gcc_toolchain() must specify a \"cxx\" value") | 104 assert(defined(invoker.cxx), "gcc_toolchain() must specify a \"cxx\" value") |
| 115 assert(defined(invoker.ld), "gcc_toolchain() must specify a \"ld\" value") | 105 assert(defined(invoker.ld), "gcc_toolchain() must specify a \"ld\" value") |
| 116 assert(defined(invoker.toolchain_cpu), | 106 assert(defined(invoker.toolchain_cpu), |
| 117 "gcc_toolchain() must specify a \"toolchain_cpu\"") | 107 "gcc_toolchain() must specify a \"toolchain_cpu\"") |
| 118 assert(defined(invoker.toolchain_os), | 108 assert(defined(invoker.toolchain_os), |
| 119 "gcc_toolchain() must specify a \"toolchain_os\"") | 109 "gcc_toolchain() must specify a \"toolchain_os\"") |
| 120 | 110 |
| 121 concurrent_links = concurrent_links_ | |
| 122 | |
| 123 if (defined(invoker.cc_wrapper)) { | 111 if (defined(invoker.cc_wrapper)) { |
| 124 cc_wrapper = invoker.cc_wrapper | 112 cc_wrapper = invoker.cc_wrapper |
| 125 } | 113 } |
| 126 if (defined(invoker.use_goma)) { | 114 if (defined(invoker.use_goma)) { |
| 127 use_goma = invoker.use_goma | 115 use_goma = invoker.use_goma |
| 128 } | 116 } |
| 129 if (use_goma) { | 117 if (use_goma) { |
| 130 assert(cc_wrapper == "", "Goma and cc_wrapper can't be used together.") | 118 assert(cc_wrapper == "", "Goma and cc_wrapper can't be used together.") |
| 131 compiler_prefix = "$goma_dir/gomacc " | 119 compiler_prefix = "$goma_dir/gomacc " |
| 132 } else if (cc_wrapper != "") { | 120 } else if (cc_wrapper != "") { |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 "toolchain_os", | 514 "toolchain_os", |
| 527 "use_gold", | 515 "use_gold", |
| 528 "strip", | 516 "strip", |
| 529 ]) | 517 ]) |
| 530 | 518 |
| 531 if (defined(invoker.use_debug_fission)) { | 519 if (defined(invoker.use_debug_fission)) { |
| 532 use_debug_fission = invoker.use_debug_fission | 520 use_debug_fission = invoker.use_debug_fission |
| 533 } | 521 } |
| 534 } | 522 } |
| 535 } | 523 } |
| OLD | NEW |