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

Unified Diff: pydir/run-pnacl-sz.py

Issue 1499983002: Subzero. ARM32. Implements sandboxing. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addresses comments. Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pydir/crosstest_generator.py ('k') | pydir/szbuild.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pydir/run-pnacl-sz.py
diff --git a/pydir/run-pnacl-sz.py b/pydir/run-pnacl-sz.py
index cefd4754286016af931b370ca946873460860acb..8279772efc3aada2f0613cd224f728e62f3657b3 100755
--- a/pydir/run-pnacl-sz.py
+++ b/pydir/run-pnacl-sz.py
@@ -11,14 +11,13 @@ import tempfile
from utils import shellcmd
-def TargetAssemblerFlags(target):
- # 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.
+def TargetAssemblerFlags(target, sandboxed):
# 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-nacl' if sandboxed else 'i686')],
+ 'arm32': ['-triple=%s' % (
+ 'armv7a-nacl' if sandboxed else 'armv7a'),
+ '-mcpu=cortex-a9', '-mattr=+neon'],
'mips32': ['-triple=mipsel' ] }
return flags[target]
@@ -89,6 +88,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='Sandboxes the generated code.')
args = argparser.parse_args()
pnacl_bin_path = args.pnacl_bin_path
@@ -121,6 +122,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 +150,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]
« no previous file with comments | « pydir/crosstest_generator.py ('k') | pydir/szbuild.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698