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. |
| 12 if (allow_posix_link_time_opt || is_cfi) { |
| 13 concurrent_links = |
| 14 exec_script("get_concurrent_links.py", [ "--lto" ], "value") |
| 15 } else { |
| 16 concurrent_links = exec_script("get_concurrent_links.py", [], "value") |
| 17 } |
| 18 |
11 # This template defines a toolchain for something that works like gcc | 19 # This template defines a toolchain for something that works like gcc |
12 # (including clang). | 20 # (including clang). |
13 # | 21 # |
14 # It requires the following variables specifying the executables to run: | 22 # It requires the following variables specifying the executables to run: |
15 # - cc | 23 # - cc |
16 # - cxx | 24 # - cxx |
17 # - ar | 25 # - ar |
18 # - ld | 26 # - ld |
19 # and the following which is used in the toolchain_args | 27 # and the following which is used in the toolchain_args |
20 # - toolchain_cpu (What "current_cpu" should be set to when invoking a | 28 # - toolchain_cpu (What "current_cpu" should be set to when invoking a |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 command = "$cc -MMD -MF $depfile ${rebuild_string}{{defines}} {{include_di
rs}} {{asmflags}} -c {{source}} -o {{output}}" | 209 command = "$cc -MMD -MF $depfile ${rebuild_string}{{defines}} {{include_di
rs}} {{asmflags}} -c {{source}} -o {{output}}" |
202 depsformat = "gcc" | 210 depsformat = "gcc" |
203 description = "ASM {{output}}" | 211 description = "ASM {{output}}" |
204 outputs = [ | 212 outputs = [ |
205 "$object_subdir/{{source_name_part}}.o", | 213 "$object_subdir/{{source_name_part}}.o", |
206 ] | 214 ] |
207 } | 215 } |
208 | 216 |
209 tool("alink") { | 217 tool("alink") { |
210 rspfile = "{{output}}.rsp" | 218 rspfile = "{{output}}.rsp" |
| 219 arflags = "" |
| 220 if ((allow_posix_link_time_opt || is_cfi) && |
| 221 invoker.toolchain_os != "nacl") { |
| 222 gold_plugin_path = rebase_path( |
| 223 "//third_party/llvm-build/Release+Asserts/lib/LLVMgold.so", |
| 224 root_build_dir) |
| 225 arflags = "--plugin \"$gold_plugin_path\"" |
| 226 } |
211 | 227 |
212 # 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 |
213 # 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 |
214 # POSIX-like toolchains such as NaCl on Windows). | 230 # POSIX-like toolchains such as NaCl on Windows). |
215 ar_wrapper = | 231 ar_wrapper = |
216 rebase_path("//build/toolchain/gcc_ar_wrapper.py", root_build_dir) | 232 rebase_path("//build/toolchain/gcc_ar_wrapper.py", root_build_dir) |
217 command = "$python_path \"$ar_wrapper\" --output={{output}} --ar=\"$ar\" {
{arflags}} rcsD @\"$rspfile\"" | 233 command = "$python_path \"$ar_wrapper\" --output={{output}} --ar=\"$ar\" $
arflags rcsD @\"$rspfile\"" |
218 description = "AR {{output}}" | 234 description = "AR {{output}}" |
219 rspfile_content = "{{inputs}}" | 235 rspfile_content = "{{inputs}}" |
220 outputs = [ | 236 outputs = [ |
221 "{{output_dir}}/{{target_output_name}}{{output_extension}}", | 237 "{{output_dir}}/{{target_output_name}}{{output_extension}}", |
222 ] | 238 ] |
223 | 239 |
224 # Shared libraries go in the target out directory by default so we can | 240 # Shared libraries go in the target out directory by default so we can |
225 # generate different targets with the same name and not have them collide. | 241 # generate different targets with the same name and not have them collide. |
226 default_output_dir = "{{target_out_dir}}" | 242 default_output_dir = "{{target_out_dir}}" |
227 default_output_extension = ".a" | 243 default_output_extension = ".a" |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 | 472 |
457 forward_variables_from(invoker, | 473 forward_variables_from(invoker, |
458 [ | 474 [ |
459 "toolchain_cpu", | 475 "toolchain_cpu", |
460 "toolchain_os", | 476 "toolchain_os", |
461 "use_gold", | 477 "use_gold", |
462 "strip", | 478 "strip", |
463 ]) | 479 ]) |
464 } | 480 } |
465 } | 481 } |
OLD | NEW |