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

Unified Diff: build/toolchain/gcc_ar_wrapper.py

Issue 2175413004: Enable whitelist generation for all builds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | build/toolchain/gcc_compile_wrapper.py » ('j') | build/toolchain/gcc_compile_wrapper.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/toolchain/gcc_ar_wrapper.py
diff --git a/build/toolchain/gcc_ar_wrapper.py b/build/toolchain/gcc_ar_wrapper.py
index a8f319030761342125f5b0e0c775e1a8611ea4f4..aedf9974aaae75630ea3adb90696a12c555ee22d 100755
--- a/build/toolchain/gcc_ar_wrapper.py
+++ b/build/toolchain/gcc_ar_wrapper.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-# Copyright 2015 The Chromium Authors. All rights reserved.
+# Copyright 2016 The Chromium Authors. All rights reserved.
agrieve 2016/07/27 01:42:27 These actually shouldn't be updated. They are mean
estevenson 2016/07/28 21:56:45 Done.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -16,20 +16,7 @@ import os
import subprocess
import sys
-
-# When running on a Windows host and using a toolchain whose tools are
-# actually wrapper scripts (i.e. .bat files on Windows) rather than binary
-# executables, the "command" to run has to be prefixed with this magic.
-# The GN toolchain definitions take care of that for when GN/Ninja is
-# running the tool directly. When that command is passed in to this
-# script, it appears as a unitary string but needs to be split up so that
-# just 'cmd' is the actual command given to Python's subprocess module.
-BAT_PREFIX = 'cmd /c call '
-
-def CommandToRun(command):
- if command[0].startswith(BAT_PREFIX):
- command = command[0].split(None, 3) + command[1:]
- return command
+import wrapper_utils
def main():
@@ -48,10 +35,20 @@ def main():
help='Operation on the archive')
parser.add_argument('inputs', nargs='+',
help='Input files')
+ parser.add_argument('--rspfile',
+ help='Response file',
agrieve 2016/07/27 01:42:27 nit: response file is already passed as a position
estevenson 2016/07/28 21:56:45 Done.
+ metavar='FILE')
+ parser.add_argument('--whitelist', action='store_true',
+ help='Indicates that whitelisting should be performed.')
agrieve 2016/07/27 01:42:27 It's probably not obvious to most what "whitelisti
estevenson 2016/07/28 21:56:45 Done.
args = parser.parse_args()
+ if args.whitelist:
+ whitelist_file = '%s.whitelist' % args.output
agrieve 2016/07/27 01:42:27 nit: For compiler wrapper you pass in the path to
estevenson 2016/07/28 21:56:45 Done.
+ wrapper_utils.CombineWhitelists(args.rspfile, whitelist_file)
+
command = [args.ar, args.operation]
if args.plugin is not None:
+
agrieve 2016/07/27 01:42:27 nit: revert
estevenson 2016/07/28 21:56:45 Done.
command += ['--plugin', args.plugin]
command.append(args.output)
command += args.inputs
@@ -64,7 +61,7 @@ def main():
raise
# Now just run the ar command.
- return subprocess.call(CommandToRun(command))
+ return subprocess.call(wrapper_utils.CommandToRun(command))
if __name__ == "__main__":
« no previous file with comments | « no previous file | build/toolchain/gcc_compile_wrapper.py » ('j') | build/toolchain/gcc_compile_wrapper.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698