OLD | NEW |
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 VS2013 and removes the allocation related | 7 # This script takes libcmt.lib for VS2013 and removes the allocation related |
8 # functions from it. | 8 # functions from it. |
9 # | 9 # |
10 # Usage: prep_libc.py <VCLibDir> <OutputDir> <arch> | 10 # Usage: prep_libc.py <VCLibDir> <OutputDir> <arch> |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 vs_install_dir = os.path.join(vs_install_dir, 'amd64') | 43 vs_install_dir = os.path.join(vs_install_dir, 'amd64') |
44 output_lib = os.path.join(outdir, 'libcmt.lib') | 44 output_lib = os.path.join(outdir, 'libcmt.lib') |
45 shutil.copyfile(os.path.join(vs_install_dir, 'libcmt.lib'), output_lib) | 45 shutil.copyfile(os.path.join(vs_install_dir, 'libcmt.lib'), output_lib) |
46 shutil.copyfile(os.path.join(vs_install_dir, 'libcmt.pdb'), | 46 shutil.copyfile(os.path.join(vs_install_dir, 'libcmt.pdb'), |
47 os.path.join(outdir, 'libcmt.pdb')) | 47 os.path.join(outdir, 'libcmt.pdb')) |
48 cvspath = 'f:\\binaries\\Intermediate\\vctools\\crt_bld\\' + bindir + \ | 48 cvspath = 'f:\\binaries\\Intermediate\\vctools\\crt_bld\\' + bindir + \ |
49 '\\crt\\prebuild\\build\\' + objdir + '\\mt_obj\\nativec\\\\'; | 49 '\\crt\\prebuild\\build\\' + objdir + '\\mt_obj\\nativec\\\\'; |
50 cppvspath = 'f:\\binaries\\Intermediate\\vctools\\crt_bld\\' + bindir + \ | 50 cppvspath = 'f:\\binaries\\Intermediate\\vctools\\crt_bld\\' + bindir + \ |
51 '\\crt\\prebuild\\build\\' + objdir + '\\mt_obj\\nativecpp\\\\'; | 51 '\\crt\\prebuild\\build\\' + objdir + '\\mt_obj\\nativecpp\\\\'; |
52 | 52 |
53 cobjfiles = ['malloc', 'free', 'realloc', 'align', 'msize', 'heapinit', | 53 cobjfiles = ['malloc', 'free', 'realloc', 'heapinit', 'calloc', 'recalloc', |
54 'expand', 'heapchk', 'heapwalk', 'heapmin', 'calloc', 'recalloc', | |
55 'calloc_impl'] | 54 'calloc_impl'] |
56 cppobjfiles = ['new', 'new2', 'delete', 'delete2', 'new_mode', 'newopnt', | 55 cppobjfiles = ['new', 'new2', 'delete', 'delete2', 'new_mode', 'newopnt', |
57 'newaopnt'] | 56 'newaopnt'] |
58 for obj in cobjfiles: | 57 for obj in cobjfiles: |
59 cmd = ('lib /nologo /ignore:4006,4221 /remove:%s%s.obj %s' % | 58 cmd = ('lib /nologo /ignore:4006,4221 /remove:%s%s.obj %s' % |
60 (cvspath, obj, output_lib)) | 59 (cvspath, obj, output_lib)) |
61 run(cmd) | 60 run(cmd) |
62 for obj in cppobjfiles: | 61 for obj in cppobjfiles: |
63 cmd = ('lib /nologo /ignore:4006,4221 /remove:%s%s.obj %s' % | 62 cmd = ('lib /nologo /ignore:4006,4221 /remove:%s%s.obj %s' % |
64 (cppvspath, obj, output_lib)) | 63 (cppvspath, obj, output_lib)) |
65 run(cmd) | 64 run(cmd) |
66 | 65 |
67 if __name__ == "__main__": | 66 if __name__ == "__main__": |
68 sys.exit(main()) | 67 sys.exit(main()) |
OLD | NEW |