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

Side by Side Diff: pydir/szbuild.py

Issue 1559243002: Suzero. X8664. NaCl Sandboxing. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fixes filetype=asm; addresses comments. Created 4 years, 11 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 | « pydir/run-pnacl-sz.py ('k') | pydir/targets.py » ('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 pipes 5 import pipes
6 import re 6 import re
7 import sys 7 import sys
8 8
9 from utils import shellcmd, FindBaseNaCl, get_sfi_string 9 from utils import shellcmd, FindBaseNaCl, get_sfi_string
10 10
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 action='store_true', 96 action='store_true',
97 help='Display some extra debugging output') 97 help='Display some extra debugging output')
98 argparser.add_argument('--sz', dest='sz_args', action='append', default=[], 98 argparser.add_argument('--sz', dest='sz_args', action='append', default=[],
99 help='Extra arguments for Subzero') 99 help='Extra arguments for Subzero')
100 argparser.add_argument('--llc', dest='llc_args', action='append', 100 argparser.add_argument('--llc', dest='llc_args', action='append',
101 default=[], help='Extra arguments for llc') 101 default=[], help='Extra arguments for llc')
102 argparser.add_argument('--no-sz', dest='nosz', action='store_true', 102 argparser.add_argument('--no-sz', dest='nosz', action='store_true',
103 help='Run only post-Subzero build steps') 103 help='Run only post-Subzero build steps')
104 104
105 def LinkSandbox(objs, exe, target, verbose=True): 105 def LinkSandbox(objs, exe, target, verbose=True):
106 assert target in ('x8632', 'arm32'), \ 106 assert target in ('x8632', 'x8664', 'arm32'), \
107 '-sandbox is not available for %s' % target 107 '-sandbox is not available for %s' % target
108 nacl_root = FindBaseNaCl() 108 nacl_root = FindBaseNaCl()
109 gold = ('{root}/toolchain/linux_x86/pnacl_newlib_raw/bin/' + 109 gold = ('{root}/toolchain/linux_x86/pnacl_newlib_raw/bin/' +
110 'le32-nacl-ld.gold').format(root=nacl_root) 110 'le32-nacl-ld.gold').format(root=nacl_root)
111 target_lib_dir = { 111 target_lib_dir = {
112 'arm32': 'arm', 112 'arm32': 'arm',
113 'x8632': 'x86-32', 113 'x8632': 'x86-32',
114 'x8664': 'x86-64',
114 }[target] 115 }[target]
115 linklib = ('{root}/toolchain/linux_x86/pnacl_newlib_raw/translator/' + 116 linklib = ('{root}/toolchain/linux_x86/pnacl_newlib_raw/translator/' +
116 '{target_dir}/lib').format(root=nacl_root, 117 '{target_dir}/lib').format(root=nacl_root,
117 target_dir=target_lib_dir) 118 target_dir=target_lib_dir)
118 shellcmd([gold, 119 shellcmd([gold,
119 '-nostdlib', 120 '-nostdlib',
120 '--no-fix-cortex-a8', 121 '--no-fix-cortex-a8',
121 '--eh-frame-hdr', 122 '--eh-frame-hdr',
122 '-z', 'text', 123 '-z', 'text',
123 #'-z', 'noexecstack', 124 #'-z', 'noexecstack',
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 echo=args.verbose) 411 echo=args.verbose)
411 obj_partial = pexe_base + '.o' 412 obj_partial = pexe_base + '.o'
412 ld = { 413 ld = {
413 'arm32': 'arm-linux-gnueabihf-ld', 414 'arm32': 'arm-linux-gnueabihf-ld',
414 'x8632': 'ld', 415 'x8632': 'ld',
415 'x8664': 'ld', 416 'x8664': 'ld',
416 }[args.target] 417 }[args.target]
417 emulation = { 418 emulation = {
418 'arm32': 'armelf_linux_eabi', 419 'arm32': 'armelf_linux_eabi',
419 'x8632': 'elf_i386', 420 'x8632': 'elf_i386',
420 'x8664': 'elf32_x86_64', 421 'x8664': 'elf32_x86_64' if not args.sandbox else 'elf_x86_64',
421 }[args.target] 422 }[args.target]
422 shellcmd(( 423 shellcmd((
423 '{ld} -r -m {emulation} -o {partial} {sz} {llc}' 424 '{ld} -r -m {emulation} -o {partial} {sz} {llc}'
424 ).format(ld=ld, emulation=emulation, partial=obj_partial, 425 ).format(ld=ld, emulation=emulation, partial=obj_partial,
425 sz=obj_sz_weak, llc=obj_llc_weak), 426 sz=obj_sz_weak, llc=obj_llc_weak),
426 echo=args.verbose) 427 echo=args.verbose)
427 shellcmd(( 428 shellcmd((
428 '{objcopy} -w --localize-symbol="*" {partial}' 429 '{objcopy} -w --localize-symbol="*" {partial}'
429 ).format(objcopy=objcopy, partial=obj_partial), 430 ).format(objcopy=objcopy, partial=obj_partial),
430 echo=args.verbose) 431 echo=args.verbose)
(...skipping 15 matching lines...) Expand all
446 447
447 # Put the extra verbose printing at the end. 448 # Put the extra verbose printing at the end.
448 if args.verbose and hybrid: 449 if args.verbose and hybrid:
449 print 'include={regex}'.format(regex=re_include_str) 450 print 'include={regex}'.format(regex=re_include_str)
450 print 'exclude={regex}'.format(regex=re_exclude_str) 451 print 'exclude={regex}'.format(regex=re_exclude_str)
451 print 'default_match={dm}'.format(dm=default_match) 452 print 'default_match={dm}'.format(dm=default_match)
452 print 'Number of Subzero syms = {num}'.format(num=len(sz_syms)) 453 print 'Number of Subzero syms = {num}'.format(num=len(sz_syms))
453 454
454 if __name__ == '__main__': 455 if __name__ == '__main__':
455 main() 456 main()
OLDNEW
« no previous file with comments | « pydir/run-pnacl-sz.py ('k') | pydir/targets.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698