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

Side by Side Diff: pydir/build-runtime.py

Issue 961413002: Subzero: Clean up the runtime implementation. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Change static helper strings to be char* instead of IceString Created 5 years, 9 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | runtime/szrt.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 shutil 5 import shutil
6 import tempfile 6 import tempfile
7 from utils import shellcmd 7 from utils import shellcmd
8 from utils import FindBaseNaCl 8 from utils import FindBaseNaCl
9 9
10 def Translate(ll_files, extra_args, obj, verbose): 10 def Translate(ll_files, extra_args, obj, verbose):
11 """Translate a set of input bitcode files into a single object file. 11 """Translate a set of input bitcode files into a single object file.
12 12
13 Use pnacl-llc to translate textual bitcode input ll_files into object file 13 Use pnacl-llc to translate textual bitcode input ll_files into object file
14 obj, using extra_args as the architectural flags. 14 obj, using extra_args as the architectural flags.
15 """ 15 """
16 shellcmd(['cat'] + ll_files + ['|', 16 shellcmd(['cat'] + ll_files + ['|',
17 'pnacl-llc', 17 'pnacl-llc',
18 '-externalize', 18 '-externalize',
19 '-function-sections',
20 '-O2',
19 '-filetype=obj', 21 '-filetype=obj',
20 '-bitcode-format=llvm', 22 '-bitcode-format=llvm',
21 '-o', obj 23 '-o', obj
22 ] + extra_args, echo=verbose) 24 ] + extra_args, echo=verbose)
23 shellcmd(['objcopy', 25 shellcmd(['objcopy',
24 '--localize-symbol=nacl_tp_tdb_offset', 26 '--localize-symbol=nacl_tp_tdb_offset',
25 '--localize-symbol=nacl_tp_tls_offset', 27 '--localize-symbol=nacl_tp_tls_offset',
26 obj 28 obj
27 ], echo=verbose) 29 ], echo=verbose)
28 30
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 args.verbose) 84 args.verbose)
83 finally: 85 finally:
84 try: 86 try:
85 shutil.rmtree(tempdir) 87 shutil.rmtree(tempdir)
86 except OSError as exc: 88 except OSError as exc:
87 if exc.errno != errno.ENOENT: # ENOENT - no such file or directory 89 if exc.errno != errno.ENOENT: # ENOENT - no such file or directory
88 raise # re-raise exception 90 raise # re-raise exception
89 91
90 if __name__ == '__main__': 92 if __name__ == '__main__':
91 main() 93 main()
OLDNEW
« no previous file with comments | « no previous file | runtime/szrt.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698