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_cfi) { | 12 if (is_lto) { |
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_cfi && invoker.toolchain_os != "nacl") { | 220 if (is_lto && invoker.toolchain_os != "nacl") { |
221 gold_plugin_path = rebase_path( | 221 gold_plugin_path = rebase_path( |
222 "//third_party/llvm-build/Release+Asserts/lib/LLVMgold.so", | 222 "//third_party/llvm-build/Release+Asserts/lib/LLVMgold.so", |
223 root_build_dir) | 223 root_build_dir) |
224 arflags = "--plugin \"$gold_plugin_path\"" | 224 arflags = "--plugin \"$gold_plugin_path\"" |
225 } | 225 } |
226 | 226 |
227 # This needs a Python script to avoid using simple sh features in this | 227 # 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 | 228 # command, in case the host does not use a POSIX shell (e.g. compiling |
229 # POSIX-like toolchains such as NaCl on Windows). | 229 # POSIX-like toolchains such as NaCl on Windows). |
230 ar_wrapper = | 230 ar_wrapper = |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 nm = "${toolprefix}nm" | 457 nm = "${toolprefix}nm" |
458 | 458 |
459 forward_variables_from(invoker, | 459 forward_variables_from(invoker, |
460 [ | 460 [ |
461 "toolchain_cpu", | 461 "toolchain_cpu", |
462 "toolchain_os", | 462 "toolchain_os", |
463 "use_gold", | 463 "use_gold", |
464 ]) | 464 ]) |
465 } | 465 } |
466 } | 466 } |
OLD | NEW |