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

Side by Side Diff: base/allocator/prep_libc.py

Issue 12303010: fixes to libcmt stripper to correctly strip x64 objects (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 10 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 #!/usr/bin/env python 1 #!/usr/bin/env python
2 2
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 # 6 #
7 # This script takes libcmt.lib for VS2005/08/10 and removes the allocation 7 # This script takes libcmt.lib for VS2005/08/10 and removes the allocation
8 # related functions from it. 8 # related functions from it.
9 # 9 #
10 # Usage: prep_libc.py <VCInstallDir> <OutputDir> 10 # Usage: prep_libc.py <VCInstallDir> <OutputDir>
(...skipping 21 matching lines...) Expand all
32 32
33 def main(): 33 def main():
34 vs_install_dir = sys.argv[1] 34 vs_install_dir = sys.argv[1]
35 outdir = sys.argv[2] 35 outdir = sys.argv[2]
36 if "x64" in sys.argv[2]: 36 if "x64" in sys.argv[2]:
37 vs_install_dir = os.path.join(vs_install_dir, 'amd64') 37 vs_install_dir = os.path.join(vs_install_dir, 'amd64')
38 output_lib = os.path.join(outdir, 'libcmt.lib') 38 output_lib = os.path.join(outdir, 'libcmt.lib')
39 shutil.copyfile(os.path.join(vs_install_dir, 'libcmt.lib'), output_lib) 39 shutil.copyfile(os.path.join(vs_install_dir, 'libcmt.lib'), output_lib)
40 shutil.copyfile(os.path.join(vs_install_dir, 'libcmt.pdb'), 40 shutil.copyfile(os.path.join(vs_install_dir, 'libcmt.pdb'),
41 os.path.join(outdir, 'libcmt.pdb')) 41 os.path.join(outdir, 'libcmt.pdb'))
42
42 vspaths = [ 43 vspaths = [
43 'build\\intel\\mt_obj\\', 44 'build\\intel\\mt_obj\\',
44 'f:\\dd\\vctools\\crt_bld\\SELF_X86\\crt\\src\\build\\INTEL\\mt_obj\\', 45 'f:\\dd\\vctools\\crt_bld\\SELF_X86\\' + \
scottmg 2013/02/19 18:11:01 nit; maybe a loop/comprehension and some %s would
45 'F:\\dd\\vctools\\crt_bld\\SELF_X86\\crt\\src\\build\\INTEL\\mt_obj\\nativec \\\\', 46 'crt\\src\\build\\INTEL\\mt_obj\\',
46 'F:\\dd\\vctools\\crt_bld\\SELF_X86\\crt\\src\\build\\INTEL\\mt_obj\\nativec pp\\\\', 47 'F:\\dd\\vctools\\crt_bld\\SELF_X86\\' + \
48 'crt\\src\\build\\INTEL\\mt_obj\\nativec\\\\',
49 'F:\\dd\\vctools\\crt_bld\\SELF_X86\\' + \
50 'crt\\src\\build\\INTEL\\mt_obj\\nativecpp\\\\',
51 'f:\\dd\\vctools\\crt_bld\\SELF_64_amd64\\' + \
52 'crt\\src\\build\\amd64\\mt_obj\\',
53 'F:\\dd\\vctools\\crt_bld\\SELF_64_amd64\\' + \
54 'crt\\src\\build\\amd64\\mt_obj\\nativec\\\\',
55 'F:\\dd\\vctools\\crt_bld\\SELF_64_amd64\\' + \
56 'crt\\src\\build\\amd64\\mt_obj\\nativecpp\\\\',
47 ] 57 ]
48 objfiles = ['malloc', 'free', 'realloc', 'new', 'delete', 'new2', 'delete2', 58 objfiles = ['malloc', 'free', 'realloc', 'new', 'delete', 'new2', 'delete2',
49 'align', 'msize', 'heapinit', 'expand', 'heapchk', 'heapwalk', 59 'align', 'msize', 'heapinit', 'expand', 'heapchk', 'heapwalk',
50 'heapmin', 'sbheap', 'calloc', 'recalloc', 'calloc_impl', 60 'heapmin', 'sbheap', 'calloc', 'recalloc', 'calloc_impl',
51 'new_mode', 'newopnt'] 61 'new_mode', 'newopnt']
52 for obj in objfiles: 62 for obj in objfiles:
53 for vspath in vspaths: 63 for vspath in vspaths:
54 cmd = ('lib /nologo /ignore:4006,4014,4221 /remove:%s%s.obj %s' % 64 cmd = ('lib /nologo /ignore:4006,4014,4221 /remove:%s%s.obj %s' %
55 (vspath, obj, output_lib)) 65 (vspath, obj, output_lib))
56 run(cmd, obj + '.obj') 66 run(cmd, obj + '.obj')
57 67
58 if __name__ == "__main__": 68 if __name__ == "__main__":
59 sys.exit(main()) 69 sys.exit(main())
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