| OLD | NEW |
| 1 #!/usr/bin/env python2 | 1 #!/usr/bin/env python2 |
| 2 | 2 |
| 3 import argparse | 3 import argparse |
| 4 import itertools | 4 import itertools |
| 5 import os | 5 import os |
| 6 import re | 6 import re |
| 7 import subprocess | 7 import subprocess |
| 8 import sys | 8 import sys |
| 9 import tempfile | 9 import tempfile |
| 10 | 10 |
| 11 from utils import FindBaseNaCl, GetObjdumpCmd, shellcmd | 11 from utils import FindBaseNaCl, GetObjdumpCmd, shellcmd |
| 12 | 12 |
| 13 | 13 |
| 14 def TargetAssemblerFlags(target, sandboxed): | 14 def TargetAssemblerFlags(target, sandboxed): |
| 15 # TODO(reed kotler). Need to find out exactly we need to | 15 # TODO(reed kotler). Need to find out exactly we need to |
| 16 # add here for Mips32. | 16 # add here for Mips32. |
| 17 flags = { 'x8632': ['-triple=%s' % ('i686-nacl' if sandboxed else 'i686')], | 17 flags = { 'x8632': ['-triple=%s' % ('i686-nacl' if sandboxed else 'i686')], |
| 18 'x8664': ['-triple=%s' % ( | 18 'x8664': ['-triple=%s' % ( |
| 19 'x86_64-nacl' if sandboxed else 'x86_64')], | 19 'x86_64-nacl' if sandboxed else 'x86_64')], |
| 20 'arm32': ['-triple=%s' % ( | 20 'arm32': ['-triple=%s' % ( |
| 21 'armv7a-nacl' if sandboxed else 'armv7a'), | 21 'armv7a-nacl' if sandboxed else 'armv7a'), |
| 22 '-mcpu=cortex-a9', '-mattr=+neon'], | 22 '-mcpu=cortex-a9', '-mattr=+neon'], |
| 23 'mips32': ['-triple=mipsel' ] } | 23 'mips32': ['-triple=%s' ('mipsel-nacl' if sandboxed else 'mipsel'), |
| 24 '-mattr=msa'] } |
| 24 return flags[target] | 25 return flags[target] |
| 25 | 26 |
| 26 | 27 |
| 27 def TargetDisassemblerFlags(target): | 28 def TargetDisassemblerFlags(target): |
| 28 flags = { 'x8632': ['-Mintel'], | 29 flags = { 'x8632': ['-Mintel'], |
| 29 'x8664': ['-Mintel'], | 30 'x8664': ['-Mintel'], |
| 30 'arm32': [], | 31 'arm32': [], |
| 31 'mips32':[] } | 32 'mips32':[] } |
| 32 return flags[target] | 33 return flags[target] |
| 33 | 34 |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 [output_file_name]) | 209 [output_file_name]) |
| 209 | 210 |
| 210 stdout_result = shellcmd(cmd, echo=args.echo_cmd) | 211 stdout_result = shellcmd(cmd, echo=args.echo_cmd) |
| 211 if not args.echo_cmd: | 212 if not args.echo_cmd: |
| 212 sys.stdout.write(stdout_result) | 213 sys.stdout.write(stdout_result) |
| 213 if asm_temp and not keep_output_file: | 214 if asm_temp and not keep_output_file: |
| 214 os.remove(output_file_name) | 215 os.remove(output_file_name) |
| 215 | 216 |
| 216 if __name__ == '__main__': | 217 if __name__ == '__main__': |
| 217 main() | 218 main() |
| OLD | NEW |