summaryrefslogtreecommitdiffstats
path: root/build/win
diff options
context:
space:
mode:
authorcaitkp@chromium.org <caitkp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-20 18:10:44 +0000
committercaitkp@chromium.org <caitkp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-20 18:10:44 +0000
commitd17cd23fb99b466be1ad5d7e89e047d94a976ebe (patch)
treeffeedc604eb0786d04d87ede5e9094ae4c26dd7b /build/win
parentfba25d9d0b4f837ecafc6a96c65973c57b4b01f7 (diff)
downloadchromium_src-d17cd23fb99b466be1ad5d7e89e047d94a976ebe.zip
chromium_src-d17cd23fb99b466be1ad5d7e89e047d94a976ebe.tar.gz
chromium_src-d17cd23fb99b466be1ad5d7e89e047d94a976ebe.tar.bz2
Temporary fix for telemetry builds
Until we get the swapimport tool up and running on x64 builds of Windows. BUG=335945,336025 Review URL: https://codereview.chromium.org/137643003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245928 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/win')
-rwxr-xr-xbuild/win/reorder-imports.py28
1 files changed, 18 insertions, 10 deletions
diff --git a/build/win/reorder-imports.py b/build/win/reorder-imports.py
index d320b51..da0a09a 100755
--- a/build/win/reorder-imports.py
+++ b/build/win/reorder-imports.py
@@ -10,19 +10,25 @@ import shutil
import subprocess
import sys
-def reorder_imports(input_dir, output_dir):
+def reorder_imports(input_dir, output_dir, architecture):
"""Run swapimports.exe on the initial chrome.exe, and write to the output
directory. Also copy over any related files that might be needed
(pdbs, manifests etc.).
"""
- input_image = '--input-image=%s' % (os.path.join(input_dir, 'chrome.exe'))
- output_image = '--output-image=%s' % (os.path.join(output_dir, 'chrome.exe'))
- swap_exe = os.path.join(
- __file__,
- '..\\..\\..\\third_party\\syzygy\\binaries\\exe\\swapimport.exe')
- subprocess.call(
- [swap_exe, input_image, output_image, '--overwrite', 'chrome_elf.dll'])
+ input_image = os.path.join(input_dir, 'chrome.exe')
+ output_image = os.path.join(output_dir, 'chrome.exe')
+
+ # TODO(caitkp): Remove this once swapimport works on x64 builds.
+ if architecture == 'x64':
+ shutil.copy(input_image, output_image)
+ else:
+ swap_exe = os.path.join(
+ __file__,
+ '..\\..\\..\\third_party\\syzygy\\binaries\\exe\\swapimport.exe')
+ subprocess.call(
+ [swap_exe, '--input-image=%s' % input_image,
+ '--output-image=%s' % output_image, '--overwrite', 'chrome_elf.dll'])
for fname in glob.iglob(os.path.join(input_dir, 'chrome.exe.*')):
shutil.copy(fname, os.path.join(output_dir, os.path.basename(fname)))
@@ -30,17 +36,19 @@ def reorder_imports(input_dir, output_dir):
def main(argv):
- usage = 'reorder_imports.py -i <input_dir> -o <output_dir>'
+ usage = 'reorder_imports.py -i <input_dir> -o <output_dir> -a <target_arch>'
parser = optparse.OptionParser(usage=usage)
parser.add_option('-i', '--input', help='reorder chrome.exe in DIR',
metavar='DIR')
parser.add_option('-o', '--output', help='write new chrome.exe to DIR',
metavar='DIR')
+ parser.add_option('-a', '--arch', help='architecture of build (optional)',
+ default='ia32')
opts, args = parser.parse_args()
if not opts.input or not opts.output:
parser.error('Please provide and input and output directory')
- return reorder_imports(opts.input, opts.output)
+ return reorder_imports(opts.input, opts.output, opts.arch)
if __name__ == "__main__":
sys.exit(main(sys.argv[1:]))