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 from utils import shellcmd | 9 from utils import shellcmd |
10 from utils import FindBaseNaCl | 10 from utils import FindBaseNaCl |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 # Add szrt_sb_x8632.o or szrt_native_x8632.o. | 139 # Add szrt_sb_x8632.o or szrt_native_x8632.o. |
140 objs.append(( | 140 objs.append(( |
141 '{root}/toolchain_build/src/subzero/build/runtime/' + | 141 '{root}/toolchain_build/src/subzero/build/runtime/' + |
142 'szrt_{sb}_' + args.target + '.o' | 142 'szrt_{sb}_' + args.target + '.o' |
143 ).format(root=nacl_root, sb='sb' if args.sandbox else 'native')) | 143 ).format(root=nacl_root, sb='sb' if args.sandbox else 'native')) |
144 pure_c = os.path.splitext(args.driver)[1] == '.c' | 144 pure_c = os.path.splitext(args.driver)[1] == '.c' |
145 # Set compiler to clang, clang++, pnacl-clang, or pnacl-clang++. | 145 # Set compiler to clang, clang++, pnacl-clang, or pnacl-clang++. |
146 compiler = '{bin}/{prefix}{cc}'.format( | 146 compiler = '{bin}/{prefix}{cc}'.format( |
147 bin=bindir, prefix='pnacl-' if args.sandbox else '', | 147 bin=bindir, prefix='pnacl-' if args.sandbox else '', |
148 cc='clang' if pure_c else 'clang++') | 148 cc='clang' if pure_c else 'clang++') |
149 sb_native_args = (['-O0', '--pnacl-allow-native', '-arch', 'x8632'] | 149 sb_native_args = (['-O0', '--pnacl-allow-native', '-arch', 'x8632', |
| 150 '-Wn,-defsym=__Sz_AbsoluteZero=0'] |
150 if args.sandbox else | 151 if args.sandbox else |
151 ['-g', '-m32', '-lm', '-lpthread']) | 152 ['-g', '-m32', '-lm', '-lpthread', |
| 153 '-Wl,--defsym=__Sz_AbsoluteZero=0']) |
152 shellcmd([compiler, args.driver] + objs + | 154 shellcmd([compiler, args.driver] + objs + |
153 ['-o', os.path.join(args.dir, args.output)] + sb_native_args) | 155 ['-o', os.path.join(args.dir, args.output)] + sb_native_args) |
154 | 156 |
155 if __name__ == '__main__': | 157 if __name__ == '__main__': |
156 main() | 158 main() |
OLD | NEW |