Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Side by Side Diff: build/toolchain/gcc_toolchain.gni

Issue 1909163002: Implement arflags in the GN build. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « build/config/win/BUILD.gn ('k') | build/toolchain/mac/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
19 # This template defines a toolchain for something that works like gcc 11 # This template defines a toolchain for something that works like gcc
20 # (including clang). 12 # (including clang).
21 # 13 #
22 # It requires the following variables specifying the executables to run: 14 # It requires the following variables specifying the executables to run:
23 # - cc 15 # - cc
24 # - cxx 16 # - cxx
25 # - ar 17 # - ar
26 # - ld 18 # - ld
27 # and the following which is used in the toolchain_args 19 # and the following which is used in the toolchain_args
28 # - 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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 command = "$cc -MMD -MF $depfile ${rebuild_string}{{defines}} {{include_di rs}} {{asmflags}} -c {{source}} -o {{output}}" 201 command = "$cc -MMD -MF $depfile ${rebuild_string}{{defines}} {{include_di rs}} {{asmflags}} -c {{source}} -o {{output}}"
210 depsformat = "gcc" 202 depsformat = "gcc"
211 description = "ASM {{output}}" 203 description = "ASM {{output}}"
212 outputs = [ 204 outputs = [
213 "$object_subdir/{{source_name_part}}.o", 205 "$object_subdir/{{source_name_part}}.o",
214 ] 206 ]
215 } 207 }
216 208
217 tool("alink") { 209 tool("alink") {
218 rspfile = "{{output}}.rsp" 210 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 }
227 211
228 # This needs a Python script to avoid using simple sh features in this 212 # This needs a Python script to avoid using simple sh features in this
229 # command, in case the host does not use a POSIX shell (e.g. compiling 213 # command, in case the host does not use a POSIX shell (e.g. compiling
230 # POSIX-like toolchains such as NaCl on Windows). 214 # POSIX-like toolchains such as NaCl on Windows).
231 ar_wrapper = 215 ar_wrapper =
232 rebase_path("//build/toolchain/gcc_ar_wrapper.py", root_build_dir) 216 rebase_path("//build/toolchain/gcc_ar_wrapper.py", root_build_dir)
233 command = "$python_path \"$ar_wrapper\" --output={{output}} --ar=\"$ar\" $ arflags rcsD @\"$rspfile\"" 217 command = "$python_path \"$ar_wrapper\" --output={{output}} --ar=\"$ar\" { {arflags}} rcsD @\"$rspfile\""
234 description = "AR {{output}}" 218 description = "AR {{output}}"
235 rspfile_content = "{{inputs}}" 219 rspfile_content = "{{inputs}}"
236 outputs = [ 220 outputs = [
237 "{{output_dir}}/{{target_output_name}}{{output_extension}}", 221 "{{output_dir}}/{{target_output_name}}{{output_extension}}",
238 ] 222 ]
239 223
240 # Shared libraries go in the target out directory by default so we can 224 # Shared libraries go in the target out directory by default so we can
241 # generate different targets with the same name and not have them collide. 225 # generate different targets with the same name and not have them collide.
242 default_output_dir = "{{target_out_dir}}" 226 default_output_dir = "{{target_out_dir}}"
243 default_output_extension = ".a" 227 default_output_extension = ".a"
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 456
473 forward_variables_from(invoker, 457 forward_variables_from(invoker,
474 [ 458 [
475 "toolchain_cpu", 459 "toolchain_cpu",
476 "toolchain_os", 460 "toolchain_os",
477 "use_gold", 461 "use_gold",
478 "strip", 462 "strip",
479 ]) 463 ])
480 } 464 }
481 } 465 }
OLDNEW
« no previous file with comments | « build/config/win/BUILD.gn ('k') | build/toolchain/mac/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698