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

Unified Diff: pydir/szbuild.py

Issue 892803002: Subzero: Add a --elf arg to szbuild.py and crosstest.py. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pydir/crosstest.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pydir/szbuild.py
diff --git a/pydir/szbuild.py b/pydir/szbuild.py
index b9e648567472713b326dd1044f009d36043e4f6f..7fcb924514616e59c0b7e64e57d3b9fba0013691 100755
--- a/pydir/szbuild.py
+++ b/pydir/szbuild.py
@@ -80,6 +80,9 @@ def AddOptionalArgs(argparser):
help='Optimization level ' +
'(m1 and -1 are equivalent).' +
' Default %(default)s.')
+ argparser.add_argument('--elf', dest='elf',
+ action='store_true',
+ help='Directly generate ELF output')
argparser.add_argument('--verbose', '-v', dest='verbose',
action='store_true',
help='Display some extra debugging output')
@@ -202,16 +205,18 @@ def ProcessPexe(args, pexe, exe):
shellcmd([llvm2ice,
'-O' + opt_level,
'-bitcode-format=pnacl',
- '-o', asm_sz] +
+ '-o', obj_sz if args.elf else asm_sz] +
(['-externalize',
'-ffunction-sections',
'-fdata-sections'] if hybrid else []) +
+ (['-elf-writer'] if args.elf else []) +
args.sz_args +
[pexe],
echo=args.verbose)
- shellcmd((
- 'llvm-mc -arch=x86 -filetype=obj -o {obj} {asm}'
- ).format(asm=asm_sz, obj=obj_sz), echo=args.verbose)
+ if not args.elf:
+ shellcmd((
+ 'llvm-mc -arch=x86 -filetype=obj -o {obj} {asm}'
+ ).format(asm=asm_sz, obj=obj_sz), echo=args.verbose)
shellcmd((
'objcopy --redefine-sym _start=_user_start {obj}'
).format(obj=obj_sz), echo=args.verbose)
« no previous file with comments | « pydir/crosstest.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698