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

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

Issue 2296033002: Only use gcc_compile_wrapper when resource whitelisting is enabled. (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | no next file » | 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/android/config.gni") 5 import("//build/config/android/config.gni")
6 import("//build/config/clang/clang.gni") 6 import("//build/config/clang/clang.gni")
7 import("//build/config/nacl/config.gni") 7 import("//build/config/nacl/config.gni")
8 import("//build/config/sanitizers/sanitizers.gni") 8 import("//build/config/sanitizers/sanitizers.gni")
9 import("//build/config/v8_target_cpu.gni") 9 import("//build/config/v8_target_cpu.gni")
10 import("//build/toolchain/cc_wrapper.gni") 10 import("//build/toolchain/cc_wrapper.gni")
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 } 214 }
215 215
216 # These library switches can apply to all tools below. 216 # These library switches can apply to all tools below.
217 lib_switch = "-l" 217 lib_switch = "-l"
218 lib_dir_switch = "-L" 218 lib_dir_switch = "-L"
219 219
220 # Object files go in this directory. 220 # Object files go in this directory.
221 object_subdir = "{{target_out_dir}}/{{label_name}}" 221 object_subdir = "{{target_out_dir}}/{{label_name}}"
222 222
223 tool("cc") { 223 tool("cc") {
224 whitelist_flag = " "
225 if (enable_resource_whitelist_generation) {
226 whitelist_flag = " --resource-whitelist=\"{{output}}.whitelist\""
227 }
228 depfile = "{{output}}.d" 224 depfile = "{{output}}.d"
229 command = "$cc -MMD -MF $depfile ${rebuild_string}{{defines}} {{include_di rs}} {{cflags}} {{cflags_c}}${extra_cppflags}${extra_cflags} -c {{source}} -o {{ output}}" 225 command = "$cc -MMD -MF $depfile ${rebuild_string}{{defines}} {{include_di rs}} {{cflags}} {{cflags_c}}${extra_cppflags}${extra_cflags} -c {{source}} -o {{ output}}"
230 depsformat = "gcc" 226 depsformat = "gcc"
231 description = "CC {{output}}" 227 description = "CC {{output}}"
232 outputs = [ 228 outputs = [
233 # The whitelist file is also an output, but ninja does not 229 # The whitelist file is also an output, but ninja does not
234 # currently support multiple outputs for tool("cc"). 230 # currently support multiple outputs for tool("cc").
235 "$object_subdir/{{source_name_part}}.o", 231 "$object_subdir/{{source_name_part}}.o",
236 ] 232 ]
237 compile_wrapper = rebase_path("//build/toolchain/gcc_compile_wrapper.py", 233 if (enable_resource_whitelist_generation) {
238 root_build_dir) 234 compile_wrapper =
239 command = "$python_path \"$compile_wrapper\"$whitelist_flag $command" 235 rebase_path("//build/toolchain/gcc_compile_wrapper.py",
236 root_build_dir)
237 command = "$python_path \"$compile_wrapper\" --resource-whitelist=\"{{ou tput}}.whitelist\" $command"
238 }
240 } 239 }
241 240
242 tool("cxx") { 241 tool("cxx") {
243 whitelist_flag = " "
244 if (enable_resource_whitelist_generation) {
245 whitelist_flag = " --resource-whitelist=\"{{output}}.whitelist\""
246 }
247 depfile = "{{output}}.d" 242 depfile = "{{output}}.d"
248 command = "$cxx -MMD -MF $depfile ${rebuild_string}{{defines}} {{include_d irs}} {{cflags}} {{cflags_cc}}${extra_cppflags}${extra_cxxflags} -c {{source}} - o {{output}}" 243 command = "$cxx -MMD -MF $depfile ${rebuild_string}{{defines}} {{include_d irs}} {{cflags}} {{cflags_cc}}${extra_cppflags}${extra_cxxflags} -c {{source}} - o {{output}}"
249 depsformat = "gcc" 244 depsformat = "gcc"
250 description = "CXX {{output}}" 245 description = "CXX {{output}}"
251 outputs = [ 246 outputs = [
252 # The whitelist file is also an output, but ninja does not 247 # The whitelist file is also an output, but ninja does not
253 # currently support multiple outputs for tool("cxx"). 248 # currently support multiple outputs for tool("cxx").
254 "$object_subdir/{{source_name_part}}.o", 249 "$object_subdir/{{source_name_part}}.o",
255 ] 250 ]
256 compile_wrapper = rebase_path("//build/toolchain/gcc_compile_wrapper.py", 251 if (enable_resource_whitelist_generation) {
257 root_build_dir) 252 compile_wrapper =
258 command = "$python_path \"$compile_wrapper\"$whitelist_flag $command" 253 rebase_path("//build/toolchain/gcc_compile_wrapper.py",
254 root_build_dir)
255 command = "$python_path \"$compile_wrapper\" --resource-whitelist=\"{{ou tput}}.whitelist\" $command"
256 }
259 } 257 }
260 258
261 tool("asm") { 259 tool("asm") {
262 # For GCC we can just use the C compiler to compile assembly. 260 # For GCC we can just use the C compiler to compile assembly.
263 depfile = "{{output}}.d" 261 depfile = "{{output}}.d"
264 command = "$cc -MMD -MF $depfile ${rebuild_string}{{defines}} {{include_di rs}} {{asmflags}} -c {{source}} -o {{output}}" 262 command = "$cc -MMD -MF $depfile ${rebuild_string}{{defines}} {{include_di rs}} {{asmflags}} -c {{source}} -o {{output}}"
265 depsformat = "gcc" 263 depsformat = "gcc"
266 description = "ASM {{output}}" 264 description = "ASM {{output}}"
267 outputs = [ 265 outputs = [
268 "$object_subdir/{{source_name_part}}.o", 266 "$object_subdir/{{source_name_part}}.o",
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 forward_variables_from(invoker, [ "strip" ]) 494 forward_variables_from(invoker, [ "strip" ])
497 495
498 toolchain_args = { 496 toolchain_args = {
499 if (defined(invoker.toolchain_args)) { 497 if (defined(invoker.toolchain_args)) {
500 forward_variables_from(invoker.toolchain_args, "*") 498 forward_variables_from(invoker.toolchain_args, "*")
501 } 499 }
502 is_clang = true 500 is_clang = true
503 } 501 }
504 } 502 }
505 } 503 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698