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 import("//build/toolchain/concurrent_links.gni") |
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 | 11 |
21 # This template defines a toolchain for something that works like gcc | 12 # This template defines a toolchain for something that works like gcc |
22 # (including clang). | 13 # (including clang). |
23 # | 14 # |
24 # It requires the following variables specifying the executables to run: | 15 # It requires the following variables specifying the executables to run: |
25 # - ar | 16 # - ar |
26 # - cc | 17 # - cc |
27 # - cxx | 18 # - cxx |
28 # - ld | 19 # - ld |
29 # and the following which is used in the toolchain_args | 20 # and the following which is used in the toolchain_args |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
100 # cc_wrapper = "" in it. | 91 # cc_wrapper = "" in it. |
101 # - use_debug_fission | 92 # - use_debug_fission |
102 # Override the global use_debug_fission setting, useful if the particular | 93 # Override the global use_debug_fission setting, useful if the particular |
103 # toolchain should not be generating split-dwarf code. | 94 # toolchain should not be generating split-dwarf code. |
104 # - use_goma | 95 # - use_goma |
105 # Override the global use_goma setting, useful to opt-out of goma in a | 96 # Override the global use_goma setting, useful to opt-out of goma in a |
106 # particular toolchain by setting use_gome = false in it. | 97 # particular toolchain by setting use_gome = false in it. |
107 # - use_gold | 98 # - use_gold |
108 # Override the global use_gold setting, useful if the particular | 99 # Override the global use_gold setting, useful if the particular |
109 # toolchain has a custom link step that is not actually using Gold. | 100 # toolchain has a custom link step that is not actually using Gold. |
110 template("gcc_toolchain") { | 101 template("gcc_toolchain") { |
brettw
2016/06/06 17:33:38
Can you add a comment in here that "concurrent_lin
Dirk Pranke
2016/06/06 22:16:12
Yeah, I waffled on whether to add that to all of t
| |
111 toolchain(target_name) { | 102 toolchain(target_name) { |
112 assert(defined(invoker.ar), "gcc_toolchain() must specify a \"ar\" value") | 103 assert(defined(invoker.ar), "gcc_toolchain() must specify a \"ar\" value") |
113 assert(defined(invoker.cc), "gcc_toolchain() must specify a \"cc\" value") | 104 assert(defined(invoker.cc), "gcc_toolchain() must specify a \"cc\" value") |
114 assert(defined(invoker.cxx), "gcc_toolchain() must specify a \"cxx\" value") | 105 assert(defined(invoker.cxx), "gcc_toolchain() must specify a \"cxx\" value") |
115 assert(defined(invoker.ld), "gcc_toolchain() must specify a \"ld\" value") | 106 assert(defined(invoker.ld), "gcc_toolchain() must specify a \"ld\" value") |
116 assert(defined(invoker.toolchain_cpu), | 107 assert(defined(invoker.toolchain_cpu), |
117 "gcc_toolchain() must specify a \"toolchain_cpu\"") | 108 "gcc_toolchain() must specify a \"toolchain_cpu\"") |
118 assert(defined(invoker.toolchain_os), | 109 assert(defined(invoker.toolchain_os), |
119 "gcc_toolchain() must specify a \"toolchain_os\"") | 110 "gcc_toolchain() must specify a \"toolchain_os\"") |
120 | 111 |
121 concurrent_links = concurrent_links_ | |
122 | |
123 if (defined(invoker.cc_wrapper)) { | 112 if (defined(invoker.cc_wrapper)) { |
124 cc_wrapper = invoker.cc_wrapper | 113 cc_wrapper = invoker.cc_wrapper |
125 } | 114 } |
126 if (defined(invoker.use_goma)) { | 115 if (defined(invoker.use_goma)) { |
127 use_goma = invoker.use_goma | 116 use_goma = invoker.use_goma |
128 } | 117 } |
129 if (use_goma) { | 118 if (use_goma) { |
130 assert(cc_wrapper == "", "Goma and cc_wrapper can't be used together.") | 119 assert(cc_wrapper == "", "Goma and cc_wrapper can't be used together.") |
131 compiler_prefix = "$goma_dir/gomacc " | 120 compiler_prefix = "$goma_dir/gomacc " |
132 } else if (cc_wrapper != "") { | 121 } else if (cc_wrapper != "") { |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
526 "toolchain_os", | 515 "toolchain_os", |
527 "use_gold", | 516 "use_gold", |
528 "strip", | 517 "strip", |
529 ]) | 518 ]) |
530 | 519 |
531 if (defined(invoker.use_debug_fission)) { | 520 if (defined(invoker.use_debug_fission)) { |
532 use_debug_fission = invoker.use_debug_fission | 521 use_debug_fission = invoker.use_debug_fission |
533 } | 522 } |
534 } | 523 } |
535 } | 524 } |
OLD | NEW |