| 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 | 9 from utils import shellcmd |
| 10 from utils import FindBaseNaCl | 10 from utils import FindBaseNaCl |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 echo=args.verbose) | 311 echo=args.verbose) |
| 312 shellcmd(( | 312 shellcmd(( |
| 313 '{objcopy} --globalize-symbol={start} ' + | 313 '{objcopy} --globalize-symbol={start} ' + |
| 314 '--globalize-symbol=__Sz_block_profile_info {partial}' | 314 '--globalize-symbol=__Sz_block_profile_info {partial}' |
| 315 ).format(objcopy=objcopy, partial=obj_partial, | 315 ).format(objcopy=objcopy, partial=obj_partial, |
| 316 start='_start' if args.sandbox else '_user_start'), | 316 start='_start' if args.sandbox else '_user_start'), |
| 317 echo=args.verbose) | 317 echo=args.verbose) |
| 318 | 318 |
| 319 # Run the linker regardless of hybrid mode. | 319 # Run the linker regardless of hybrid mode. |
| 320 if args.sandbox: | 320 if args.sandbox: |
| 321 assert args.target in ('x8632', 'arm32'), \ | 321 assert args.target in ['x8632'], \ |
| 322 '-sandbox is not available for %s' % args.target | 322 '-sandbox is not available for %s' % args.target |
| 323 target_lib_dir = { | |
| 324 'arm32': 'arm', | |
| 325 'x8632': 'x86-32', | |
| 326 }[args.target] | |
| 327 linklib = ('{root}/toolchain/linux_x86/pnacl_newlib_raw/translator/' + | 323 linklib = ('{root}/toolchain/linux_x86/pnacl_newlib_raw/translator/' + |
| 328 '{target_dir}/lib').format(root=nacl_root, target_dir=target_
lib_dir) | 324 'x86-32/lib').format(root=nacl_root) |
| 329 shellcmd(( | 325 shellcmd(( |
| 330 '{gold} -nostdlib --no-fix-cortex-a8 --eh-frame-hdr -z text ' + | 326 '{gold} -nostdlib --no-fix-cortex-a8 --eh-frame-hdr -z text ' + |
| 331 '--build-id --entry=__pnacl_start -static ' + | 327 '--build-id --entry=__pnacl_start -static ' + |
| 332 '{linklib}/crtbegin.o {partial} ' + | 328 '{linklib}/crtbegin.o {partial} ' + |
| 333 '{root}/toolchain_build/src/subzero/build/runtime/' + | 329 '{root}/toolchain_build/src/subzero/build/runtime/' + |
| 334 'szrt_sb_{target}.o ' + | 330 'szrt_sb_{target}.o ' + |
| 335 '{linklib}/libpnacl_irt_shim_dummy.a --start-group ' + | 331 '{linklib}/libpnacl_irt_shim_dummy.a --start-group ' + |
| 336 '{linklib}/libgcc.a {linklib}/libcrt_platform.a ' + | 332 '{linklib}/libgcc.a {linklib}/libcrt_platform.a ' + |
| 337 '--end-group {linklib}/crtend.o --undefined=_start ' + | 333 '--end-group {linklib}/crtend.o --undefined=_start ' + |
| 338 '--defsym=__Sz_AbsoluteZero=0 ' + | 334 '--defsym=__Sz_AbsoluteZero=0 ' + |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 | 370 |
| 375 # Put the extra verbose printing at the end. | 371 # Put the extra verbose printing at the end. |
| 376 if args.verbose and hybrid: | 372 if args.verbose and hybrid: |
| 377 print 'include={regex}'.format(regex=re_include_str) | 373 print 'include={regex}'.format(regex=re_include_str) |
| 378 print 'exclude={regex}'.format(regex=re_exclude_str) | 374 print 'exclude={regex}'.format(regex=re_exclude_str) |
| 379 print 'default_match={dm}'.format(dm=default_match) | 375 print 'default_match={dm}'.format(dm=default_match) |
| 380 print 'Number of Subzero syms = {num}'.format(num=len(sz_syms)) | 376 print 'Number of Subzero syms = {num}'.format(num=len(sz_syms)) |
| 381 | 377 |
| 382 if __name__ == '__main__': | 378 if __name__ == '__main__': |
| 383 main() | 379 main() |
| OLD | NEW |