Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python2 | 1 #!/usr/bin/env python2 |
| 2 | 2 |
| 3 import argparse | 3 import argparse |
| 4 import os | 4 import os |
| 5 import pipes | 5 import pipes |
| 6 import re | 6 import re |
| 7 import sys | 7 import sys |
| 8 | 8 |
| 9 from utils import shellcmd, FindBaseNaCl, get_sfi_string | 9 from utils import GetObjcopyCmd, shellcmd, FindBaseNaCl, get_sfi_string |
| 10 | 10 |
| 11 def NewerThanOrNotThere(old_path, new_path): | 11 def NewerThanOrNotThere(old_path, new_path): |
| 12 """Returns whether old_path is newer than new_path. | 12 """Returns whether old_path is newer than new_path. |
| 13 | 13 |
| 14 Also returns true if either path doesn't exist. | 14 Also returns true if either path doesn't exist. |
| 15 """ | 15 """ |
| 16 if not (os.path.exists(old_path) and os.path.exists(new_path)): | 16 if not (os.path.exists(old_path) and os.path.exists(new_path)): |
| 17 return True | 17 return True |
| 18 return os.path.getmtime(old_path) > os.path.getmtime(new_path) | 18 return os.path.getmtime(old_path) > os.path.getmtime(new_path) |
| 19 | 19 |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 286 sym_llc = pexe_base + '.sym.llc.txt' | 286 sym_llc = pexe_base + '.sym.llc.txt' |
| 287 sym_sz = pexe_base + '.sym.sz.txt' | 287 sym_sz = pexe_base + '.sym.sz.txt' |
| 288 sym_sz_unescaped = pexe_base_unescaped + '.sym.sz.txt' | 288 sym_sz_unescaped = pexe_base_unescaped + '.sym.sz.txt' |
| 289 whitelist_sz = pexe_base + '.wl.sz.txt' | 289 whitelist_sz = pexe_base + '.wl.sz.txt' |
| 290 whitelist_sz_unescaped = pexe_base_unescaped + '.wl.sz.txt' | 290 whitelist_sz_unescaped = pexe_base_unescaped + '.wl.sz.txt' |
| 291 pnacl_sz = ( | 291 pnacl_sz = ( |
| 292 '{root}/toolchain_build/src/subzero/pnacl-sz' | 292 '{root}/toolchain_build/src/subzero/pnacl-sz' |
| 293 ).format(root=nacl_root) | 293 ).format(root=nacl_root) |
| 294 llcbin = '{base}/pnacl-llc'.format(base=path_addition) | 294 llcbin = '{base}/pnacl-llc'.format(base=path_addition) |
| 295 gold = '{base}/le32-nacl-ld.gold'.format(base=path_addition) | 295 gold = '{base}/le32-nacl-ld.gold'.format(base=path_addition) |
| 296 objcopy = '{base}/le32-nacl-objcopy'.format(base=path_addition) | 296 objcopy = ('{base}/' + GetObjcopyCmd()).format(base=path_addition) |
|
Jim Stichnoth
2016/03/09 22:41:13
'{base}/{objcopy}'.format(base=path_addition, objc
Sean Klein
2016/03/09 22:59:22
Done.
| |
| 297 opt_level = args.optlevel | 297 opt_level = args.optlevel |
| 298 opt_level_map = { 'm1':'0', '-1':'0', '0':'0', '1':'1', '2':'2' } | 298 opt_level_map = { 'm1':'0', '-1':'0', '0':'0', '1':'1', '2':'2' } |
| 299 hybrid = args.include or args.exclude | 299 hybrid = args.include or args.exclude |
| 300 native = not args.sandbox and not args.nonsfi | 300 native = not args.sandbox and not args.nonsfi |
| 301 | 301 |
| 302 if hybrid and (args.force or | 302 if hybrid and (args.force or |
| 303 NewerThanOrNotThere(pexe, obj_llc) or | 303 NewerThanOrNotThere(pexe, obj_llc) or |
| 304 NewerThanOrNotThere(llcbin, obj_llc)): | 304 NewerThanOrNotThere(llcbin, obj_llc)): |
| 305 arch = { | 305 arch = { |
| 306 'arm32': 'arm' + get_sfi_string(args, 'v7', '-nonsfi', '-nonsfi'), | 306 'arm32': 'arm' + get_sfi_string(args, 'v7', '-nonsfi', '-nonsfi'), |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 449 | 449 |
| 450 # Put the extra verbose printing at the end. | 450 # Put the extra verbose printing at the end. |
| 451 if args.verbose and hybrid: | 451 if args.verbose and hybrid: |
| 452 print 'include={regex}'.format(regex=re_include_str) | 452 print 'include={regex}'.format(regex=re_include_str) |
| 453 print 'exclude={regex}'.format(regex=re_exclude_str) | 453 print 'exclude={regex}'.format(regex=re_exclude_str) |
| 454 print 'default_match={dm}'.format(dm=default_match) | 454 print 'default_match={dm}'.format(dm=default_match) |
| 455 print 'Number of Subzero syms = {num}'.format(num=len(sz_syms)) | 455 print 'Number of Subzero syms = {num}'.format(num=len(sz_syms)) |
| 456 | 456 |
| 457 if __name__ == '__main__': | 457 if __name__ == '__main__': |
| 458 main() | 458 main() |
| OLD | NEW |