| 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 re | 5 import re |
| 6 import subprocess | 6 import subprocess |
| 7 import sys | 7 import sys |
| 8 import tempfile | 8 import tempfile |
| 9 | 9 |
| 10 from utils import shellcmd | 10 from utils import shellcmd |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 for line in ll_lines: | 95 for line in ll_lines: |
| 96 line = remove_internal.sub('define ', line) | 96 line = remove_internal.sub('define ', line) |
| 97 line = fix_target.sub('i686-pc-linux-gnu', line) | 97 line = fix_target.sub('i686-pc-linux-gnu', line) |
| 98 f.write(line) | 98 f.write(line) |
| 99 f.close() | 99 f.close() |
| 100 | 100 |
| 101 base_sz = '%s.O%s.%s.%s' % (base, args.optlevel, args.attr, args.target) | 101 base_sz = '%s.O%s.%s.%s' % (base, args.optlevel, args.attr, args.target) |
| 102 asm_sz = os.path.join(args.dir, base_sz + '.sz.s') | 102 asm_sz = os.path.join(args.dir, base_sz + '.sz.s') |
| 103 obj_sz = os.path.join(args.dir, base_sz + '.sz.o') | 103 obj_sz = os.path.join(args.dir, base_sz + '.sz.o') |
| 104 obj_llc = os.path.join(args.dir, base + '.llc.o') | 104 obj_llc = os.path.join(args.dir, base + '.llc.o') |
| 105 shellcmd(['../llvm2ice', | 105 shellcmd(['../pnacl-sz', |
| 106 '-O' + args.optlevel, | 106 '-O' + args.optlevel, |
| 107 '-mattr=' + args.attr, | 107 '-mattr=' + args.attr, |
| 108 '--target=' + args.target, | 108 '--target=' + args.target, |
| 109 '--prefix=' + args.prefix, | 109 '--prefix=' + args.prefix, |
| 110 '-allow-uninitialized-globals', | 110 '-allow-uninitialized-globals', |
| 111 '-filetype=' + args.filetype, | 111 '-filetype=' + args.filetype, |
| 112 '-o=' + (obj_sz if args.filetype == 'obj' else asm_sz), | 112 '-o=' + (obj_sz if args.filetype == 'obj' else asm_sz), |
| 113 bitcode]) | 113 bitcode]) |
| 114 if args.filetype != 'obj': | 114 if args.filetype != 'obj': |
| 115 shellcmd(['llvm-mc', | 115 shellcmd(['llvm-mc', |
| (...skipping 29 matching lines...) Expand all Loading... |
| 145 objs.append(bitcode) | 145 objs.append(bitcode) |
| 146 | 146 |
| 147 objs.append(( | 147 objs.append(( |
| 148 '{root}/toolchain_build/src/subzero/build/runtime/' + | 148 '{root}/toolchain_build/src/subzero/build/runtime/' + |
| 149 'szrt_native_x8632.o' | 149 'szrt_native_x8632.o' |
| 150 ).format(root=nacl_root)) | 150 ).format(root=nacl_root)) |
| 151 linker = 'clang' if pure_c else 'clang++' | 151 linker = 'clang' if pure_c else 'clang++' |
| 152 shellcmd([linker, '-g', '-m32', args.driver] + | 152 shellcmd([linker, '-g', '-m32', args.driver] + |
| 153 objs + | 153 objs + |
| 154 ['-lm', '-lpthread', '-o', os.path.join(args.dir, args.output)]) | 154 ['-lm', '-lpthread', '-o', os.path.join(args.dir, args.output)]) |
| OLD | NEW |