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

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

Issue 2482123002: Subzero, MIPS32: Sandbox initial patch (Closed)
Patch Set: Minor addition, formatting Created 4 years, 1 month 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 | src/IceTargetLoweringMIPS32.h » ('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 7
8 import targets 8 import targets
9 from utils import FindBaseNaCl, GetObjcopyCmd, shellcmd 9 from utils import FindBaseNaCl, GetObjcopyCmd, shellcmd
10 10
11 11
12 def Translate(ll_files, extra_args, obj, verbose, target): 12 def Translate(ll_files, extra_args, obj, verbose, target):
13 """Translate a set of input bitcode files into a single object file. 13 """Translate a set of input bitcode files into a single object file.
14 14
15 Use pnacl-llc to translate textual bitcode input ll_files into object file 15 Use pnacl-llc to translate textual bitcode input ll_files into object file
16 obj, using extra_args as the architectural flags. 16 obj, using extra_args as the architectural flags.
17 """ 17 """
18 externalize = [] if target == 'mips32' else ['-externalize'] 18 externalize = ['-externalize']
19 shellcmd(['cat'] + ll_files + ['|', 19 shellcmd(['cat'] + ll_files + ['|',
20 'pnacl-llc', 20 'pnacl-llc',
21 '-function-sections', 21 '-function-sections',
22 '-O2', 22 '-O2',
23 '-filetype=obj', 23 '-filetype=obj',
24 '-bitcode-format=llvm', 24 '-bitcode-format=llvm',
25 '-o', obj 25 '-o', obj
26 ] + extra_args + externalize, echo=verbose) 26 ] + extra_args + externalize, echo=verbose)
27 strip_syms = [] if target == 'mips32' else ['nacl_tp_tdb_offset', 27 localize_syms = ['nacl_tp_tdb_offset', 'nacl_tp_tls_offset']
28 'nacl_tp_tls_offset'] 28
29 shellcmd([GetObjcopyCmd(target), obj] + 29 shellcmd([GetObjcopyCmd(target), obj] +
30 [('--strip-symbol=' + sym) for sym in strip_syms]) 30 [('--localize-symbol=' + sym) for sym in localize_syms])
31 31
32 32
33 def PartialLink(obj_files, extra_args, lib, verbose): 33 def PartialLink(obj_files, extra_args, lib, verbose):
34 """Partially links a set of obj files into a final obj library.""" 34 """Partially links a set of obj files into a final obj library."""
35 shellcmd(['le32-nacl-ld', 35 shellcmd(['le32-nacl-ld',
36 '-o', lib, 36 '-o', lib,
37 '-r', 37 '-r',
38 ] + extra_args + obj_files, echo=verbose) 38 ] + extra_args + obj_files, echo=verbose)
39 39
40 40
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 223
224 finally: 224 finally:
225 try: 225 try:
226 shutil.rmtree(tempdir) 226 shutil.rmtree(tempdir)
227 except OSError as exc: 227 except OSError as exc:
228 if exc.errno != errno.ENOENT: # ENOENT - no such file or directory 228 if exc.errno != errno.ENOENT: # ENOENT - no such file or directory
229 raise # re-raise exception 229 raise # re-raise exception
230 230
231 if __name__ == '__main__': 231 if __name__ == '__main__':
232 main() 232 main()
OLDNEW
« no previous file with comments | « no previous file | src/IceTargetLoweringMIPS32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698