Chromium Code Reviews| Index: pydir/run-pnacl-sz.py |
| diff --git a/pydir/run-pnacl-sz.py b/pydir/run-pnacl-sz.py |
| index cefd4754286016af931b370ca946873460860acb..2de915ad59fdc889e478f3bf4ececbaaecc2d55f 100755 |
| --- a/pydir/run-pnacl-sz.py |
| +++ b/pydir/run-pnacl-sz.py |
| @@ -11,14 +11,16 @@ import tempfile |
| from utils import shellcmd |
| -def TargetAssemblerFlags(target): |
| +def TargetAssemblerFlags(target, sandboxed): |
| # TODO(stichnot): -triple=i686-nacl should be used for a |
| # sandboxing test. This means there should be an args.sandbox |
| # argument that also gets passed through to pnacl-sz. |
| # TODO(reed kotler). Need to find out exactly we need to |
| # add here for Mips32. |
| - flags = { 'x8632': ['-triple=i686'], |
| - 'arm32': ['-triple=armv7a', '-mcpu=cortex-a9', '-mattr=+neon'], |
| + flags = { 'x8632': ['-triple=%s' % ('i686' if not sandboxed else 'i686-nacl')], |
|
Jim Stichnoth
2015/12/04 22:51:54
'i686-nacl' if sandboxed else 'i686'
this should
John
2015/12/05 16:20:11
Done.
|
| + 'arm32': ['-triple=%s' % ( |
| + 'armv7a' if not sandboxed else 'armv7a-nacl'), |
|
Jim Stichnoth
2015/12/04 22:51:54
'armv7a-nacl' if sandboxed else 'armv7a'
John
2015/12/05 16:20:11
Done.
|
| + '-mcpu=cortex-a9', '-mattr=+neon'], |
| 'mips32': ['-triple=mipsel' ] } |
| return flags[target] |
| @@ -89,6 +91,8 @@ def main(): |
| argparser.add_argument('--args', '-a', nargs=argparse.REMAINDER, |
| default=[], |
| help='Remaining arguments are passed to pnacl-sz') |
| + argparser.add_argument('--sandbox', required=False, action='store_true', |
| + help='Sanboxes the generated code.') |
|
Karl
2015/12/04 20:41:17
sanboxes?
John
2015/12/05 16:20:11
Done.
|
| args = argparser.parse_args() |
| pnacl_bin_path = args.pnacl_bin_path |
| @@ -121,6 +125,8 @@ def main(): |
| cmd += [os.path.join(pnacl_bin_path, 'not')] |
| cmd += [args.pnacl_sz] |
| cmd += ['--target', args.target] |
| + if args.sandbox: |
| + cmd += ['-sandbox'] |
| if args.insts: |
| # If the tests are based on '-verbose inst' output, force |
| # single-threaded translation because dump output does not get |
| @@ -147,7 +153,7 @@ def main(): |
| asm_temp.close() |
| if args.assemble and args.filetype != 'obj': |
| cmd += (['|', os.path.join(pnacl_bin_path, 'llvm-mc')] + |
| - TargetAssemblerFlags(args.target) + |
| + TargetAssemblerFlags(args.target, args.sandbox) + |
| ['-filetype=obj', '-o', asm_temp.name]) |
| elif asm_temp: |
| cmd += ['-o', asm_temp.name] |