| 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 subprocess | 5 import subprocess |
| 6 import sys | 6 import sys |
| 7 import tempfile | 7 import tempfile |
| 8 | 8 |
| 9 import targets | 9 import targets |
| 10 from utils import shellcmd | 10 from utils import shellcmd |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 target_params = [] | 189 target_params = [] |
| 190 if needs_stack_hack: | 190 if needs_stack_hack: |
| 191 shellcmd('{bin}/clang -g -o stack_hack.x8664.{key}.o -c ' | 191 shellcmd('{bin}/clang -g -o stack_hack.x8664.{key}.o -c ' |
| 192 'stack_hack.x8664.c'.format(bin=bindir, key=key)) | 192 'stack_hack.x8664.c'.format(bin=bindir, key=key)) |
| 193 target_params.append('-DX8664_STACK_HACK') | 193 target_params.append('-DX8664_STACK_HACK') |
| 194 target_params.append('stack_hack.x8664.{key}.o'.format(key=key)) | 194 target_params.append('stack_hack.x8664.{key}.o'.format(key=key)) |
| 195 | 195 |
| 196 if args.target == 'arm32': | 196 if args.target == 'arm32': |
| 197 target_params.append('-DARM32') | 197 target_params.append('-DARM32') |
| 198 target_params.append('-static') | 198 target_params.append('-static') |
| 199 | 199 |
| 200 # Set compiler to clang, clang++, pnacl-clang, or pnacl-clang++. | 200 # Set compiler to clang, clang++, pnacl-clang, or pnacl-clang++. |
| 201 compiler = '{bin}/{prefix}{cc}'.format( | 201 compiler = '{bin}/{prefix}{cc}'.format( |
| 202 bin=bindir, prefix='pnacl-' if args.sandbox else '', | 202 bin=bindir, prefix='pnacl-' if args.sandbox else '', |
| 203 cc='clang' if pure_c else 'clang++') | 203 cc='clang' if pure_c else 'clang++') |
| 204 sb_native_args = (['-O0', '--pnacl-allow-native', | 204 sb_native_args = (['-O0', '--pnacl-allow-native', |
| 205 '-arch', target_info.target, | 205 '-arch', target_info.target, |
| 206 '-Wn,-defsym=__Sz_AbsoluteZero=0'] | 206 '-Wn,-defsym=__Sz_AbsoluteZero=0'] |
| 207 if args.sandbox else | 207 if args.sandbox else |
| 208 ['-g', '-target=' + triple, | 208 ['-g', '-target=' + triple, |
| 209 '-lm', '-lpthread', | 209 '-lm', '-lpthread', |
| 210 '-Wl,--defsym=__Sz_AbsoluteZero=0'] + | 210 '-Wl,--defsym=__Sz_AbsoluteZero=0'] + |
| 211 target_info.cross_headers) | 211 target_info.cross_headers) |
| 212 shellcmd([compiler] + target_params + [args.driver] + objs + | 212 shellcmd([compiler] + target_params + [args.driver] + objs + |
| 213 ['-o', os.path.join(args.dir, args.output)] + sb_native_args) | 213 ['-o', os.path.join(args.dir, args.output)] + sb_native_args) |
| 214 | 214 |
| 215 if __name__ == '__main__': | 215 if __name__ == '__main__': |
| 216 main() | 216 main() |
| OLD | NEW |