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 # This value will be inherited in the toolchain below. | 11 # This value will be inherited in the toolchain below. |
12 if (is_lto) { | 12 if (allow_posix_link_time_opt || is_cfi) { |
13 concurrent_links = | 13 concurrent_links = |
14 exec_script("get_concurrent_links.py", [ "--lto" ], "value") | 14 exec_script("get_concurrent_links.py", [ "--lto" ], "value") |
15 } else { | 15 } else { |
16 concurrent_links = exec_script("get_concurrent_links.py", [], "value") | 16 concurrent_links = exec_script("get_concurrent_links.py", [], "value") |
17 } | 17 } |
18 | 18 |
19 # This template defines a toolchain for something that works like gcc | 19 # This template defines a toolchain for something that works like gcc |
20 # (including clang). | 20 # (including clang). |
21 # | 21 # |
22 # It requires the following variables specifying the executables to run: | 22 # It requires the following variables specifying the executables to run: |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 depsformat = "gcc" | 210 depsformat = "gcc" |
211 description = "ASM {{output}}" | 211 description = "ASM {{output}}" |
212 outputs = [ | 212 outputs = [ |
213 "$object_subdir/{{source_name_part}}.o", | 213 "$object_subdir/{{source_name_part}}.o", |
214 ] | 214 ] |
215 } | 215 } |
216 | 216 |
217 tool("alink") { | 217 tool("alink") { |
218 rspfile = "{{output}}.rsp" | 218 rspfile = "{{output}}.rsp" |
219 arflags = "" | 219 arflags = "" |
220 if (is_lto && invoker.toolchain_os != "nacl") { | 220 if ((allow_posix_link_time_opt || is_cfi) && |
| 221 invoker.toolchain_os != "nacl") { |
221 gold_plugin_path = rebase_path( | 222 gold_plugin_path = rebase_path( |
222 "//third_party/llvm-build/Release+Asserts/lib/LLVMgold.so", | 223 "//third_party/llvm-build/Release+Asserts/lib/LLVMgold.so", |
223 root_build_dir) | 224 root_build_dir) |
224 arflags = "--plugin \"$gold_plugin_path\"" | 225 arflags = "--plugin \"$gold_plugin_path\"" |
225 } | 226 } |
226 | 227 |
227 # This needs a Python script to avoid using simple sh features in this | 228 # This needs a Python script to avoid using simple sh features in this |
228 # command, in case the host does not use a POSIX shell (e.g. compiling | 229 # command, in case the host does not use a POSIX shell (e.g. compiling |
229 # POSIX-like toolchains such as NaCl on Windows). | 230 # POSIX-like toolchains such as NaCl on Windows). |
230 ar_wrapper = | 231 ar_wrapper = |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 nm = "${toolprefix}nm" | 459 nm = "${toolprefix}nm" |
459 | 460 |
460 forward_variables_from(invoker, | 461 forward_variables_from(invoker, |
461 [ | 462 [ |
462 "toolchain_cpu", | 463 "toolchain_cpu", |
463 "toolchain_os", | 464 "toolchain_os", |
464 "use_gold", | 465 "use_gold", |
465 ]) | 466 ]) |
466 } | 467 } |
467 } | 468 } |
OLD | NEW |